This commit is contained in:
AbrahamCastilloV
2023-12-26 18:57:20 -07:00
28 changed files with 774 additions and 654 deletions

View File

@@ -974,7 +974,7 @@ Public Class ClsInventarios
Retorno = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString.ToEntero Retorno = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString.ToEntero
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al obtener los movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) OnError("Ocurrió un error al obtener los folios de movimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try End Try
Return Retorno Return Retorno
@@ -1175,14 +1175,13 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function GetMovimientosDetalle(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveCompra As Integer = -1, Optional CveMovimientoDetalle As Integer = -1, Optional Resumen As Boolean = False) As Boolean Public Function GetMovimientosDetalle(CveMovimiento As Integer, CveEmpresa As Integer, Optional CveMovimientoDetalle As Integer = -1, Optional Resumen As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleGet") DataAdapter("PA_Inv_MovimientosDetalleGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle .Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle
.Add("@Resumen", SqlDbType.Int).Value = Resumen .Add("@Resumen", SqlDbType.Int).Value = Resumen

View File

@@ -852,15 +852,13 @@ Public Class ClsOS
Return Retorno Return Retorno
End Function End Function
Public Function GetDetalleMateriales(CveOSDetalle As Integer, CveOS As Integer, Opcion As Integer, Optional FiltraTipoAlmacen As Boolean = False) As Boolean Public Function GetDetalleMateriales(CveOSDetalle As Integer, CveOS As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServicioDetallesMaterialesGet") DataAdapter("PA_OS_OrdenesServicioDetallesMaterialesGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveOSDetalle", SqlDbType.Int).Value = CveOSDetalle .Add("@CveOSDetalle", SqlDbType.Int).Value = CveOSDetalle
.Add("@CveOS", SqlDbType.Int).Value = CveOS .Add("@CveOS", SqlDbType.Int).Value = CveOS
.Add("@FiltraTipoAlmacen", SqlDbType.Bit).Value = FiltraTipoAlmacen
.Add("@Opcion", SqlDbType.Int).Value = Opcion
End With End With
Try Try
@@ -1328,14 +1326,14 @@ Public Class ClsOS
Return Retorno Return Retorno
End Function End Function
Public Function GetOrdenesServicioDevolucionMaterial(CveOS As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean Public Function GetOrdenesServicioDevolucionMaterial(CveOS As Integer, CveVenta As Integer, Opcion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServicioDevolucionMaterialGet") DataAdapter("PA_OS_OrdenesServicioDevolucionMaterialGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveOS", SqlDbType.Int).Value = CveOS .Add("@CveOS", SqlDbType.Int).Value = CveOS
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With

View File

@@ -1807,6 +1807,26 @@ Public Class ClsPaginas
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTGralCartaPorteConfigAutoTransportes() As DataTable
Get
Dim AppNombre As String = "GetCartaPorteConfigAutoTransportes"
If Application(AppNombre) Is Nothing Then
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
Application(AppNombre) = ObjGrales.DtResultados
End If
End Using
End If
GlobalDTGralCartaPorteConfigAutoTransportes = DirectCast(Application(AppNombre), DataTable)
End Get
Set(value As DataTable)
Dim AppNombre As String = "GetCartaPorteConfigAutoTransportes"
Application(AppNombre) = value
End Set
End Property
Property GlobalDTAFCaracteristicasOpciones() As DataTable Property GlobalDTAFCaracteristicasOpciones() As DataTable
Get Get
GlobalDTAFCaracteristicasOpciones = DirectCast(Application("GlobalDTAFCaracteristicasOpciones"), DataTable) GlobalDTAFCaracteristicasOpciones = DirectCast(Application("GlobalDTAFCaracteristicasOpciones"), DataTable)

View File

@@ -1976,7 +1976,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double) As Integer Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Vta_PrecioListaAdd") DataAdapter("PA_Vta_PrecioListaAdd")
@@ -1987,6 +1987,7 @@ Public Class ClsVentas
.Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista .Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada .Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
.Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar
.Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output
End With End With
@@ -3850,24 +3851,24 @@ Public Class ClsVentas
#End Region #End Region
#Region " FLETES " '#Region " FLETES "
Public Function GetFletes(CveEmpresa As Integer) As Boolean ' Public Function GetFletes(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False ' Dim Retorno As Boolean = False
DataAdapter("PA_WT_Viajes") ' DataAdapter("PA_WT_Viajes")
With SqlAdapter.SelectCommand.Parameters ' With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With ' End With
Try ' Try
SqlAdapter.Fill(Data) ' SqlAdapter.Fill(Data)
Retorno = True ' Retorno = True
Catch Ex As SqlException ' Catch Ex As SqlException
Me.OnError("Ocurrió un error al intentar obtener los Fletes", Ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) ' Me.OnError("Ocurrió un error al intentar obtener los Fletes", Ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try ' End Try
Return Retorno ' Return Retorno
End Function ' End Function
#End Region '#End Region
#Region "Metodos y Forma de Pago" #Region "Metodos y Forma de Pago"

View File

@@ -2153,7 +2153,8 @@ Namespace Modelos
PedidoContrato:=factura.PedidoContrato, ObservacionesAlmacen:=factura.ObservacionesAlmacen, CveSubProyecto:=factura.CveSubProyecto, CveSubProyectoCobranza:=factura.CveSubProyectoCobranza, CveSubProyectoEjecucion:=factura.CveSubProyectoEjecucion, CveFormaPago33:=factura.CveFormaPago33, PedidoContrato:=factura.PedidoContrato, ObservacionesAlmacen:=factura.ObservacionesAlmacen, CveSubProyecto:=factura.CveSubProyecto, CveSubProyectoCobranza:=factura.CveSubProyectoCobranza, CveSubProyectoEjecucion:=factura.CveSubProyectoEjecucion, CveFormaPago33:=factura.CveFormaPago33,
CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=factura.OrdenCompra, CveCuentaTerminal:=factura.CveCuentaTerminal, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal, CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=factura.OrdenCompra, CveCuentaTerminal:=factura.CveCuentaTerminal, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal,
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta) Then CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta,
CveMedico:=factura.CveMedico, CveProcedimiento:=factura.CveProcedimiento, CveTipoVenta:=factura.CveTipoVenta) Then
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
@@ -7669,6 +7670,9 @@ Namespace Modelos
Public Property CveContratoSecciones As String = "" Public Property CveContratoSecciones As String = ""
Public Property CveEstatus As Integer Public Property CveEstatus As Integer
Public Property GenerarPDFFactura As Boolean = False Public Property GenerarPDFFactura As Boolean = False
Public Property CveMedico As Integer = -1
Public Property CveProcedimiento As Integer = -1
Public Property CveTipoVenta As Integer = -1
#End Region #End Region
End Class End Class

View File

@@ -92,7 +92,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional context As HttpContext = Nothing) As Boolean Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1, Optional CveUsuarioPara As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional context As HttpContext = Nothing) As Boolean
Dim ObjEventos As New ClsOIEventos Dim ObjEventos As New ClsOIEventos
Dim ErrorEventos = False Dim ErrorEventos As Boolean = False
Dim CveEmpresaCRM As Integer = 0 Dim CveEmpresaCRM As Integer = 0
Dim DT_SubProyectos As New System.Data.DataTable Dim DT_SubProyectos As New System.Data.DataTable
@@ -100,7 +100,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
DT_SubProyectos.Columns.Add("CveSubProyecto", GetType(Integer)) DT_SubProyectos.Columns.Add("CveSubProyecto", GetType(Integer))
DT_SubProyectos.Columns.Add("backgroundColor") DT_SubProyectos.Columns.Add("backgroundColor")
Dim DT_EstatusOS = New DataTable Dim DT_EstatusOS As New DataTable
DT_EstatusOS.Columns.Add("", GetType(Integer)) DT_EstatusOS.Columns.Add("", GetType(Integer))
@@ -126,8 +126,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
If DtTempSubproyectos.Rows.Count > 0 Then If DtTempSubproyectos.Rows.Count > 0 Then
For Each drow As DataRow In DtTempSubproyectos.Rows For Each drow As DataRow In DtTempSubproyectos.Rows
Dim Subrow As DataRow = DT_SubProyectos.NewRow
Dim Subrow = DT_SubProyectos.NewRow
Subrow("CveSubProyecto") = drow("CveSubProyecto").ToString.ToEntero Subrow("CveSubProyecto") = drow("CveSubProyecto").ToString.ToEntero
Subrow("backgroundColor") = Colores(ColorIndex) Subrow("backgroundColor") = Colores(ColorIndex)
@@ -278,9 +277,9 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
'EMPIEZA METODO PARA AGREGAR CUANDO SI ES RECURRENTE 'EMPIEZA METODO PARA AGREGAR CUANDO SI ES RECURRENTE
Dim FinRecurrencia = cevent.recurrenciafin.ToEntero Dim FinRecurrencia As Integer = cevent.recurrenciafin.ToEntero
Dim FI As DateTime, FF As DateTime, FT As DateTime Dim FI As DateTime, FF As DateTime, FT As DateTime
Dim DiasSemana = cevent.diassemana.Split(","c) Dim DiasSemana As String() = cevent.diassemana.Split(","c)
FI = cevent.start.ToDateTime FI = cevent.start.ToDateTime
FF = cevent.end.ToDateTime FF = cevent.end.ToDateTime
@@ -311,7 +310,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Do Do
If DiasSemana.Length > 0 AndAlso DiasSemana(0) <> "" Then If DiasSemana.Length > 0 AndAlso DiasSemana(0) <> "" Then
For Each drDias As String In DiasSemana For Each drDias As String In DiasSemana
Dim FIT = FI, FFT = FF Dim FIT As Date = FI, FFT As Date = FF
FIT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FI)).ToString.ToDouble, FI) FIT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FI)).ToString.ToDouble, FI)
FFT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FF)).ToString.ToDouble, FF) FFT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FF)).ToString.ToDouble, FF)
@@ -376,9 +375,6 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero
cevent.Prospecto = dr("Prospecto").ToString cevent.Prospecto = dr("Prospecto").ToString
'11/05/2018 - Evento Gasto Recurrente '11/05/2018 - Evento Gasto Recurrente
cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
If cevent.CveTipoEvento = 10 Then If cevent.CveTipoEvento = 10 Then
@@ -415,11 +411,7 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Loop Until FI > FT Loop Until FI > FT
End If End If
End If End If
Next Next
Catch ex As Exception Catch ex As Exception
GuardaLog(ex.ToString()) GuardaLog(ex.ToString())

View File

@@ -330,8 +330,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
If DtEmpresas IsNot Nothing Then If DtEmpresas IsNot Nothing Then
For Each Row As DataRow In DtEmpresas.Rows For Each Row As DataRow In DtEmpresas.Rows
Dim Usuario = ValidaUsuarioSistema(Row("CveEmpresa").ToString().ToEntero()) Dim Usuario As Usuario = ValidaUsuarioSistema(Row("CveEmpresa").ToString().ToEntero())
Dim obj = EjecutarEnvioEstadoCuenta(Usuario, FechaEnvio, FechaActual, pCveCliente:=pCveCliente) Dim obj As JObject = EjecutarEnvioEstadoCuenta(Usuario, FechaEnvio, FechaActual, pCveCliente:=pCveCliente)
Retorno.Add(obj) Retorno.Add(obj)
Next Next
@@ -350,8 +350,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim ObjUsuarios As New ClsSisUsuarios Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetUsuarios(100) Then If ObjUsuarios.GetUsuarios(100) Then
If ObjUsuarios.DtResultados.Rows.Count > 0 Then If ObjUsuarios.DtResultados.Rows.Count > 0 Then
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString() Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString() Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa) UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa)
UsuarioActual.CveEmpresa = CveEmpresa UsuarioActual.CveEmpresa = CveEmpresa
CreaObjetoEmpresa(UsuarioActual) CreaObjetoEmpresa(UsuarioActual)
@@ -402,7 +402,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim FechaF As String = "-1" Dim FechaF As String = "-1"
Dim FechaVI As String = "-1" Dim FechaVI As String = "-1"
Dim FechaVF As String = "-1" Dim FechaVF As String = "-1"
Dim TCEspecifico = -1 Dim TCEspecifico As Decimal = -1
Dim CveCobranzaEstatus As Integer = -1 Dim CveCobranzaEstatus As Integer = -1
Dim CveClienteClasificacion As Integer = -1 Dim CveClienteClasificacion As Integer = -1
@@ -417,7 +417,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim FechaCorte As DateTime = New DateTime(ClsPaginas.NowADS().Year, 12, 31) Dim FechaCorte As DateTime = New DateTime(ClsPaginas.NowADS().Year, 12, 31)
If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte, If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte,
EstatusCliente:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=-1, TipoCliente:=-1, AplicaAnticiposPagados:=AplicaAnticipos) Then EstatusCliente:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=CveCobranzaEstatus, CveClienteClasificacion:=-1, TipoCliente:=-1 ) Then
DTClientes = ObjMov.DtResultados.FiltraParametros("CveCliente > 0", DistinctColumns:={"CveCliente"}) DTClientes = ObjMov.DtResultados.FiltraParametros("CveCliente > 0", DistinctColumns:={"CveCliente"})
End If End If
@@ -536,7 +536,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim Formato As String = "PDF" Dim Formato As String = "PDF"
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.rpt", UsuarioActual.Empresa.Ruta)) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepClientesCxC.rpt", UsuarioActual.Empresa.Ruta))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa)
'OBTENEMOS LOS DATOS 'OBTENEMOS LOS DATOS
Dim DtCxCFact As DataTable = Nothing Dim DtCxCFact As DataTable = Nothing
@@ -672,7 +672,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
If DtCxCFact2 IsNot Nothing AndAlso DtCxCFact2.Rows.Count > 0 Then If DtCxCFact2 IsNot Nothing AndAlso DtCxCFact2.Rows.Count > 0 Then
Dim dr As DataRow = DtCxCFact2.Rows(0) Dim dr As DataRow = DtCxCFact2.Rows(0)
Dim lista = New List(Of CrystalParametro) Dim lista As New List(Of CrystalParametro)
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)) lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo")) lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre)) lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
@@ -714,7 +714,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
GuardaLog("Ocurrió un erro al obtener el CxC" + ex.ToString()) GuardaLog("Ocurrió un erro al obtener el CxC" + ex.ToString())
End Try End Try
Else Else
Dim lista = New List(Of CrystalParametro) Dim lista As New List(Of CrystalParametro)
lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)) lista.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa))
lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo")) lista.Add(New CrystalParametro("TipoCuentas", "Con Saldo"))
lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre)) lista.Add(New CrystalParametro("NombreCliente", Cliente.Nombre))
@@ -893,8 +893,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
#Region "S C O R E C A R D" #Region "S C O R E C A R D"
Private Sub CargaScoreCard(ByVal context As HttpContext, pCveEmpresa As Integer, FechaEnvio As DateTime) Private Sub CargaScoreCard(ByVal context As HttpContext, pCveEmpresa As Integer, FechaEnvio As DateTime)
Dim Usuario = ValidaUsuarioSistema(pCveEmpresa) Dim Usuario As Usuario = ValidaUsuarioSistema(pCveEmpresa)
Dim obj = EjecutarEnvioScoreCard(Usuario, FechaEnvio) Dim obj As Boolean = EjecutarEnvioScoreCard(Usuario, FechaEnvio)
End Sub End Sub
@@ -977,7 +977,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Dim PDFSucursales As Byte() = GenerarScoredCardDirectivo(UsuarioActual, DtGrupoSucursales) Dim PDFSucursales As Byte() = GenerarScoredCardDirectivo(UsuarioActual, DtGrupoSucursales)
Dim PDFVendedores As Byte() = GenerarScoredCardDirectivo(UsuarioActual, DtGrupoVendedores) Dim PDFVendedores As Byte() = GenerarScoredCardDirectivo(UsuarioActual, DtGrupoVendedores)
For Each UsuarioEnviar In ListaDirectivos For Each UsuarioEnviar As MUsuarioEnviar In ListaDirectivos
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
If UsuarioEnviar.ReporteEnviar.Empresa Then If UsuarioEnviar.ReporteEnviar.Empresa Then
@@ -1028,7 +1028,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
'GERMAN LUNA 'GERMAN LUNA
ListaVendedores.Add(New MUsuarioEnviar(DtUsuarios.FiltroPrimero($"CveUsuario = {3354} AND CveSubProyecto > 0"), TipoUsuarioEnviar.Vendedor)) ListaVendedores.Add(New MUsuarioEnviar(DtUsuarios.FiltroPrimero($"CveUsuario = {3354} AND CveSubProyecto > 0"), TipoUsuarioEnviar.Vendedor))
For Each UsuarioEnviar In ListaVendedores For Each UsuarioEnviar As MUsuarioEnviar In ListaVendedores
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail) Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
Dim DtReporteVendedor As DataTable = Nothing Dim DtReporteVendedor As DataTable = Nothing
@@ -1082,7 +1082,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Protected Function GenerarScoredCard(UsuarioActual As Usuario, UsuarioEnviar As MUsuarioEnviar, DtDatos As DataTable) As Byte() Protected Function GenerarScoredCard(UsuarioActual As Usuario, UsuarioEnviar As MUsuarioEnviar, DtDatos As DataTable) As Byte()
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa)
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
@@ -1108,7 +1108,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
Protected Function GenerarScoredCardDirectivo(UsuarioActual As Usuario, DtDatos As DataTable) As Byte() Protected Function GenerarScoredCardDirectivo(UsuarioActual As Usuario, DtDatos As DataTable) As Byte()
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa)
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))

View File

@@ -12653,7 +12653,7 @@ Partial Class Compras_Compras
End If End If
End If End If
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa, -1, -1) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa, -1) Then
For Each drow As DataRow In ObjInventario.DtResultados.Rows For Each drow As DataRow In ObjInventario.DtResultados.Rows
TotalSumaPU = TotalSumaPU + drow("Total").ToString.ToDecimal TotalSumaPU = TotalSumaPU + drow("Total").ToString.ToDecimal
@@ -12883,7 +12883,7 @@ Partial Class Compras_Compras
Protected Sub BtnRefacturacionVer_Click(sender As Object, e As EventArgs) Handles BtnRefacturacionVer.Click Protected Sub BtnRefacturacionVer_Click(sender As Object, e As EventArgs) Handles BtnRefacturacionVer.Click
Dim Opcion As Integer = 1 Dim Opcion As Integer = 1
If UsuarioActual.CveEmpresa.Contiene(119, 1, 140, 172, 173, 174) Then Opcion = 2 If UsuarioActual.CveEmpresa.Contiene(119, 1, 140, 141, 172, 173, 174) Then Opcion = 2
Dim ObjCompras As New ClsCompras Dim ObjCompras As New ClsCompras

View File

@@ -101,7 +101,7 @@ Partial Class Contratos_Presupuestos
Protected Sub GvPresupuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPresupuestos.RowDataBound Protected Sub GvPresupuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPresupuestos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
Dim TipoGasto = e.Row.DBCampo("TipoGasto") Dim TipoGasto As String = e.Row.DBCampo("TipoGasto")
Select Case e.Row.DBCampo("TipoTotal").ToEntero Select Case e.Row.DBCampo("TipoTotal").ToEntero
Case 1 Case 1
e.Row.CssClass = "SubTotales" e.Row.CssClass = "SubTotales"
@@ -118,14 +118,14 @@ Partial Class Contratos_Presupuestos
e.Row.FCTextBox("TxtImporteClasi").Visible = False e.Row.FCTextBox("TxtImporteClasi").Visible = False
e.Row.FCTextBox("TxtObservacion").Visible = False e.Row.FCTextBox("TxtObservacion").Visible = False
Case 3 Case 3
Dim Importe = e.Row.FCTextBox("TxtImporteClasi").Text.ToDouble Dim Importe As Double = e.Row.FCTextBox("TxtImporteClasi").Text.ToDouble
e.Row.FCTextBox("TxtImporteClasi").Text = Importe.FormatoNumero() e.Row.FCTextBox("TxtImporteClasi").Text = Importe.FormatoNumero()
e.Row.FCTextBox("TxtImporteClasi").CssClass = $"form-control input-sm sumaGV txt{TipoGasto}" e.Row.FCTextBox("TxtImporteClasi").CssClass = $"form-control input-sm sumaGV txt{TipoGasto}"
e.Row.FCTextBox("TxtImporteClasi").Attributes.Add("onKeyUp ", $"calculaTotal();calculaTotalTipoGasto('{TipoGasto}');") e.Row.FCTextBox("TxtImporteClasi").Attributes.Add("onKeyUp ", $"calculaTotal();calculaTotalTipoGasto('{TipoGasto}');")
End Select End Select
End If End If
If e.Row.RowType = DataControlRowType.Footer Then If e.Row.RowType = DataControlRowType.Footer Then
Dim Importe = DtClasificaciones.SUM("Importe", "CveAgrupador IS NOT NULL") Dim Importe As Decimal = DtClasificaciones.SUM("Importe", "CveAgrupador IS NOT NULL")
e.Row.FCLabel("LblTotal").Text = String.Format("{0:C}", Importe) e.Row.FCLabel("LblTotal").Text = String.Format("{0:C}", Importe)
End If End If
End Sub End Sub
@@ -144,20 +144,20 @@ Partial Class Contratos_Presupuestos
If ObjContrato.DtResultados.Rows.Count = 1 Then If ObjContrato.DtResultados.Rows.Count = 1 Then
Dim DrContrato = ObjContrato.DtResultados.Copy(0) Dim DrContrato As DataRow = ObjContrato.DtResultados.Copy(0)
If DrContrato IsNot Nothing Then If DrContrato IsNot Nothing Then
Dim ImporteOriginal = DrContrato("Importe").ToString.ToDecimal Dim ImporteOriginal As Decimal = DrContrato("Importe").ToString.ToDecimal
TxtPresupuesto.Text = DrContrato("Nombre").ToString TxtPresupuesto.Text = DrContrato("Nombre").ToString
TxtDescripcion.Text = DrContrato("Observacion").ToString TxtDescripcion.Text = DrContrato("Observacion").ToString
EstatusActual = DrContrato("Estatus").ToString.ToEntero EstatusActual = DrContrato("Estatus").ToString.ToEntero
Dim CveProyecto = DrContrato("CveProyecto").ToString.ToEntero Dim CveProyecto As Integer = DrContrato("CveProyecto").ToString.ToEntero
Dim CveSubProyecto = DrContrato("CveSubProyecto").ToString.ToEntero Dim CveSubProyecto As Integer = DrContrato("CveSubProyecto").ToString.ToEntero
Dim EstatusTexto = DrContrato("EstatusTexto").ToString Dim EstatusTexto As String = DrContrato("EstatusTexto").ToString
LtlEstatus.Text = EstatusTexto LtlEstatus.Text = EstatusTexto
@@ -180,18 +180,13 @@ Partial Class Contratos_Presupuestos
If ObjContrato.GetPresupuestosRep(CvePresupuesto, -1, 1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, If ObjContrato.GetPresupuestosRep(CvePresupuesto, -1, 1, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, -1) Then DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, -1) Then
If ObjContrato.DtResultados.Rows.Count > 0 Then If ObjContrato.DtResultados.Rows.Count > 0 Then
Dim DrRep = ObjContrato.DtResultados.Copy(0) Dim DrRep As DataRow = ObjContrato.DtResultados.Copy(0)
Dim Importe = DrRep("Autorizado").ToString.ToDecimal.FormatoNumero Dim EjercidoPorcentaje As Integer = DrRep("EjercidoPorcentaje").ToString.ToEntero
Dim Ejercido = DrRep("Ejercido").ToString.ToDecimal.FormatoNumero Dim PorEjercerPorcentaje As Integer = DrRep("PorEjercerPorcentaje").ToString.ToEntero
Dim PorEjercer = DrRep("PorEjercer").ToString.ToDecimal.FormatoNumero
LtlAutorizado.Text = DrRep("Autorizado").ToString.ToDecimal.FormatoNumero
Dim EjercidoPorcentaje = DrRep("EjercidoPorcentaje").ToString.ToEntero LtlEjercido.Text = DrRep("Ejercido").ToString.ToDecimal.FormatoNumero
Dim PorEjercerPorcentaje = DrRep("PorEjercerPorcentaje").ToString.ToEntero LtlPorEjercer.Text = DrRep("PorEjercer").ToString.ToDecimal.FormatoNumero
LtlAutorizado.Text = Importe
LtlEjercido.Text = Ejercido
LtlPorEjercer.Text = PorEjercer
PBEjercido.Style.Remove("width") PBEjercido.Style.Remove("width")
PBEjercido.Style.Add("width", $"{EjercidoPorcentaje.ToString}%") PBEjercido.Style.Add("width", $"{EjercidoPorcentaje.ToString}%")
@@ -283,7 +278,7 @@ Partial Class Contratos_Presupuestos
If ValidaDatos() Then If ValidaDatos() Then
If CvePresupuesto > 0 Then If CvePresupuesto > 0 Then
If ActualizarPresupuesto() Then If ActualizarPresupuesto() Then
Dim Liga = $"document.location.href=""/Contratos/CatPresupuestos.aspx""" Dim Liga As String = $"document.location.href=""/Contratos/CatPresupuestos.aspx"""
Alert("El Presupuesto se actualizo correctamente.", TipoMensaje.MsgInformacion, Liga) Alert("El Presupuesto se actualizo correctamente.", TipoMensaje.MsgInformacion, Liga)
Else Else
@@ -301,16 +296,16 @@ Partial Class Contratos_Presupuestos
End Sub End Sub
Private Function ActualizarPresupuesto() As Boolean Private Function ActualizarPresupuesto() As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
Dim Nombre = TxtPresupuesto.Text.Trim Dim Nombre As String = TxtPresupuesto.Text.Trim
Dim Observacion = TxtDescripcion.Text.Trim Dim Observacion As String = TxtDescripcion.Text.Trim
Dim CveProyecto = DdlProyecto.SelectedValue.ToEntero Dim CveProyecto As Integer = DdlProyecto.SelectedValue.ToEntero
Dim FechaI = TxtFechaI.Text.ToDate Dim FechaI As Date = TxtFechaI.Text.ToDate
Dim FechaF = TxtFechaF.Text.ToDate Dim FechaF As Date = TxtFechaF.Text.ToDate
Dim FechaIng = NowADS() Dim FechaIng As DateTime = NowADS()
Dim CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero
Dim Archivo = "" Dim Archivo As String = ""
Dim Estatus = 1 Dim Estatus As Integer = 1
Dim TieneError = False Dim TieneError As Boolean = False
Dim ObjCont As New ClsContratos Dim ObjCont As New ClsContratos
ObjCont.IniciaTransacSQL() ObjCont.IniciaTransacSQL()
@@ -319,10 +314,10 @@ Partial Class Contratos_Presupuestos
For Each GvRow As GridViewRow In GvPresupuestos.Rows For Each GvRow As GridViewRow In GvPresupuestos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.RowType = DataControlRowType.DataRow Then
Dim CveAgrupador = GvRow.DataKey("CveAgrupador").ToEntero Dim CveAgrupador As Integer = GvRow.DataKey("CveAgrupador").ToEntero
Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero
Dim CveTipoGasto = -1 Dim CveTipoGasto As Integer = -1
Dim CveClasificacion As Integer = -1 Dim CveClasificacion As Integer = -1
Dim CveConceptoContableNom As Integer = -1 Dim CveConceptoContableNom As Integer = -1
@@ -336,9 +331,9 @@ Partial Class Contratos_Presupuestos
End If End If
Dim CvePresupuestoDetalle = GvRow.DataKey("CvePresupuestoDetalle").ToEntero Dim CvePresupuestoDetalle As Integer = GvRow.DataKey("CvePresupuestoDetalle").ToEntero
Dim Importe = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal Dim Importe As Decimal = GvRow.FCTextBox("TxtImporteClasi").Text.ToDecimal
Dim Obs = GvRow.FCTextBox("TxtObservacion").Text.Trim Dim Obs As String = GvRow.FCTextBox("TxtObservacion").Text.Trim
'ACTUALIZA EL REGISTRO EXISTENTE 'ACTUALIZA EL REGISTRO EXISTENTE
If CvePresupuestoDetalle > 0 Then If CvePresupuestoDetalle > 0 Then
@@ -373,27 +368,27 @@ Partial Class Contratos_Presupuestos
Return Retorno Return Retorno
End Function End Function
Private Sub AgregarPresupuesto() Private Sub AgregarPresupuesto()
Dim Nombre = TxtPresupuesto.Text.Trim Dim Nombre As String = TxtPresupuesto.Text.Trim
Dim Observacion = TxtDescripcion.Text.Trim Dim Observacion As String = TxtDescripcion.Text.Trim
Dim CveProyecto = DdlProyecto.SelectedValue.ToEntero Dim CveProyecto As Integer = DdlProyecto.SelectedValue.ToEntero
Dim FechaI = TxtFechaI.Text.ToDate Dim FechaI As Date = TxtFechaI.Text.ToDate
Dim FechaF = TxtFechaF.Text.ToDate Dim FechaF As Date = TxtFechaF.Text.ToDate
Dim FechaIng = NowADS() Dim FechaIng As DateTime = NowADS()
Dim CveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero
Dim Archivo = "" Dim Archivo As String = ""
Dim TieneError = False Dim TieneError As Boolean = False
Dim Estatus = 1 Dim Estatus As Integer = 1
Dim ObjCont As New ClsContratos Dim ObjCont As New ClsContratos
ObjCont.IniciaTransacSQL() ObjCont.IniciaTransacSQL()
If ObjCont.GetContratosEstatus(UsuarioActual.CveEmpresa) Then If ObjCont.GetContratosEstatus(UsuarioActual.CveEmpresa) Then
Dim CvePresupuestoNuevo = ObjCont.AddPresupuesto(Nombre, Observacion, CveSubProyecto, FechaI, FechaF, Estatus, Archivo, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CvePresupuestoNuevo As Integer = ObjCont.AddPresupuesto(Nombre, Observacion, CveSubProyecto, FechaI, FechaF, Estatus, Archivo, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePresupuestoNuevo > 0 Then If CvePresupuestoNuevo > 0 Then
Dim ImporteClasi = 0.0D Dim ImporteClasi As Decimal = 0
Dim ObsDetalle = "" Dim ObsDetalle As String = ""
For Each GvRow As GridViewRow In GvPresupuestos.Rows For Each GvRow As GridViewRow In GvPresupuestos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.RowType = DataControlRowType.DataRow Then
@@ -401,7 +396,7 @@ Partial Class Contratos_Presupuestos
ObsDetalle = GvRow.FCTextBox("TxtObservacion").Text.Trim ObsDetalle = GvRow.FCTextBox("TxtObservacion").Text.Trim
Dim CveAgrupador = GvRow.DataKey("CveAgrupador").ToEntero Dim CveAgrupador As Integer = GvRow.DataKey("CveAgrupador").ToEntero
Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero Dim Tipo As Integer = GvRow.DataKey("Tipo").ToEntero
Dim CveClasificacion As Integer = -1 Dim CveClasificacion As Integer = -1
@@ -445,7 +440,7 @@ Partial Class Contratos_Presupuestos
Else Else
ObjCont.Commit() ObjCont.Commit()
ObjCont.Dispose() ObjCont.Dispose()
Dim Liga = $"document.location.href=""/Contratos/CatPresupuestos.aspx""" Dim Liga As String = $"document.location.href=""/Contratos/CatPresupuestos.aspx"""
Alert("Se agregó el presupuesto correctamente.", TipoMensaje.MsgInformacion, Liga) Alert("Se agregó el presupuesto correctamente.", TipoMensaje.MsgInformacion, Liga)
End If End If
@@ -453,8 +448,6 @@ Partial Class Contratos_Presupuestos
End Sub End Sub
#End Region #End Region
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs) Handles LnkAutorizar.Click Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs) Handles LnkAutorizar.Click
If ValidaDatos() Then If ValidaDatos() Then
If ActualizarPresupuesto() Then If ActualizarPresupuesto() Then
@@ -516,8 +509,8 @@ Partial Class Contratos_Presupuestos
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim DTExcel As New DataTable Dim DTExcel As New DataTable
Dim ErrorArchivo = False Dim ErrorArchivo As Boolean = False
Dim ErrorExcel = False Dim ErrorExcel As Boolean = False
DTExcel = ReadExcelFile(Ruta + FileName, True) DTExcel = ReadExcelFile(Ruta + FileName, True)
If Not ErrorArchivo Then If Not ErrorArchivo Then

View File

@@ -664,7 +664,7 @@
<asp:Button ID="BtnVinculaAFEdit" ClientIDMode="Static" OnClick="BtnVinculaAFEdit_Click" Style="display: none;" runat="server" /> <asp:Button ID="BtnVinculaAFEdit" ClientIDMode="Static" OnClick="BtnVinculaAFEdit_Click" Style="display: none;" runat="server" />
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" /> <asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="tabla_correcto grides Widthall mysmallbtn" EmptyDataText="Aún no hay registros." <asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" EmptyDataText="Aún no hay registros."
DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" > DataKeyNames="No,CveMovimientoDetalle,Cantidad,CvePS,CveUM,PU,Observaciones,CodigoPS,UnidadMedida,CveAF,Serie,Lote,FechaCaducidad,CveSeccionAlmacen" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" >
<Columns> <Columns>
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt"> <asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">
@@ -684,14 +684,13 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="lbCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.######}")%>'> </asp:Literal> <asp:Literal ID="lbCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.######}")%>'> </asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="60px"></ItemStyle> <ItemStyle Width="60px" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Producto" ReadOnly="true" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Producto" ReadOnly="true" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Unidad"> <asp:TemplateField HeaderText="Unidad">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="lbUnidad" runat="server" Text='<%# Eval("UnidadMedida")%>'></asp:Literal> <asp:Literal ID="lbUnidad" runat="server" Text='<%# Eval("UnidadMedida")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="80px"></ItemStyle>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Precio unitario" Visible="false"> <asp:TemplateField HeaderText="Precio unitario" Visible="false">
<EditItemTemplate> <EditItemTemplate>
@@ -732,8 +731,7 @@
<asp:Literal ID="LtCI" runat="server" Text='<%# Eval("CostoIndirecto", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LtCI" runat="server" Text='<%# Eval("CostoIndirecto", "{0:N2}")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<FooterTemplate> <FooterTemplate>
<b> <b><asp:Literal ID="LtTotCI" runat="server" Text=""></asp:Literal></b>
<asp:Literal ID="LtTotCI" runat="server" Text=""></asp:Literal></b>
</FooterTemplate> </FooterTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--<asp:BoundField DataField="CostoIndirecto" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" Visible="false" ItemStyle-Width="63px"/>--%> <%--<asp:BoundField DataField="CostoIndirecto" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" Visible="false" ItemStyle-Width="63px"/>--%>
@@ -749,24 +747,21 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitMaq" runat="server" Text='<%# If(Eval("CodigoAF").ToString = "-1", "", Eval("CodigoAF").ToString)%>'></asp:Literal> <asp:Literal ID="LitMaq" runat="server" Text='<%# If(Eval("CodigoAF").ToString = "-1", "", Eval("CodigoAF").ToString)%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="60px" HorizontalAlign="Center" /> <ItemStyle Width="60px" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Serie" Visible="false"> <asp:TemplateField HeaderText="Serie" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="lbSerie" runat="server" Text='<%# Eval("Serie")%>'></asp:Literal> <asp:Literal ID="lbSerie" runat="server" Text='<%# Eval("Serie")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Right"></ItemStyle> <ItemStyle></ItemStyle>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Lote" Visible="false"> <asp:TemplateField HeaderText="Lote" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LbLote" runat="server" Text='<%# Eval("Lote")%>'></asp:Literal> <asp:Literal ID="LbLote" runat="server" Text='<%# Eval("Lote")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="90px"></ItemStyle>
<FooterStyle ></FooterStyle>
</asp:TemplateField> </asp:TemplateField>
<%--<asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false"/>--%> <%--<asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false"/>--%>
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false"> <asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LbCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:d}") %>'></asp:Literal> <asp:Literal ID="LbCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:d}") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
@@ -781,13 +776,10 @@
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="lblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'></asp:Literal> <asp:Literal ID="lblObservaciones" runat="server" Text='<%# Eval("Observaciones")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="120px" ></ItemStyle> <ItemStyle ></ItemStyle>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<EditItemTemplate> <EditItemTemplate>
<div class="row" style="max-width:80px!important"> <div class="row" style="max-width:80px!important">
<div class="col-md-6"> <div class="col-md-6">
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" /> <asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
@@ -795,7 +787,6 @@
<div class="col-md-6"> <div class="col-md-6">
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" /> <asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</div> </div>
</div> </div>
</EditItemTemplate> </EditItemTemplate>
<ItemTemplate> <ItemTemplate>

View File

@@ -688,8 +688,6 @@ Partial Class Inventarios_EntradasSalidas
DdlConcepto.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlConcepto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If End If
CargaPS() CargaPS()
' CargaDdlPaqueteria() ' CargaDdlPaqueteria()
@@ -701,7 +699,7 @@ Partial Class Inventarios_EntradasSalidas
TxtFechaEntrega.Text = NowADS().ToShortDateString TxtFechaEntrega.Text = NowADS().ToShortDateString
TxtFechaLlegada.Text = NowADS().ToShortDateString TxtFechaLlegada.Text = NowADS().ToShortDateString
CargarCamiones() 'CargarCamiones()
DdlClienteCarta.setEsWebService(True) DdlClienteCarta.setEsWebService(True)
End Sub End Sub
@@ -743,15 +741,15 @@ Partial Class Inventarios_EntradasSalidas
TrPersonal.Visible = True TrPersonal.Visible = True
Dim dt As DataTable = Nothing Dim dt As DataTable = Nothing
Dim RH As New ClsRH 'Dim RH As New ClsRH
If RH.GetPersonal(-1, UsuarioActual.CveEmpresa) Then 'If RH.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
dt = RH.DtResultados ' dt = RH.DtResultados
End If 'End If
RH.Dispose() 'RH.Dispose()
DdlPersonal.DataSource = dt DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
DdlPersonal.DataBind() DdlPersonal.DataBind()
'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) 'DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
@@ -2988,8 +2986,10 @@ Partial Class Inventarios_EntradasSalidas
Dim ErrorMovInv As Boolean = False Dim ErrorMovInv As Boolean = False
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas(Modulo, 53, 0, 0, 1, Fecha, Concepto, CveUsuario, CveEmpresa) Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas(Modulo, 53, 0, 0, 1, Fecha, Concepto, CveUsuario, CveEmpresa)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, Importe, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then If CveMovimientoSalida > 0 Then
ErrorMovInv = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Importe, Importe, 68, "", Concepto, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable) Then
ErrorMovInv = True
End If
End If End If
If CveMovimientoEntrada > 0 Then If CveMovimientoEntrada > 0 Then
@@ -2997,7 +2997,7 @@ Partial Class Inventarios_EntradasSalidas
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If
If dttCostos IsNot Nothing Then If dttCostos IsNot Nothing AndAlso CveMovimientoSalida > 0 Then
For Each RowInv As DataRow In dttCostos.Rows For Each RowInv As DataRow In dttCostos.Rows
Dim ValorInventario As Decimal = dttCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL Dim ValorInventario As Decimal = dttCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
@@ -3008,7 +3008,6 @@ Partial Class Inventarios_EntradasSalidas
Next Next
End If End If
If Not ErrorMovInv Then Retorno = CvePrePoliza If Not ErrorMovInv Then Retorno = CvePrePoliza
Return Retorno Return Retorno
@@ -5553,7 +5552,7 @@ Partial Class Inventarios_EntradasSalidas
End If End If
Dim tCveMovtoEntrada As Integer = If(tOrigen > 0, CveMovimientoVirtual, -1) Dim tCveMovtoEntrada As Integer = If(tOrigen > 0, CveMovimientoVirtual, -1)
Dim tCveMovtoSalida As Integer = If(tOrigen > 0, -1, CveMovimientoVirtual) Dim tCveMovtoSalida As Integer = If(tOrigen > 0, -1, CveMovimientoVirtual)
If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.Replace(",", "").ToDate, "Virtual", "ES/GV", tCveMovtoSalida, tCveMovtoEntrada, DtPSVirtual.SUM("TotalCargo"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True, dttCosto, tCveSubProyecto) > 0 Then If Not ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.Replace(",", "").ToDate, "Virtual", "ES/GV", tCveMovtoSalida, tCveMovtoEntrada, DtPSVirtual.SUM("TotalCargo"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True, dttCosto, tCveSubProyecto) > 0 Then
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If
@@ -5804,38 +5803,28 @@ Partial Class Inventarios_EntradasSalidas
DdlRemolque2.SelectedValueExist(-1) DdlRemolque2.SelectedValueExist(-1)
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
Dim dtt As DataTable = GlobalDTGralCartaPorteConfigAutoTransportes
Using ObjGrales As New ClsGenerales If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then Dim Remolque As String = dtt.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue.ToEntero}'")
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue.ToEntero}'") If Remolque = "1" Then
RequiereRemolque = True
MostrarRemolques = True
If Remolque = "1" Then
RequiereRemolque = True
MostrarRemolques = True
End If
If Remolque = "0, 1" Then
RequiereRemolque = False
MostrarRemolques = True
End If
If Remolque = "0" Then
RequiereRemolque = False
MostrarRemolques = False
End If
End If End If
End Using If Remolque = "0, 1" Then
RequiereRemolque = False
MostrarRemolques = True
End If
If Remolque = "0" Then
RequiereRemolque = False
MostrarRemolques = False
End If
End If
Else Else
RequiereRemolque = False RequiereRemolque = False
MostrarRemolques = False MostrarRemolques = False
End If End If
If RequiereRemolque OrElse MostrarRemolques Then
If RequiereRemolque Or MostrarRemolques Then
DvRemolque1.Visible = True DvRemolque1.Visible = True
End If End If
@@ -5844,8 +5833,6 @@ Partial Class Inventarios_EntradasSalidas
Else Else
DvConfiguracionVeiculo.Visible = True DvConfiguracionVeiculo.Visible = True
End If End If
UpEmitirTransitorio.Update() UpEmitirTransitorio.Update()
End Sub End Sub
@@ -5911,30 +5898,14 @@ Partial Class Inventarios_EntradasSalidas
DdlConfigAuto.Items.Clear() DdlConfigAuto.Items.Clear()
DdlUnidadCamion.Items.Clear() DdlUnidadCamion.Items.Clear()
DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
Using ObjInv As New ClsInventarios DdlRemolque1.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then
DdlUnidadCamion.DataSource = ObjInv.DtResultados
End If
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
DdlRemolque1.DataSource = ObjInv.DtResultados
End If
End Using
DdlUnidadCamion.DataBind() DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlRemolque1.DataBind() DdlRemolque1.DataBind()
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjGrales As New ClsGenerales DdlConfigAuto.DataSource = GlobalDTGralCartaPorteConfigAutoTransportes
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
DdlConfigAuto.DataSource = ObjGrales.DtResultados
End If
End Using
DdlConfigAuto.DataBind() DdlConfigAuto.DataBind()
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1")) DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))

View File

@@ -385,7 +385,7 @@ Partial Class OS_Asignaciones
TmpDTOS = ObjOS.DtResultados TmpDTOS = ObjOS.DtResultados
End If End If
If ObjOS.GetDetalleMateriales(-1, CveOS) Then If ObjOS.GetDetalleMateriales(-1, CveOS, 1, False) Then
TmpDTMaterialesOS = ObjOS.DtResultados TmpDTMaterialesOS = ObjOS.DtResultados
End If End If
Dim lrds As New List(Of ReportDataSource) Dim lrds As New List(Of ReportDataSource)

View File

@@ -14,7 +14,7 @@
<asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir Orden</asp:LinkButton> <asp:LinkButton ID="ImgImprimir" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir Orden</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkAccionesDevolucion" runat="server" OnClick="LnkAccionesDevolucion_Click" Visible="false"> <i class="fa fa-plus"></i> Devolución Material</asp:LinkButton> <asp:LinkButton ID="LnkAccionesMaterialUtilizado" runat="server" OnClick="LnkAccionesMaterialUtilizado_Click" Visible="false"> <i class="fa fa-plus"></i> Material Utilizado</asp:LinkButton>
</li> </li>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
@@ -1262,24 +1262,24 @@
<%--MODAL FINALIZAR ORDEN INICIO --%> <%--MODAL FINALIZAR ORDEN INICIO --%>
<div id="DVModalSolicitarDevolucion" class="modal ADS fade" role="dialog"> <div id="DivModalMaterialUtilizado" class="modal ADS fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<asp:UpdatePanel ID="UpModalSolicitarDevolucion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpModalMaterialUtilizado" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" >Solicitar Devolución</h4> <h4 class="modal-title" >Material Utilizado</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvSolicitarDevolucion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado Historial" <asp:GridView ID="GvMaterialUtilizado" 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" 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="GvSolicitarDevolucion_RowDataBound"> CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMaterialUtilizado_RowDataBound">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Cant.</HeaderTemplate> <HeaderTemplate>Cant.</HeaderTemplate>
@@ -1288,7 +1288,7 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Dev</HeaderTemplate> <HeaderTemplate>Utilizado</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtDev" runat="server" Width="50px" ></asp:TextBox> <asp:TextBox ID="TxtDev" runat="server" Width="50px" ></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtDev" ValidChars="123456789." /> <ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtDev" ValidChars="123456789." />
@@ -1300,37 +1300,22 @@
<asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>' ></asp:Literal> <asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>' ></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Lote</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LblLote" runat="server" Width="50px" Text='<%# Eval("Lote") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Serie</HeaderTemplate> <HeaderTemplate>Serie</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblSerie" runat="server" Width="50px" Text='<%# Eval("Serie") %>' ></asp:Label> <asp:Label ID="LblLote" runat="server" Text='<%# Eval("Lote") %>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Lote</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LblSerie" runat="server" Text='<%# Eval("Serie") %>' ></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Fecha Cad.</HeaderTemplate> <HeaderTemplate>Fecha Cad.</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblFechaCaducidad" runat="server" Width="50px" Text='<%# Eval("FechaCaducidad", "{0:dd/MM/yyyy}") %>' ></asp:Label> <asp:Label ID="LblFechaCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:dd/MM/yyyy}") %>' ></asp:Label>
<%--<div runat="server" id="DVFechaCaducidad" visible="false">
<asp:TextBox ID="TxtFechaCaducidad" runat="server" Width="70px" Text='<%# Eval("FechaCaducidad") %>' ></asp:TextBox>
<ajax:MaskedEditExtender ID="METxtFechaCaducidad" runat="server" TargetControlID="TxtFechaCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CCTxtFechaCaducidad" TargetControlID="TxtFechaCaducidad" PopupButtonID="TxtFechaCaducidad" PopupPosition="BottomLeft" ></ajax:CalendarExtender>
<asp:CompareValidator ID="CVTxtFechaCaducidad" runat="server" ControlToValidate="TxtFechaCaducidad" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Caducidad''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpDevolucion">
</asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCTxtFechaCaducidad" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaCaducidad" Width="350px"></ajax:ValidatorCalloutExtender>
</div> --%>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
@@ -1346,8 +1331,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<asp:LinkButton ID="LnkModalSolicitarDevolucion" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" ValidationGroup="GrpDevolucion" <asp:LinkButton ID="LnkModalMaterialUtilizado" runat="server" CssClass="btn btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="El material definido es el correcto?" data-btn-ok-label="si" ValidationGroup="GrpDevolucion"
OnClick="LnkModalSolicitarDevolucion_Click" >Guardar</asp:LinkButton> OnClick="LnkModalMaterialUtilizado_Click" >Guardar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div> </div>

View File

@@ -5,6 +5,8 @@ Imports Extensiones
Imports System.IO Imports System.IO
Imports System.Data Imports System.Data
Imports Telerik.Web.UI Imports Telerik.Web.UI
Imports System.Data.SqlClient
Imports Stimulsoft.Report.StiOptions.Export
Partial Class OS_OrdenesServicios Partial Class OS_OrdenesServicios
Inherits ClsPaginas Inherits ClsPaginas
@@ -703,8 +705,8 @@ Partial Class OS_OrdenesServicios
CargaHistorial() CargaHistorial()
If CveVenta > 0 And TipoEstatus.Contiene(1, 2, 3) Then If TipoEstatus.Contiene(1, 2, 3) Then
LnkAccionesDevolucion.Visible = True LnkAccionesMaterialUtilizado.Visible = True
End If End If
Else Else
Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
@@ -837,7 +839,7 @@ Partial Class OS_OrdenesServicios
Private Sub CargaMaterialesDetalle(CveOsDetalle As Integer, Consecutivo As Integer, CveConsecutivoDetalle As Integer) Private Sub CargaMaterialesDetalle(CveOsDetalle As Integer, Consecutivo As Integer, CveConsecutivoDetalle As Integer)
Dim ObjMateriales As New ClsOS Dim ObjMateriales As New ClsOS
If ObjMateriales.GetDetalleMateriales(CveOsDetalle, CveOS, -1) Then If ObjMateriales.GetDetalleMateriales(CveOsDetalle, CveOS) Then
For Each RowE As DataRow In ObjMateriales.DtResultados.Rows For Each RowE As DataRow In ObjMateriales.DtResultados.Rows
@@ -868,8 +870,8 @@ Partial Class OS_OrdenesServicios
End Sub End Sub
Private Sub CargaMateriales() Private Sub CargaMateriales()
Dim objOS As New ClsOS Dim objOS As New ClsOS
Dim Opcion As Integer = If(DdlTipoVenta.SelectedValue.Contiene("2", "3"), 2, 1)
If objOS.GetDetalleMateriales(-1, CveOS, Opcion, True) Then If objOS.GetDetalleMateriales(-1, CveOS) Then
GvMateriales.DataSource = objOS.DtResultados GvMateriales.DataSource = objOS.DtResultados
End If End If
objOS.Dispose() objOS.Dispose()
@@ -1195,7 +1197,7 @@ Partial Class OS_OrdenesServicios
#Region "P E R M I S O S" #Region "P E R M I S O S"
Private Sub PermisosSegunEstatus() Private Sub PermisosSegunEstatus()
Dim TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor(String.Format("TipoEstatus", "CveEstatusOrdenServicio = {0}", "CveEstatusOrdenServicio ASC", DdlEstatusOS.SelectedValue.ToEntero)) Dim TipoEstatus As String = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor(String.Format("TipoEstatus", "CveEstatusOrdenServicio = {0}", "CveEstatusOrdenServicio ASC", DdlEstatusOS.SelectedValue.ToEntero))
Select Case TipoEstatus.ToEntero Select Case TipoEstatus.ToEntero
Case 1 Case 1
@@ -1261,7 +1263,7 @@ Partial Class OS_OrdenesServicios
Dim Errores As Boolean = False Dim Errores As Boolean = False
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
Dim DirectorioEmpresa = UsuarioActual.Empresa.Ruta Dim DirectorioEmpresa As String = UsuarioActual.Empresa.Ruta
If Not CveOS > 0 Then If Not CveOS > 0 Then
@@ -1357,8 +1359,7 @@ Partial Class OS_OrdenesServicios
MensajeAlert.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/><br/>", ObjOrdenServicio.Folio)) MensajeAlert.AppendFormat(String.Format("<br/>La Orden de Servicio: <b>{0}</b> se generó correctamente.<br/><br/>", ObjOrdenServicio.Folio))
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS))) MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=OS&CVEOS={0}", ObjOrdenServicio.CveOS)))
Dim Liga As String = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
Dim Liga = $"document.location.href=""/OS/RepOrdenesServicios.aspx"";"
ObjOrdenServicio.Commit() ObjOrdenServicio.Commit()
@@ -1606,7 +1607,7 @@ Partial Class OS_OrdenesServicios
Protected Sub imgEstatus_Click(sender As Object, e As EventArgs) Protected Sub imgEstatus_Click(sender As Object, e As EventArgs)
Dim Row As GridViewRow = DirectCast(DirectCast(sender, Control).NamingContainer, GridViewRow) Dim Row As GridViewRow = DirectCast(DirectCast(sender, Control).NamingContainer, GridViewRow)
Dim Estatus = TmpDT(Row.RowIndex)("Estatus").ToString Dim Estatus As String = TmpDT(Row.RowIndex)("Estatus").ToString
If Estatus = "False" Then If Estatus = "False" Then
TmpDT.Rows(Row.RowIndex)("Estatus") = "True" TmpDT.Rows(Row.RowIndex)("Estatus") = "True"
@@ -1619,7 +1620,7 @@ Partial Class OS_OrdenesServicios
End Sub End Sub
Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click
Dim ObjOS As New ClsOS Dim ObjOS As New ClsOS
Dim TieneError = False Dim TieneError As Boolean = False
If CveCliente > 0 Then If CveCliente > 0 Then
If DdlPSDetalle.SelectedValue.ToEntero > 0 Then If DdlPSDetalle.SelectedValue.ToEntero > 0 Then
@@ -2975,7 +2976,7 @@ Partial Class OS_OrdenesServicios
End Sub End Sub
Private Sub BtnCambiarTecnico_Click(sender As Object, e As EventArgs) Handles BtnCambiarTecnico.Click Private Sub BtnCambiarTecnico_Click(sender As Object, e As EventArgs) Handles BtnCambiarTecnico.Click
Dim ObjOS As New ClsOS Dim ObjOS As New ClsOS
Dim TieneError = False Dim TieneError As Boolean = False
If UsuarioActual.Empresa.Funcionalidad(151).ToString = "1" Then If UsuarioActual.Empresa.Funcionalidad(151).ToString = "1" Then
If Not ObjOS.UpdateTecnicoOS(DdlTecnico.SelectedValue.ToEntero, CveOS) Then If Not ObjOS.UpdateTecnicoOS(DdlTecnico.SelectedValue.ToEntero, CveOS) Then
@@ -3040,87 +3041,56 @@ Partial Class OS_OrdenesServicios
Alert("Orden Finalizada Correctamente", TipoMensaje.MsgInformacion, "location.reload(true);") Alert("Orden Finalizada Correctamente", TipoMensaje.MsgInformacion, "location.reload(true);")
RegistraScript("$('#DVModalFinalizarOrden').modal('hide');") RegistraScript("$('#DVModalFinalizarOrden').modal('hide');")
End If End If
End Sub End Sub
Protected Sub LnkAccionesDevolucion_Click(sender As Object, e As EventArgs) Protected Sub LnkAccionesMaterialUtilizado_Click(sender As Object, e As EventArgs)
LnkModalSolicitarDevolucion.Visible = True LnkModalMaterialUtilizado.Visible = True
GvMaterialUtilizado.DataSource = Nothing
GvSolicitarDevolucion.DataSource = Nothing
DTSolicitudDev = New DataTable DTSolicitudDev = New DataTable
Dim Opcion As Integer = If(DdlTipoVenta.SelectedValue.Contiene("2", "3"), 2, 1)
GvSolicitarDevolucion.Columns(3).Visible = False 'Lote
GvSolicitarDevolucion.Columns(4).Visible = False 'Serie
GvSolicitarDevolucion.Columns(5).Visible = False 'Fecha Caducidad
Dim ObjOS As New ClsOS Dim ObjOS As New ClsOS
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, Opcion, UsuarioActual.CveEmpresa) Then
If ObjOS.GetOrdenesServicioDevolucionMaterial(CveOS, CveVenta, UsuarioActual.CveEmpresa) Then
DTSolicitudDev = ObjOS.DtResultados DTSolicitudDev = ObjOS.DtResultados
GvSolicitarDevolucion.DataSource = DTSolicitudDev GvMaterialUtilizado.DataSource = DTSolicitudDev
GvMaterialUtilizado.Columns(3).Visible = DTSolicitudDev.MIN("Serie") <> ""
GvMaterialUtilizado.Columns(4).Visible = DTSolicitudDev.MIN("Lote") <> ""
GvMaterialUtilizado.Columns(5).Visible = DTSolicitudDev.MIN("FechaCaducidad") <> ""
End If End If
GvSolicitarDevolucion.Columns(3).Visible = DTSolicitudDev.MAX("Lote").ToString.Trim().Length > 0
GvSolicitarDevolucion.Columns(4).Visible = DTSolicitudDev.MAX("Serie").ToString.Trim().Length > 0
GvSolicitarDevolucion.Columns(5).Visible = DTSolicitudDev.MAX("FechaCaducidad").ToString.Trim().Length > 0
ObjOS.Dispose() ObjOS.Dispose()
GvSolicitarDevolucion.DataBind() GvMaterialUtilizado.DataBind()
Dim EsDevolucionVenta As Boolean = (DTSolicitudDev.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0) Dim EsDevolucionVenta As Boolean = (DTSolicitudDev.FiltroPrimeroValor("EsDevolucionVenta", "").ToEntero > 0)
RegistraScript("$('#DVModalSolicitarDevolucion').modal();") RegistraScript("$('#DivModalMaterialUtilizado').modal();")
If EsDevolucionVenta Then If EsDevolucionVenta Then
Alert("Ya existe una solicitud de devolución", TipoMensaje.MsgAdvertencia) Alert("En la orden de servicio ya se determinó el material utilizado.", TipoMensaje.MsgAdvertencia)
LnkModalSolicitarDevolucion.Visible = False LnkModalMaterialUtilizado.Visible = False
End If End If
UpModalSolicitarDevolucion.Update() UpModalMaterialUtilizado.Update()
End Sub End Sub
Protected Sub GvSolicitarDevolucion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Protected Sub GvMaterialUtilizado_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then 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("TxtDev").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DataKey("Cantidad")))
'AplicaSerie, AplicaLote, AplicaCaducidad
'If Boolean.Parse(e.Row.DataKey("AplicaSerie")) Then
' e.Row.FCTextBox("TxtSerie").Visible = True
'End If
'If Boolean.Parse(e.Row.DataKey("AplicaLote")) Then
' e.Row.FCTextBox("TxtLote").Visible = True
'End If
'If Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then
' e.Row.FCHtmlGenericControl("DVFechaCaducidad").Visible = True
' 'e.Row.FCTextBox("TxtFechaCaducidad").Visible = True
' 'e.Row.FCMaskedEditExtender("METxtFechaCaducidad").Visible = True
' 'e.Row.FCCalendarExtender("CCTxtFechaCaducidad").Visible = True
' 'e.Row.FCCompareValidator("CVTxtFechaCaducidad").Visible = True
' 'e.Row.FCValidatorCalloutExtender("VCTxtFechaCaducidad").Visible = True
'End If
End If End If
End Sub End Sub
Protected Sub LnkModalSolicitarDevolucion_Click(sender As Object, e As EventArgs) Protected Sub LnkModalMaterialUtilizado_Click(sender As Object, e As EventArgs)
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
Dim CveSubProyectoPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveSubProyecto").ToEntero Dim CveSubProyectoPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveSubProyecto").ToEntero
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero
If Not CveAlmacenDestino > 0 Then If Not CveAlmacenDestino > 0 Then
@@ -3129,130 +3099,139 @@ Partial Class OS_OrdenesServicios
End If End If
Dim SbErroresDev As New StringBuilder Dim SbErroresDev As New StringBuilder
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
If GvRow.DataKey("Cantidad").ToDecimal > 0 Then If GvRow.DataKey("Cantidad").ToDecimal > 0 Then
Dim sbTemperror As New StringBuilder Dim sbTemperror As New StringBuilder
Dim ErrorCountDev As Integer = 0 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
sbTemperror.Append($"Producto: {GvRow.DataKey("CodigoPS") } requiere: ") 'If Boolean.Parse(GvRow.DataKey("AplicaLote")) Then
' If GvRow.FCTextBox("TxtLote").Text = String.Empty Then
' sbTemperror.Append($" Lote, ")
If Boolean.Parse(GvRow.DataKey("AplicaSerie")) Then ' ErrorCountDev = ErrorCountDev + 1
If GvRow.FCTextBox("TxtSerie").Text.Trim = String.Empty Then ' End If
sbTemperror.Append($" Serie, ") 'End If
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
'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 End If
Next Next
'If SbErroresDev.ToString.Length > 0 Then
' Alert($"Se encontraron los siguientes errores: <br> {SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
If SbErroresDev.ToString.Length > 0 Then Dim ProcesoOK As Boolean = True
Alert($"Se encontraron los siguientes errores: <br> {SbErroresDev.ToString}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim PropcesoOK As Boolean = True
Dim ObjV As New ClsVentas Dim ObjV As New ClsVentas
ObjV.IniciaTransacSQL() ObjV.IniciaTransacSQL()
If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then If Not ObjV.UpdateVentasDevolucionAlmacen(1, CveVenta) Then
PropcesoOK = False ProcesoOK = False
End If End If
If PropcesoOK Then If ProcesoOK Then
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal Dim CantidadDev As Decimal = GvRow.DataKey("Cantidad").ToDecimal - GvRow.FCTextBox("TxtDev").Text.ToDecimal
If CantidadDev > 0 Then If CantidadDev > 0 Then
If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then If Not ObjV.UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle, CantidadDev) Then
PropcesoOK = False ProcesoOK = False
Exit For Exit For
End If End If
End If End If
Next Next
End If End If
If PropcesoOK Then
Dim Respuesta As New RespuestaFacturacion()
Dim DtVentaDetalle As New DataTable
If ProcesoOK Then
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
If Respuesta.CveVenta > 0 Then
If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then
Dim dtClon As DataTable = ObjV.DtResultados.Copy
dtClon.DefaultView.Sort = "CveVentaDetalle ASC"
DtVentaDetalle = dtClon.DefaultView.ToTable()
End If
Else
ProcesoOK = False
End If
End If
If ProcesoOK Then
Dim ObjInventario As New ClsInventarios(ObjV.IniciaTransacSQL()) 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) Dim CveMovimiento As Integer = ObjInventario.AddMovimiento(CveAlmacenActual, 8, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveAlmacenDestino:=CveAlmacenDestino)
Dim Folio As Integer = ObjInventario.Folio Dim Folio As Integer = ObjInventario.Folio
If CveMovimiento > 0 Then If CveMovimiento > 0 Then
For Each GvRow As GridViewRow In GvSolicitarDevolucion.Rows Dim IndexMov1 As Integer = 0
For Each GvRow As GridViewRow In GvMaterialUtilizado.Rows
Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
Dim CantidadDev As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal Dim CantidadRegistro As Decimal = GvRow.FCTextBox("TxtDev").Text.ToDecimal
Dim CantidadRegistro = Cantidad - CantidadDev
Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero
Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero Dim CveUM As Integer = GvRow.DataKey("CveUM").ToEntero
Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal Dim PU As Decimal = GvRow.DataKey("PU").ToDecimal
Dim CveVentaDetalle As Integer = GvRow.DataKey("CveVentaDetalle").ToEntero Dim CveVentaDetalle As Integer = DtVentaDetalle.Rows(IndexMov1)("CveVentaDetalle").ToString.ToEntero
Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero Dim CveMovimientoDetalle As Integer = GvRow.DataKey("CveMovimientoDetalle").ToEntero
Dim Lote As String = GvRow.DataKey("Lote")
Dim Serie As String = GvRow.DataKey("Serie") Dim Serie As String = GvRow.DataKey("Serie")
Dim Lote As String = GvRow.DataKey("Lote")
Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate Dim FechaCaducidad As DateTime = GvRow.DataKey("FechaCaducidad").ToDate
If CantidadRegistro > 0 Then If CantidadRegistro > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadRegistro, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) 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) Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
PropcesoOK = False ProcesoOK = False
Exit For Exit For
End If End If
End If End If
IndexMov1 = IndexMov1 + 1
Next Next
If PropcesoOK Then If ProcesoOK 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) Dim CveMovimientoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenDestino, 9, CveMoneda, ClsPaginas.NowADS(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Respuesta.CveVenta, CveSubProyectoPedido, -1, CveOS:=CveOS, CveMovimientoRelacionado:=CveMovimiento)
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim IndexMov2 As Integer = 0
For Each dRow As DataRow In ObjInventario.DtResultados.Rows For Each dRow As DataRow In ObjInventario.DtResultados.Rows
Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal Dim Cantidad As Decimal = dRow("Cantidad").ToString.ToDecimal
Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero
Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero Dim CveUM As Integer = dRow("CveUM").ToString.ToEntero
Dim PU As Decimal = dRow("PU").ToString.ToDecimal Dim PU As Decimal = dRow("PU").ToString.ToDecimal
Dim CveVentaDetalle As Integer = dRow("CveVentaDetalle").ToString.ToEntero Dim CveVentaDetalle As Integer = DtVentaDetalle.Rows(IndexMov2)("CveVentaDetalle").ToString.ToEntero
Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero Dim CveMovimientoDetalle As Integer = dRow("CveMovimientoDetalle").ToString.ToEntero
Dim Lote As String = dRow("Lote").ToString Dim Lote As String = dRow("Lote").ToString
@@ -3261,50 +3240,115 @@ Partial Class OS_OrdenesServicios
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalle, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad) Then 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) Alert("Error al agregar detalle de movimiento.", TipoMensaje.MsgAdvertencia)
PropcesoOK = False ProcesoOK = False
Exit For Exit For
End If End If
IndexMov2 = IndexMov2 + 1
Next Next
If ProcesoOK Then
If PropcesoOK Then
Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL) Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL)
Dim LigaVenta As String = String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, "Material utilizado") Dim LigaVenta As String = String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, "Material utilizado")
If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaPedido, CveOS:=CveOS) Then If Not ObjEventos.AddEventoBitacora(LigaVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=Respuesta.CveVenta, CveOS:=CveOS) Then
PropcesoOK = False ProcesoOK = False
End If End If
End If End If
Else Else
PropcesoOK = False ProcesoOK = False
End If End If
End If End If
Else
Else ProcesoOK = False
PropcesoOK = False
End If End If
End If End If
If PropcesoOK Then If ProcesoOK Then
'ObjV.RollBack()
ObjV.Commit() ObjV.Commit()
Alert("La solicitud de Devolución de Almacén se guardó correctamente") Alert("El material utilizado se guardó correctamente")
RegistraScript("$('#DVModalSolicitarDevolucion').modal('hide');") RegistraScript("$('#DivModalMaterialUtilizado').modal('hide');")
Else Else
ObjV.RollBack() ObjV.RollBack()
End If End If
ObjV.Dispose() ObjV.Dispose()
End Sub End Sub
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
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero()
End If
Dim ObjFactura As Modelos.Factura = Modelos.Factura.CrearVentaNueva(UsuarioActual, CveSubProyectoPedido, CveCliente, CveMoneda, "Rem")
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
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 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
End If
Next
If ProcesoOK Then
ObjFactura.CalculaTotales()
Dim Resp As New Modelos.Factura.MMensajeFactura
Resp = ObjFactura.EmitirFactura(False, Transac:=TransaccionSQL)
If Resp.CveVenta > 0 Then
Respuesta.CveVenta = Resp.CveVenta
Respuesta.SerieFolio = Resp.SerieFolio
Else
ProcesoOK = False
End If
End If
Else
ProcesoOK = False
End If
Return Respuesta
End Function
Friend Class RespuestaFacturacion
Public Property CveVenta As Integer = -1
Public Property SerieFolio As String = "-1"
Public Sub New()
End Sub
End Class
End Class End Class

View File

@@ -1,4 +1,4 @@
<%@ Page Title="Reporte de Ordenes de Servicio Medicas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOSMedicas.aspx.vb" Inherits="OS_RepOSMedicas" %> <%@ Page Title="Reporte de Ordenes de Servicio Médicas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOSMedicas.aspx.vb" Inherits="OS_RepOSMedicas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
@@ -12,7 +12,7 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Ordenes de Servicio Medicas Reporte de Ordenes de Servicio Médicas
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones"> <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpAcciones">
@@ -169,11 +169,11 @@
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveOS" DataNavigateUrlFormatString="/OS/OrdenesServicios.aspx?CveOS={0}" DataTextField="Folio" Target="_blank" /> <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" />--%> <%--<asp:BoundField HeaderText="Folio" DataField="Folio" ItemStyle-HorizontalAlign="Left" />--%>
<%--1--%> <%--1--%>
<asp:BoundField DataField="FechaCita" HeaderText="Fech aCita" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" /> <asp:BoundField DataField="FechaCita" HeaderText="Fecha Cita" DataFormatString="{0:dd/MM/yyyy HH:mm}" HtmlEncode="False" />
<%--2--%> <%--2--%>
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<%--3--%> <%--3--%>
<asp:BoundField HeaderText="Medico" DataField="Medico" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<%--4--%> <%--4--%>
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
<%--5--%> <%--5--%>

View File

@@ -2,18 +2,11 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.Web.Compilation
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports System.Xml.Serialization
Imports System.IO
Imports System.Xml
Partial Class OS_RepOSMedicas Partial Class OS_RepOSMedicas
Inherits ClsPaginas Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx") If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
@@ -28,21 +21,15 @@ Partial Class OS_RepOSMedicas
#Region " CARGA COMBOS " #Region " CARGA COMBOS "
Private Sub CargaCombos() Private Sub CargaCombos()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
'CargaEstatus 'CargaEstatus
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa) DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
DdlEstatusOS.DataBind() DdlEstatusOS.DataBind()
DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1")) DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1"))
Dim DTTecnicos As New DataTable
Dim DTTecnicos = New DataTable
Dim ObjUsuarios As New ClsSisUsuarios Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 351, UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Then If ObjUsuarios.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 351, UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Then
@@ -134,7 +121,6 @@ Partial Class OS_RepOSMedicas
#End Region #End Region
Private Sub CargaClientes() Private Sub CargaClientes()
DdlClientes.ddl.Items.Clear() DdlClientes.ddl.Items.Clear()
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1") DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1) '.FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
@@ -147,8 +133,6 @@ Partial Class OS_RepOSMedicas
End Sub End Sub
#Region " GV DATOS - ROW DATABOUND " #Region " GV DATOS - ROW DATABOUND "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
@@ -172,18 +156,9 @@ Partial Class OS_RepOSMedicas
GvDatos.ExportToExcelGembox("OrdenesServicio", UsuarioActual, "Ordenes de Servicio Medicas", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString()) GvDatos.ExportToExcelGembox("OrdenesServicio", UsuarioActual, "Ordenes de Servicio Medicas", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
End Sub End Sub
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub End Sub
End Class End Class

View File

@@ -402,8 +402,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group form-md-line-input input-iconright" runat="server"> <div class="form-group form-md-line-input input-iconright" runat="server" id="DVModalPrecioLista" visible="false">
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" DataTextField="PrecioLista" DataValueField="CvePrecioLista" CssClass="form-control select2me" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlPrecioLista" runat="server" CausesValidation="true" AppendDataBoundItems="true" DataTextField="PrecioLista" DataValueField="CvePrecioLista" CssClass="form-control select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlPrecioLista" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlPrecioLista"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lista de Precio''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlPrecioLista.ClientID.ToString()%>">Lista de Precio:</label> <label for="<%= DdlPrecioLista.ClientID.ToString()%>">Lista de Precio:</label>
</div> </div>
@@ -449,7 +452,7 @@
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="BtnGuardar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton> <asp:LinkButton ID="BtnGuardar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio" CausesValidation="true"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -92,6 +92,11 @@ Partial Class CatSubProyectos
DivSegmentoNegocio.Visible = True DivSegmentoNegocio.Visible = True
End If End If
BtnGuardar.OnClientClick = $"ValidaGuardar();" BtnGuardar.OnClientClick = $"ValidaGuardar();"
If UsuarioActual.Empresa.Funcionalidad(404) = "20" Then
DVModalPrecioLista.Visible = True
End If
End If End If
End Sub End Sub
@@ -285,6 +290,9 @@ Partial Class CatSubProyectos
End Sub End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs) Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Tab.ActiveTabIndex = 0
CveCentroCosto = (GvRow.DataKey("CveSubProyecto")).ToEntero CveCentroCosto = (GvRow.DataKey("CveSubProyecto")).ToEntero
HdnModalidad.Value = "U" HdnModalidad.Value = "U"
TxtCentroCosto.Text = (GvRow.DataKey("SubProyecto")) TxtCentroCosto.Text = (GvRow.DataKey("SubProyecto"))

View File

@@ -1107,6 +1107,16 @@ function FormatoNumero(Importe, Decimales) {
} }
function filtraListBox(txtBusqueda, listBox) {
var value = txtBusqueda.value.toLowerCase();
$(`#${listBox} option`).filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
}
jQuery.fn.center = function() { jQuery.fn.center = function() {
this.css("position", "absolute"); this.css("position", "absolute");
var widthh = $(this).width(); var widthh = $(this).width();

View File

@@ -38,26 +38,91 @@
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<table>
<tr>
<td>
<asp:ListBox runat="server" ID="ListModulosDisponible" DataTextField="Padres" DataValueField="CveModulo" Height="300px" Width="450px" SelectionMode="Multiple"></asp:ListBox>
</td>
<td width="100px" align="center">
<asp:Button Text=">" runat="server" ID="BtnAdd" ToolTip="Añadir Seleccionados" OnClick="BtnAdd_Click" class="btn btn-primary" /><br />
<br />
<asp:Button Text="<" runat="server" ID="BtnRemove" ToolTip="Quitar Seleccionados" OnClick="BtnRemove_Click" class="btn btn-primary" /><br />
</td>
<td> <div class="row" id="DvGeneral">
<asp:ListBox runat="server" ID="ListModulosEmpresa" DataTextField="Padres" DataValueField="CveModulo" Height="300px" Width="450px" SelectionMode="Multiple"></asp:ListBox> <div class="col-md-4" id="Dv1" >
</td>
</tr> <div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px; max-width: 900px" align="left;">
</table> <input type="text" id="TxtBusquedaModulosDisponibles" class="form-control input-sm" onkeyup="<%= String.Format("filtraListBox(this,'{0}')", ListModulosDisponible.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("filtraListBox( this,'{0}')", ListModulosDisponible.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:ListBox runat="server" ID="ListModulosDisponible" DataTextField="Padres" DataValueField="CveModulo" Height="300px" SelectionMode="Multiple" ClientIDMode="Static"></asp:ListBox>
</div>
<div class="col-md-1" style="text-align:center!important;max-width:100px;vertical-align:central!important" id="Dv2">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<asp:Button Text=">" runat="server" ID="BtnAdd" ToolTip="Añadir Seleccionados" OnClick="BtnAdd_Click" class="btn btn-primary" style="margin-left:30px" /><br />
<br />
<asp:Button Text="<" runat="server" ID="BtnRemove" ToolTip="Quitar Seleccionados" OnClick="BtnRemove_Click" class="btn btn-primary" style="margin-left:30px" /><br />
</div>
<div class="col-md-4" id="Dv3">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px; max-width: 900px" align="left;">
<input type="text" id="TxtBusquedaModulosEmpresas" class="form-control input-sm" onkeyup="<%= String.Format("filtraListBox(this,'{0}')", ListModulosEmpresa.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("filtraListBox( this,'{0}')", ListModulosEmpresa.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:ListBox runat="server" ID="ListModulosEmpresa" DataTextField="Padres" DataValueField="CveModulo" Height="300px" SelectionMode="Multiple" ClientIDMode="Static" ></asp:ListBox>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function fncAjustaTamaños() {
$(document).ready(function () {
let tamanio1 = parseFloat($('#ListModulosDisponible').width());
let tamanio2 = parseFloat($('#ListModulosEmpresa').width());
let TamanioFinal = 0.0;
if (tamanio1 > tamanio2) {
TamanioFinal = tamanio1;
} else {
TamanioFinal = tamanio2;
}
if (TamanioFinal < 300) {
TamanioFinal = 300;
}
$('#ListModulosDisponible').css('max-width', `${TamanioFinal}px`);
$('#ListModulosEmpresa').css('max-width', `${TamanioFinal}px`);
$('#Dv1').css('max-width', `${TamanioFinal}px`);
$('#Dv2').css('max-width', `100px`);
$('#Dv3').css('max-width', `${TamanioFinal}px`);
$('#Dv1').css('min-width', `${TamanioFinal}px`);
$('#Dv2').css('min-width', `100px`);
$('#Dv3').css('min-width', `${TamanioFinal}px`);
$('#DvGeneral').css('max-width', `${(TamanioFinal * 2) + 100}px`);
}
);
}
</script>
</asp:Content> </asp:Content>

View File

@@ -28,8 +28,9 @@ Partial Class Sistemas_EmpresasModulos
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CargarEmpresa() CargarEmpresa()
End If End If
RegistraScript("fncAjustaTamaños();")
End Sub End Sub

View File

@@ -1453,7 +1453,7 @@
</tr> </tr>
</table> </table>
<div style="max-height: 300px; overflow-y: auto;"> <div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GvClasificacion" DataKeyNames="CveClasificacion" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de clasificaciones del Usuario" CssClass="table table-striped table-hover Widthall" GridLines="None"> <asp:GridView ID="GvClasificacion" DataKeyNames="CveClasificacion" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de clasificaciones del Usuario" CssClass="table table-striped table-hover Widthall mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>

View File

@@ -1556,16 +1556,12 @@ Partial Class Sistemas_UsuarioDetalle
If UsuarioControlado Then If UsuarioControlado Then
DdlProyecto.DataSource = GetProyectosSinGV(DtSubProyectosControlado.FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}")) DdlProyecto.DataSource = GetProyectosSinGV(DtSubProyectosControlado.FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}"))
Else Else
DdlProyecto.DataSource = GetProyectosSinGV(GlobalDTSubProyectos(-1, -1, DdlEmpresaAsignaciones.SelectedValue.ToEntero).FiltraParametros("", DistinctColumns:={"CveProyecto", "Proyecto"})) DdlProyecto.DataSource = GetProyectosSinGV(GlobalDTSubProyectos(-1, -1, DdlEmpresaAsignaciones.SelectedValue.ToEntero))
End If End If
End If End If
DdlProyecto.DataBind() DdlProyecto.DataBind()
DdlProyecto.Items.Insert(0, New ListItem("Seleccione el Proyecto", "-1")) DdlProyecto.Items.Insert(0, New ListItem("Seleccione el Proyecto", "-1"))
'CARGA SOLO PROYECTO (SUBRPOYECTOS)
If DdlEmpresaAsignaciones.SelectedValue.ToEntero = 66 Then
SoloSubProyectos()
End If
End Sub End Sub
Private Function GetSubProyectosSinGV() As String Private Function GetSubProyectosSinGV() As String
Dim SB As New StringBuilder Dim SB As New StringBuilder

View File

@@ -735,6 +735,9 @@
<div class="col-md-10"> <div class="col-md-10">
<div runat="server" class="form-group form-md-line-input input-iconright"> <div runat="server" class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPrecioLista" runat="server" CssClass="form-control select2me" Width="100%" DataTextField="PrecioLista" DataValueField="CvePrecioLista"></asp:DropDownList> <asp:DropDownList ID="DdlPrecioLista" runat="server" CssClass="form-control select2me" Width="100%" DataTextField="PrecioLista" DataValueField="CvePrecioLista"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlPrecioLista" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlPrecioLista"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lista de Precio''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="<%= DdlPrecioLista.ClientID.ToString()%>">Precio Lista:</label> <label for="<%= DdlPrecioLista.ClientID.ToString()%>">Precio Lista:</label>
<i></i> <i></i>
</div> </div>
@@ -1211,7 +1214,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group form-md-line-input" id="DivAplicaProductoAlterno" runat="server"> <div class="form-group form-md-line-input" id="DivAplicaProductoAlterno" runat="server">
Aplica Producto Alterno: Aplica Producto Alterno:
<asp:CheckBox ID="ChkProductoAlterno" Checked="true" CssClass="make-switchsd" data-size="small" runat="server" /> <asp:CheckBox ID="ChkProductoAlterno" Checked="false" CssClass="make-switchsd" data-size="small" runat="server" />
</div> </div>
</div> </div>
</div> </div>

View File

@@ -2,6 +2,7 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.SqlClient
Imports System.Globalization Imports System.Globalization
Imports System.IO Imports System.IO
Imports System.Net Imports System.Net
@@ -646,6 +647,19 @@ Partial Class Clientes
End Property End Property
#End Region #End Region
Property CvePrecioListaOriginal As Integer
Get
If ViewState("CvePrecioListaOriginal") Is Nothing Then
Return 0
Else
Return ViewState("CvePrecioListaOriginal").ToString().ToEntero()
End If
End Get
Set(value As Integer)
ViewState("CvePrecioListaOriginal") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
@@ -1231,7 +1245,7 @@ Partial Class Clientes
End If End If
UpDatos.Update()
End Sub End Sub
@@ -1452,7 +1466,8 @@ Partial Class Clientes
TxtNotificar.Text = ObjClientes.NotificarA TxtNotificar.Text = ObjClientes.NotificarA
TxtPagina.Text = ObjClientes.Pagina TxtPagina.Text = ObjClientes.Pagina
'TxtGiro.Text = ObjClientes.Giro 'TxtGiro.Text = ObjClientes.Giro
DdlPrecioLista.SelectedValue = ObjClientes.CvePrecioLista.ToString() DdlPrecioLista.SelectedValueExist(ObjClientes.CvePrecioLista.ToString())
CvePrecioListaOriginal = ObjClientes.CvePrecioLista
TxtCC.Text = ObjClientes.NotificarA TxtCC.Text = ObjClientes.NotificarA
ChkMail.Checked = ObjClientes.EnviarFactura ChkMail.Checked = ObjClientes.EnviarFactura
@@ -1553,6 +1568,7 @@ Partial Class Clientes
ChkCargoUsado.Checked = ObjClientes.CargoUsados ChkCargoUsado.Checked = ObjClientes.CargoUsados
ChkBonificacionUsado.Checked = ObjClientes.BonificacionUsado ChkBonificacionUsado.Checked = ObjClientes.BonificacionUsado
ChkProductoAlterno.Checked = ObjClientes.UsaProductoAlterno ChkProductoAlterno.Checked = ObjClientes.UsaProductoAlterno
DdlAlmacenAsignado.SelectedValueExist(ObjClientes.CveAlmacenAsignado)
'COMERCIO EXTERIOR 'COMERCIO EXTERIOR
ChkAplicaComercioExterior.Checked = ObjClientes.AplicaComercioExterior ChkAplicaComercioExterior.Checked = ObjClientes.AplicaComercioExterior
@@ -2482,7 +2498,7 @@ Partial Class Clientes
Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1)) Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.Trim.Length > 0, TxtFechaLimiteCredito.Text.ToDate, New Date(1900, 1, 1))
Dim GeneroCliente As Boolean = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False) Dim GeneroCliente As Boolean = If(DdlGeneroCliente.SelectedValue.ToEntero = 1 Or DdlGeneroCliente.SelectedValue.ToEntero = -1, True, False)
Dim CvePrecioLista As Integer = DdlPrecioLista.SelectedValue.ToEntero()
'If DivCrearPrecioLista.Visible AndAlso ChkCrearPrecioLista.Checked Then 'If DivCrearPrecioLista.Visible AndAlso ChkCrearPrecioLista.Checked Then
' CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0) ' CvePrecioListaNuevo = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, 0)
@@ -2493,6 +2509,17 @@ Partial Class Clientes
' End If ' End If
'End If 'End If
If Not ErrorProceso AndAlso UsuarioActual.Empresa.Funcionalidad(404).Contiene("10", "30") Then
If DdlPrecioLista.SelectedValue.ToEntero.Contiene(-2, -3) Then
If Not AsignaLista(ObjClientes.IniciaTransacSQL) Then
ErrorProceso = True
Alert("Error al generar lista de precios.", TipoMensaje.MsgAdvertencia)
End If
End If
End If
Dim CvePrecioLista As Integer = DdlPrecioLista.SelectedValue.ToEntero()
If Not ErrorProceso Then If Not ErrorProceso Then
'VERIFICA SI ES CLIENTE NUEVO O ACTUALIZACION 'VERIFICA SI ES CLIENTE NUEVO O ACTUALIZACION
If Me.CveCliente = -1 Then If Me.CveCliente = -1 Then
@@ -2613,6 +2640,7 @@ Partial Class Clientes
If ErrorProceso Then If ErrorProceso Then
ObjClientes.RollBack() ObjClientes.RollBack()
CargaPrecioLista()
Alert("Ocurrió un error al guardar.", TipoMensaje.MsgError) Alert("Ocurrió un error al guardar.", TipoMensaje.MsgError)
Else Else
ObjClientes.Commit() ObjClientes.Commit()
@@ -5951,6 +5979,7 @@ Partial Class Clientes
divAlmacenAsignado.Visible = True divAlmacenAsignado.Visible = True
DdlAlmacenAsignado.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa) DdlAlmacenAsignado.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
DdlAlmacenAsignado.DataBind() DdlAlmacenAsignado.DataBind()
DdlAlmacenAsignado.Items.Insert(0, New ListItem("-", "-1"))
End If End If
End Sub End Sub
@@ -6175,7 +6204,7 @@ Partial Class Clientes
#End Region #End Region
#Region "IMPRIMIR GVHistorial" #Region "IMPRIMIR GVHistorial"
Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs) Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
Dim retorno As Byte() = Nothing Dim retorno As Byte() = Nothing
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim logouri As String = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
@@ -10298,25 +10327,75 @@ Partial Class Clientes
RegistraScript("$('#DivAgregarPrecioLista').modal('show');") RegistraScript("$('#DivAgregarPrecioLista').modal('show');")
End Sub End Sub
Protected Sub BtnGuardarPL_Click(sender As Object, e As EventArgs) Protected Sub BtnGuardarPL_Click(sender As Object, e As EventArgs)
Dim ObjVentas As New ClsVentas()
Dim CvePrecioListaNuevo As Integer = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, False, 0) LimpiaItemsListaPrecion()
If CvePrecioListaNuevo > 0 Then
Alert("La lista de precio se guardo correctamente") If DdlPrecioListaClonar.SelectedValue.ToEntero > 0 Then
RegistraScript("$('#DivAgregarPrecioLista').modal('hide');") DdlPrecioLista.Items.Add(New ListItem(TxtPrecioLista.Text, "-3"))
DdlPrecioLista.SelectedValueExist("-3")
Else Else
Alert("Ocurrió un error al guardar la lista de precio", TipoMensaje.MsgError) DdlPrecioLista.Items.Add(New ListItem(TxtPrecioLista.Text, "-2"))
DdlPrecioLista.SelectedValueExist("-2")
End If
'Alert("La lista de precio se guardo correctamente")
UpDatos.Update()
RegistraScript("$('#DivAgregarPrecioLista').modal('hide');")
End Sub
Private Sub LimpiaItemsListaPrecion()
DdlPrecioLista.SelectedValue = Nothing
DdlPrecioLista.ClearSelection()
For i As Integer = DdlPrecioLista.Items.Count - 1 To 0 Step -1
If DdlPrecioLista.Items(i).Value.Contiene("-2", "-3") Then
DdlPrecioLista.Items.RemoveAt(i)
End If
Next
End Sub
Private Function AsignaLista(ByRef transaccionSQL As SqlTransaction) As Boolean
Dim respuesta As Boolean = True
Dim CvePrecioListaClonar As Integer = -1
If DdlPrecioLista.SelectedValue.ToEntero = -3 Then 'Clñonar
CvePrecioListaClonar = DdlPrecioListaClonar.SelectedValue.ToEntero
End If
Dim ObjVentas As New ClsVentas(transaccionSQL)
Dim CvePrecioListaNuevo As Integer = ObjVentas.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, False, 0, CvePrecioListaClonar:=CvePrecioListaClonar)
If Not CvePrecioListaNuevo > 0 Then
respuesta = False
End If End If
'RECARGA GLOBAL DE LISTA DE PRECIOS SI SE GENERO UNO NUEVO 'RECARGA GLOBAL DE LISTA DE PRECIOS SI SE GENERO UNO NUEVO
If CvePrecioListaNuevo > 0 Then If CvePrecioListaNuevo > 0 Then
GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing GlobalDTPrecioListas(UsuarioActual.CveEmpresa) = Nothing
If ObjVentas.GetPrecioListas(UsuarioActual.CveEmpresa) Then
DdlPrecioLista.DataSource = ObjVentas.DtResultados
Else
DdlPrecioLista.DataSource = Nothing
End If
CargaPrecioLista() DdlPrecioLista.DataBind()
DdlPrecioLista.Items.Insert(0, New ListItem(" - ", "-1"))
'CargaPrecioLista()
DdlPrecioLista.SelectedValueExist(CvePrecioListaNuevo) DdlPrecioLista.SelectedValueExist(CvePrecioListaNuevo)
End If End If
UpDatos.Update() UpDatos.Update()
End Sub
Return respuesta
End Function
End Class End Class

View File

@@ -12,7 +12,7 @@ Partial Class ProductosyServicios
#Region " Propiedades " #Region " Propiedades "
Private ReadOnly Property CvePS As Integer Private ReadOnly Property CvePS As Integer
Get Get
Return ViewState("CvePS").ToString.ToEntero Return IfNull(ViewState("CvePS"), "-1").ToString.ToEntero
End Get End Get
End Property End Property
Public Property PSAdicionalAnterior As String Public Property PSAdicionalAnterior As String
@@ -186,7 +186,7 @@ Partial Class ProductosyServicios
ViewState("CvePS") = Request("CvePS") ViewState("CvePS") = Request("CvePS")
If CargaDatos() Then If CargaDatos() Then
CargarMarcas()
'Configuración de Modalidad Update 'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios" BtnGuardar.Text = "Guardar Cambios"
CargarAlias() CargarAlias()
@@ -197,7 +197,6 @@ Partial Class ProductosyServicios
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
ViewState("CvePS") = -1 ViewState("CvePS") = -1
CargarMarcas()
ChkEstado.Enabled = False ChkEstado.Enabled = False
ChkEstado.Checked = True ChkEstado.Checked = True
@@ -367,6 +366,7 @@ Partial Class ProductosyServicios
CargaTipoProductos() CargaTipoProductos()
CargaUnidadesMedida() CargaUnidadesMedida()
CargarMetodosInv() CargarMetodosInv()
CargarMarcas()
'CargaPSAdicional(DdlPSAdicional) 'CargaPSAdicional(DdlPSAdicional)
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then

View File

@@ -593,9 +593,6 @@
<asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px" step="1"></asp:TextBox> <asp:TextBox ID="TxtFechaOS" type="datetime-local" runat="server" CssClass="make-switchsd" CausesValidation="true" Style="width: 130px" step="1"></asp:TextBox>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
@@ -8474,33 +8471,22 @@
<asp:GridView ID="GvProductosProcedimiento" runat="server" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" AutoGenerateColumns="False" Width="100%" OnRowDataBound="GvProductosProcedimiento_RowDataBound" <asp:GridView ID="GvProductosProcedimiento" runat="server" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" AutoGenerateColumns="False" Width="100%" OnRowDataBound="GvProductosProcedimiento_RowDataBound"
DataKeyNames="CveProcedimientoProducto,CveProcedimiento,Cantidad,CvePS,CodigoPS,Autogenerado,Estatus,CveVenta,CveUnidadMedida,Abreviatura,CveClasificacion,Clasificacion,Precio" GridLines="None"> DataKeyNames="CveProcedimientoProducto,CveProcedimiento,Cantidad,CvePS,CodigoPS,Autogenerado,Estatus,CveVenta,CveUnidadMedida,Abreviatura,CveClasificacion,Clasificacion,Precio" GridLines="None">
<Columns> <Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Cant." ItemStyle-Width="40px"> <asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Cant." ItemStyle-Width="40px">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text="0" Width="40px" style="text-align:right!important"></asp:TextBox> <asp:TextBox ID="TxtCantidad" runat="server" Text="" Width="40px" style="text-align:right!important"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilTxtCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." /> <ajax:FilteredTextBoxExtender ID="FilTxtCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Cantidad" HeaderText="Cant." DataFormatString="{0:#,###.##}" ItemStyle-Width="30px" >
<asp:BoundField DataField="Cantidad" HeaderText="Cant." DataFormatString="{0:N3}" ItemStyle-Width="30px" >
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:BoundField> </asp:BoundField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto"> <asp:BoundField DataField="CodigoPS" HeaderText="Producto">
<ItemStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" />
</asp:BoundField> </asp:BoundField>
<asp:BoundField DataField="Abreviatura" HeaderText="UM"> <asp:BoundField DataField="Abreviatura" HeaderText="UM">
<ItemStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" />
</asp:BoundField> </asp:BoundField>
<asp:BoundField DataField="Precio" HeaderText="Precio" DataFormatString="{0:#,##0.###}" HtmlEncode="False" />
<asp:BoundField DataField="Precio" DataFormatString="{0:#,##0.###}" HtmlEncode="False" />
</Columns> </Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle> <HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView> </asp:GridView>

View File

@@ -3145,8 +3145,6 @@ Partial Class Ventas
End If End If
CargaFletes()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyectoHeader, LblSubProyecto, AplicaTodos:="") CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyectoHeader, LblSubProyecto, AplicaTodos:="")
DdlSubProyecto.SelectedValueExist(DdlSubProyectoDatos.SelectedValue) DdlSubProyecto.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
BrSubProyecto.Visible = DdlProyecto.Visible BrSubProyecto.Visible = DdlProyecto.Visible
@@ -3343,7 +3341,7 @@ Partial Class Ventas
End If End If
TxtFecha.Enabled = True TxtFecha.Enabled = True
BloqueaCondiconesPago() BloqueaCondicionesPago()
BloqueaClasificaciones() BloqueaClasificaciones()
@@ -3450,7 +3448,7 @@ Partial Class Ventas
End If End If
End Sub End Sub
Private Sub BloqueaCondiconesPago() Private Sub BloqueaCondicionesPago()
If UsuarioActual.TienePermisoProceso(289) Then If UsuarioActual.TienePermisoProceso(289) Then
DdlFormaEntrega.Enabled = False DdlFormaEntrega.Enabled = False
DdlUsoCFDI.Enabled = False DdlUsoCFDI.Enabled = False
@@ -4483,7 +4481,7 @@ Partial Class Ventas
End If End If
For Each Row As DataRow In DtDetalle.Rows For Each Row As DataRow In DtDetalle.Rows
If OS.GetDetalleMateriales(Row("CveOSDetalle").ToString().ToEntero(), CveOS, -1) Then If OS.GetDetalleMateriales(Row("CveOSDetalle").ToString().ToEntero(), CveOS) Then
If OS.DtResultados.FiltraParametros("SeFacturara = 1").Rows.Count > 0 Then If OS.DtResultados.FiltraParametros("SeFacturara = 1").Rows.Count > 0 Then
Alert("Hay materiales en la Orden de Servicio, ¿Desea facturar los materiales?", TipoMensaje.MsgConfirmacion, "BtnMateriales()") Alert("Hay materiales en la Orden de Servicio, ¿Desea facturar los materiales?", TipoMensaje.MsgConfirmacion, "BtnMateriales()")
End If End If
@@ -6856,7 +6854,7 @@ Partial Class Ventas
UPObservaciones.Update() UPObservaciones.Update()
End If End If
BloqueaCondiconesPago() BloqueaCondicionesPago()
DeshabilitarAplicarNotaDeCredito(LblRFC.Text) DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
Dim CveVentaRef As Integer = -1 Dim CveVentaRef As Integer = -1
@@ -21641,7 +21639,7 @@ Partial Class Ventas
DtDetalle = TmpDT.Copy DtDetalle = TmpDT.Copy
For Each Row As DataRow In DtDetalle.Rows For Each Row As DataRow In DtDetalle.Rows
If OS.GetDetalleMateriales(Row("CveOSDetalle").ToString().ToEntero(), CveOS, -1) Then If OS.GetDetalleMateriales(Row("CveOSDetalle").ToString().ToEntero(), CveOS) Then
Dim Cons As Integer = TmpDT.Rows.Count + 1 Dim Cons As Integer = TmpDT.Rows.Count + 1
For Each dr As DataRow In OS.DtResultados.FiltraParametros("SeFacturara = 1 ").Rows For Each dr As DataRow In OS.DtResultados.FiltraParametros("SeFacturara = 1 ").Rows
@@ -25152,31 +25150,31 @@ Partial Class Ventas
End Sub End Sub
#End Region #End Region
#Region " FLETES " '#Region " FLETES "
Private Sub CargaFletes() 'Private Sub CargaFletes()
If UsuarioActual.CveEmpresa <> 125 Or CveVenta > 0 Then ' If UsuarioActual.CveEmpresa <> 125 Or CveVenta > 0 Then
Exit Sub ' Exit Sub
End If ' End If
HLModalFletes.Visible = True ' HLModalFletes.Visible = True
Dim ObjVentas As New ClsVentas ' Dim ObjVentas As New ClsVentas
If ObjVentas.GetFletes(UsuarioActual.CveEmpresa) Then ' If ObjVentas.GetFletes(UsuarioActual.CveEmpresa) Then
GVFletes.DataSource = ObjVentas.DtResultados ' GVFletes.DataSource = ObjVentas.DtResultados
GVFletes.DataBind() ' GVFletes.DataBind()
End If ' End If
UpFletes.Update() ' UpFletes.Update()
ObjVentas.Dispose() ' ObjVentas.Dispose()
End Sub 'End Sub
#End Region '#End Region
#Region "A G R E G A R P S M O D A L" #Region "A G R E G A R P S M O D A L"
Private Sub CargaMetodosPSModal() Private Sub CargaMetodosPSModal()
@@ -29272,7 +29270,7 @@ Partial Class Ventas
UPCondicionesPago.Update() UPCondicionesPago.Update()
UpDetalle.Update() UpDetalle.Update()
BloqueaCondiconesPago() BloqueaCondicionesPago()
End Sub End Sub
Private Sub InicializaDTAnticiposAmortizacion() Private Sub InicializaDTAnticiposAmortizacion()
Me.DtAnticipoAmortizacion = New DataTable Me.DtAnticipoAmortizacion = New DataTable
@@ -29630,7 +29628,7 @@ Partial Class Ventas
End If End If
Next Next
BloqueaCondiconesPago() BloqueaCondicionesPago()
UpAnticipos.Update() UpAnticipos.Update()
UpParametros.Update() UpParametros.Update()
@@ -30204,7 +30202,7 @@ Partial Class Ventas
DdlIVA.Visible = True DdlIVA.Visible = True
End If End If
BloqueaCondiconesPago() BloqueaCondicionesPago()
CargaVendedores() CargaVendedores()
@@ -31965,8 +31963,7 @@ Partial Class Ventas
CargaGVInv(TmpDT.FiltraParametros("CveTipoPS = 2")) CargaGVInv(TmpDT.FiltraParametros("CveTipoPS = 2"))
End If End If
BloqueaCondiconesPago() BloqueaCondicionesPago()
DivDdlFacturaRela.Visible = True DivDdlFacturaRela.Visible = True
BtnAgregarFacturasRelaciondas.Visible = True BtnAgregarFacturasRelaciondas.Visible = True
@@ -31988,7 +31985,6 @@ Partial Class Ventas
HabilitarControlesCartaPorte(True) HabilitarControlesCartaPorte(True)
End If End If
Dim FolioNuevo As String = TxtFolio.Text Dim FolioNuevo As String = TxtFolio.Text
If FolioNuevo <> FolioOriginal Then If FolioNuevo <> FolioOriginal Then
If Adjunto <> "" Then If Adjunto <> "" Then