This commit is contained in:
2024-07-25 10:41:59 -07:00
27 changed files with 883 additions and 677 deletions

View File

@@ -62,4 +62,8 @@ Public Class CalendarEvent
Public Property NumeroContrato As String
Public Property Observaciones As String
Public Property CveMoneda As Integer
Public Property Moneda As String
End Class

View File

@@ -684,6 +684,48 @@ Public Class ClsContratos
Return Retorno
End Function
Public Function GetContratosValUnidadesAgendadas(CveAF As Integer, FechaInicial As DateTime, FechaFinal As DateTime, CveEmpresa As Integer, CveContrato As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Con_ContratosValUnidadesAgendadasGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveAF", SqlDbType.Int).Value = CveAF
.Add("@FechaInicial", SqlDbType.DateTime).Value = FechaInicial
.Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las unidades agendadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateContratoArchivo(CveContrato As Integer, Archivo As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Con_ContratosArchivoUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@Archivo", SqlDbType.VarChar).Value = Archivo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el archivo adjunto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region

View File

@@ -42,6 +42,7 @@ Public Class ClsOS
Public Property FechaProbableTermino As DateTime
Public Property FechaCita As DateTime
Public Property CveCotizacion As Integer
Public Property SerieFolioCotizacion As String = ""
Public Property CveUsuarioRecibio As Integer
Public Property UsuarioRecibio As String
Public Property CveOSPadre As Integer
@@ -66,11 +67,11 @@ Public Class ClsOS
Public Property FechaInicio As DateTime
Public Property SubProyecto As String
Public Property Condiciones As String
Public Property CveMedico As Integer = -1
Public Property CveProcedimiento As Integer = -1
Public Property CveTipoVenta As Integer = -1
Public Property CveVenta As Integer = -1
Public Property SerieFolioVenta As String = ""
Public Property Paciente As String
Public Property IdentificadorCliente As String
Public Property FolioAdicional As String
@@ -581,6 +582,7 @@ Public Class ClsOS
Me.CveClienteSucursal = Data.Rows(0)("CveClienteSucursal").ToString.ToEntero
Me.Cliente = Data.Rows(0)("Cliente").ToString
Me.CveCotizacion = Data.Rows(0)("CveCotizacion").ToString.ToEntero
Me.SerieFolioCotizacion = Data.Rows(0)("SerieFolioCotizacion").ToString
Me.Folio = Data.Rows(0)("Folio").ToString.ToEntero
' Me.CveCliente = Data.Rows(0)("CveCliente").ToString.ToEntero
Me.PersonaSolicito = Data.Rows(0)("PersonaSolicito").ToString
@@ -617,6 +619,7 @@ Public Class ClsOS
Me.Paciente = Data.Rows(0)("Paciente").ToString
Me.IdentificadorCliente = Data.Rows(0)("IdentificadorCliente").ToString
Me.CveVenta = Data.Rows(0)("CveVenta").ToString.ToEntero
Me.SerieFolioVenta = Data.Rows(0)("SerieFolioVenta").ToString
Me.FolioAdicional = Data.Rows(0)("FolioAdicional").ToString
End If

View File

@@ -446,7 +446,6 @@ Namespace Modelos
Me.ErrorList = New List(Of String)
Me.RemisionesLista = New List(Of Integer)
Me.ListaMensajes = New List(Of String)
Me.FolioFiscal = ""
Me.GenerarPDFFactura = False
IniciaValores()
@@ -454,7 +453,6 @@ Namespace Modelos
If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
setValues(ObjVentas.DtResultados.Rows(0))
SetMetodoPago()
SetMoneda()
@@ -469,28 +467,23 @@ Namespace Modelos
Me.VentaDesglosaIEPS = True
End If
SetTotales(ObjVentas.DtResultados, ObjVentas)
If CargaDTDetalle Then
If ObjVentas.GetVentaDetalle(CveVenta) Then
Me.DtDetalle = ObjVentas.DtResultados.Copy()
End If
End If
End If
Else
ErrorList.Add("No se pudo cargar la información de la factura.")
End If
If CargaDTDetalle Then
If ObjVentas.GetVentaDetalle(CveVenta) Then
Me.DtDetalle = ObjVentas.DtResultados.Copy()
End If
End If
ObjVentas.Dispose()
If CargaDatosCliente Then
SetCliente()
End If
If CargaDatosCliente Then SetCliente()
If CargaDatosRelacionados Then
IniciaValoresVentas(EsCancelacion)
End If
If CargaDatosRelacionados Then IniciaValoresVentas(EsCancelacion)
If String.IsNullOrEmpty(DirectorioServidor) Then DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
If String.IsNullOrEmpty(DirectorioServidor) Then
DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
End If
Me.DirectorioServidor = DirectorioServidor
Timbre = New CFDITimbre
End Sub
@@ -625,7 +618,6 @@ Namespace Modelos
End If
End If
End If
End If
If ObjVentas.GetVentaOtrosConceptos(UsuarioActual.CveEmpresa, CveVenta) Then
@@ -644,7 +636,6 @@ Namespace Modelos
End If
End If
ObjVentas.Dispose()
If Me.RealizarDevolucionAlmacen Then
@@ -1278,7 +1269,6 @@ Namespace Modelos
ObjFactura.FechaPago = DateTime.Today
ObjFactura.FechaEjecucion = DateTime.Today
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CondicionesPago = 0
ObjFactura.TipoDocumento = ObjFactura.TipodeComprobante
'Totales, Y se llena TmpDTImpuestos
@@ -4251,8 +4241,6 @@ Namespace Modelos
End If
Next
End If
End If
End If
End If
@@ -4263,7 +4251,6 @@ Namespace Modelos
End If
End If
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
'SE DEBE DE EXCLUIR CUANDO ES REFACTURACIÓN
If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso CveEstatusRefacturacion = 0 AndAlso Not SeCancelaRemisionProceso AndAlso DtRemisionesRelacionadas IsNot Nothing Then ' se debe de excluir cuando es refacturación
@@ -5278,6 +5265,20 @@ Namespace Modelos
Return ErrorPrepoliza
End Function
Private Function GeneraIxC(factura As Modelos.Factura, ObjBanco As ClsBancos, ObjConta As ClsContabilidad, ImporteIxC As Decimal, CveIE As Integer) As Boolean
Dim ErrorPrepoliza As Boolean = False
If factura.CvePrePoliza > 0 Then
Dim CveSubProyectoContabilizar As Integer = factura.CveSubProyecto
ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteIxC, ImporteIxC, 66, "", "", CveIE:=CveIE, CveCliente:=CveCliente)
End If
Return ErrorPrepoliza
End Function
Private Function GeneraNC(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByVal factura As Modelos.Factura, ByRef ObjBancos As ClsBancos, ByRef ObjEventos As ClsOIEventos) As List(Of Object)
Dim Obj As New List(Of Object)
Dim CveVentaNueva As Integer = ObjVentas.CveVenta
@@ -5514,16 +5515,16 @@ Namespace Modelos
''' <param name="RealizarDevolucionAlmacen"></param>
''' <param name="ListaRemisionesCancelar"></param>
''' <returns></returns>
Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False) As MCancelacionVentaMensaje
Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False, Optional GeneraIxCconPago As Boolean = False) As MCancelacionVentaMensaje
'Comprobante emitido con errores sin relación
Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, AplicaCancelacionConPagos:=AplicaCancelacionConPagos)
Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, AplicaCancelacionConPagos:=AplicaCancelacionConPagos, GeneraIxCconPago:=GeneraIxCconPago)
End Function
Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Boolean = False,
Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, Optional FechaCancelacion As String = "-1",
Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "",
Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0,
Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False) As MCancelacionVentaMensaje
Optional CancelarBoletos As Boolean = False, Optional AplicaCancelacionConPagos As Boolean = False, Optional GeneraIxCconPago As Boolean = False) As MCancelacionVentaMensaje
Dim Retorno As New MCancelacionVentaMensaje()
Dim ErrorList As New List(Of String)
@@ -6207,14 +6208,14 @@ Namespace Modelos
Multiplicador = 1D
End If
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = ClsPaginas.NowADS()
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString
Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = ClsPaginas.NowADS()
Dim CveCliente As Integer = ObjFactura.CveCliente 'ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
Dim ClienteNombre As String = ObjFactura.Cliente.Nombre 'ObjVentas.DtResultados(0)("ClienteNombre").ToString
Dim SerieFolio As String = ObjFactura.SerieFolio ' ObjVentas.DtResultados(0)("SerieFolio").ToString
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD()
Dim TotalCostoAcumulado As Decimal = 0
Dim cont As Integer = 1
Dim CvePrePolizaDev As Integer = ObjConta.AddPrePolizas("Modelos/RecepcionEntrega", 4, TotalCosto, TotalCosto, 1, Fecha, ClienteNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'SE AGREGA MOVIMIENTO SEPARADO POR LA CUENTA DE VENTAS (ER)
@@ -6260,10 +6261,10 @@ Namespace Modelos
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
End If
End If
Else
ErrorCancelar = True
MensajeError = "Ocurrió un Error al ingresar las prepolizas"
End If
' Else
'ErrorCancelar = True
'MensajeError = "Ocurrió un Error al ingresar las prepolizas"
'End If
End If
End If
End If

View File

@@ -107,12 +107,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
If context.Request("U").ToEntero > 0 Then
CveUsuario = context.Request("U").ToEntero
CveEmpresa = context.Request("E").ToEntero
Dim CveSubProyecto As Integer = If(context.Request("CveSubProyecto") IsNot Nothing, context.Request("CveSubProyecto").ToEntero, -1)
Dim CveUsuarioPara As Integer = If(context.Request("CveUsuarioPara") IsNot Nothing, context.Request("CveUsuarioPara").ToEntero, -1)
CveEmpresa = context.Request("E").ToEntero
FI = context.Request("start").ToDate
FF = context.Request("end").ToDate
@@ -487,168 +483,208 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Dim tipoVista As String = context.Request("tipoVista")
DT_SubProyectos.Columns.Add("CveSubProyecto", GetType(Integer))
DT_SubProyectos.Columns.Add("backgroundColor")
DT_EstatusOS.Columns.Add("", GetType(Integer))
Dim cveContrato As Integer = -1
DT_EstatusOS.Columns.Add("", GetType(Integer))
If context.Request("cveContrato") IsNot Nothing Then
cveContrato = context.Request("cveContrato").ToEntero()
Dim cveContrato As Integer = If(context.Request("cveContrato") IsNot Nothing, context.Request("cveContrato").ToEntero, -1)
Dim CveSubProyecto As Integer = If(context.Request("CveSubProyecto") IsNot Nothing, context.Request("CveSubProyecto").ToEntero, -1)
Dim CveUsuarioPara As Integer = If(context.Request("CveUsuarioPara") IsNot Nothing, context.Request("CveUsuarioPara").ToEntero, -1)
Dim CveCliente As Integer = If(context.Request("CveCliente") IsNot Nothing, context.Request("CveCliente").ToEntero, -1)
Dim CveContratoEstatus As Integer = If(context.Request("CveContratoEstatus") IsNot Nothing, context.Request("CveContratoEstatus").ToEntero, -1)
Dim CveTipoActivoFijo As Integer = If(context.Request("CveTipoActivoFijo") IsNot Nothing, context.Request("CveTipoActivoFijo").ToEntero, -1)
Dim CvePersonal As Integer = If(context.Request("CvePersonal") IsNot Nothing, context.Request("CvePersonal").ToEntero, -1)
If Not cveContrato > 0 Then
cveContrato = -1
End If
If Not CveCliente > 0 Then
CveCliente = -1
End If
If ObjContratos.GetContratos(cveContrato, usuarioActual_.CveEmpresa, TipoContrato:=34) Then
If ObjContratos.DtResultados.Rows.Count > 0 Then
Try
For Each dr As DataRow In ObjContratos.DtResultados.Rows
Dim cevent As CalendarEvent = New CalendarEvent()
cevent.id = dr("CveContrato").ToString.ToEntero
cevent.title = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)
cevent.allDay = False
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
cevent.NombreComercial = dr("NombreComercial").ToString
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
cevent.CvePersonal2 = dr("CveChofer2").ToString.ToEntero
cevent.CveEventoEstatus = dr("CveContratosEstatus").ToString.ToEntero
cevent.Dolares = dr("Importe").ToString.ToDecimal
cevent.Pesos = dr("ImporteMax").ToString.ToDecimal
cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal
If ObjContratos.GetContratos(cveContrato, usuarioActual_.CveEmpresa, TipoContrato:=34, CveCliente:=CveCliente, CveEstatus:=CveContratoEstatus) Then
'CveTipoAF
'CveChofer, CveChofer2
Dim filtro As String = ""
If CveTipoActivoFijo > 0 Then
filtro = $"{filtro} CveTipoAF = {CveTipoActivoFijo}"
End If
If CvePersonal > 0 Then
If filtro.Length > 0 Then
filtro = $"{filtro} AND "
End If
filtro = $"{filtro} CveChofer = {CvePersonal} OR CveChofer2 = {CvePersonal} "
End If
If CveSubProyecto > 0 Then
If filtro.Length > 0 Then
filtro = $"{filtro} AND "
End If
filtro = $"{filtro} CveSubProyecto = {CveSubProyecto} "
End If
Dim DTContratos As DataTable = ObjContratos.DtResultados.FiltraParametros(filtro)
If DTContratos.Rows.Count > 0 Then
Try
For Each dr As DataRow In DTContratos.Rows
Dim cevent As CalendarEvent = New CalendarEvent()
cevent.id = dr("CveContrato").ToString.ToEntero
cevent.title = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.FechaFinal = String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime)
cevent.allDay = False
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
cevent.NombreComercial = dr("NombreComercial").ToString
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
cevent.CvePersonal2 = dr("CveChofer2").ToString.ToEntero
cevent.CveEventoEstatus = dr("CveContratosEstatus").ToString.ToEntero
cevent.Dolares = dr("Importe").ToString.ToDecimal
cevent.Pesos = dr("ImporteMax").ToString.ToDecimal
cevent.Anticipo = dr("ImporteMin").ToString.ToDecimal
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveTipoAF = dr("CveTipoAF").ToString.ToEntero
cevent.backgroundColor = dr("BackgroundColor").ToString
cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString
cevent.NumeroContrato = dr("NumeroContrato").ToString
cevent.Observaciones = dr("Observaciones").ToString
If Not cevent.recurrenciatipo > 0 Then
'AGREGAMOS CUANDO NO ES RECURRENTE
Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS())
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
If dr("FechaFinal").ToString.ToDateTime > tFecha Or dr("FechaInicial").ToString.ToDateTime > tFecha Then
events.Add(cevent)
End If
Else
'EMPIEZA METODO PARA AGREGAR CUANDO SI ES RECURRENTE
Dim FinRecurrencia As Integer = cevent.recurrenciafin.ToEntero
Dim FI As DateTime, FF As DateTime, FT As DateTime
Dim DiasSemana As String() = cevent.diassemana.Split(","c)
FI = cevent.start.ToDateTime
FF = cevent.end.ToDateTime
'OBTENEMOS LA FECHA TERMINO (FT) DE LA RECURRENCIA
Select Case FinRecurrencia
Case -1
FT = DateAdd(DateInterval.Year, 2, dr("FechaInicial").ToString.ToDateTime)
Case Is > 0
FinRecurrencia -= 1
Select Case cevent.recurrenciatipo
Case 1
FT = DateAdd(DateInterval.Hour, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
Case 2
FT = DateAdd(DateInterval.Day, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
Case 3
FT = DateAdd(DateInterval.WeekOfYear, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
FT = DateAdd(DateInterval.Day, (7 - Weekday(FT)).ToString.ToDouble, FT)
Case 4
FT = DateAdd(DateInterval.Month, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
Case 5
FT = DateAdd(DateInterval.Year, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
End Select
End Select
'SI ES TIPO SEMANAL Y DIASSEMANA TIENE VALORES CHECKEA ESTOS VALORES
Do
If DiasSemana.Length > 0 AndAlso DiasSemana(0) <> "" Then
For Each drDias As String In DiasSemana
Dim FIT As Date = FI, FFT As Date = FF
FIT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FI)).ToString.ToDouble, FI)
FFT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FF)).ToString.ToDouble, FF)
cevent = New CalendarEvent()
cevent.id = dr("CveContrato").ToString.ToEntero
cevent.description = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.allDay = False
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
cevent.NombreComercial = dr("NombreComercial").ToString
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.backgroundColor = dr("BackgroundColor").ToString
cevent.CantidadPasajeros = dr("CantidadPasajeros").ToString
cevent.NumeroContrato = dr("NumeroContrato").ToString
cevent.Observaciones = dr("Observaciones").ToString
cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
cevent.CveMoneda = dr("CveMoneda").ToString.ToEntero
cevent.Moneda = dr("Moneda").ToString
If Not cevent.recurrenciatipo > 0 Then
'AGREGAMOS CUANDO NO ES RECURRENTE
Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS())
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
If dr("FechaFinal").ToString.ToDateTime > tFecha Or dr("FechaInicial").ToString.ToDateTime > tFecha Then
events.Add(cevent)
End If
Else
'EMPIEZA METODO PARA AGREGAR CUANDO SI ES RECURRENTE
Dim FinRecurrencia As Integer = cevent.recurrenciafin.ToEntero
Dim FI As DateTime, FF As DateTime, FT As DateTime
Dim DiasSemana As String() = cevent.diassemana.Split(","c)
FI = cevent.start.ToDateTime
FF = cevent.end.ToDateTime
'OBTENEMOS LA FECHA TERMINO (FT) DE LA RECURRENCIA
Select Case FinRecurrencia
Case -1
FT = DateAdd(DateInterval.Year, 2, dr("FechaInicial").ToString.ToDateTime)
Case Is > 0
FinRecurrencia -= 1
Select Case cevent.recurrenciatipo
Case 1
FT = DateAdd(DateInterval.Hour, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
Case 2
FT = DateAdd(DateInterval.Day, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
Case 3
FT = DateAdd(DateInterval.WeekOfYear, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
FT = DateAdd(DateInterval.Day, (7 - Weekday(FT)).ToString.ToDouble, FT)
Case 4
FT = DateAdd(DateInterval.Month, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
Case 5
FT = DateAdd(DateInterval.Year, FinRecurrencia * cevent.frecuencia, dr("FechaInicial").ToString.ToDateTime)
End Select
End Select
'SI ES TIPO SEMANAL Y DIASSEMANA TIENE VALORES CHECKEA ESTOS VALORES
Do
If DiasSemana.Length > 0 AndAlso DiasSemana(0) <> "" Then
For Each drDias As String In DiasSemana
Dim FIT As Date = FI, FFT As Date = FF
FIT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FI)).ToString.ToDouble, FI)
FFT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FF)).ToString.ToDouble, FF)
cevent = New CalendarEvent()
cevent.id = dr("CveContrato").ToString.ToEntero
cevent.description = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.allDay = False
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
cevent.NombreComercial = dr("NombreComercial").ToString
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
'11/05/2018 - Evento Gasto Recurrente
cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
If cevent.CveTipoEvento = 10 Then
cevent.Importe = dr("Importe").ToString.ToDouble
End If
If cevent.CveEventoEstatus.ToString.ToEntero = 3 Then
cevent.backgroundColor = "#1BBC9B"
End If
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL Y/0 SI LA FECHA INICIAL DE LA RECURRENCIA ES MENOR A LA FECHA QUE SE CREO EL EVENTO NO LO AGREGA
If FIT > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) And FIT >= dr("FechaInicial").ToString.ToDateTime Then
events.Add(cevent)
End If
Next
Else
cevent = New CalendarEvent()
cevent.id = dr("CveContrato").ToString.ToEntero
cevent.description = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CvePersonal = dr("CveChofer").ToString.ToEntero
'11/05/2018 - Evento Gasto Recurrente
cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
If cevent.CveTipoEvento = 10 Then
cevent.Importe = dr("Importe").ToString.ToDouble
End If
If cevent.CveEventoEstatus.ToString.ToEntero = 3 Then
cevent.backgroundColor = "#1BBC9B"
End If
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL Y/0 SI LA FECHA INICIAL DE LA RECURRENCIA ES MENOR A LA FECHA QUE SE CREO EL EVENTO NO LO AGREGA
If FIT > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) And FIT >= dr("FechaInicial").ToString.ToDateTime Then
events.Add(cevent)
End If
Next
Else
cevent = New CalendarEvent()
cevent.id = dr("CveContrato").ToString.ToEntero
cevent.description = dr("DescripcionContrato").ToString
cevent.start = String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime)
cevent.end = If(tipoVista = "fecha", String.Format("{0:s}", dr("FechaInicial").ToString.ToDateTime.AddHours(1)), String.Format("{0:s}", dr("FechaFinal").ToString.ToDateTime))
cevent.NombreAcercamiento = dr("Ubicacion").ToString
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.allDay = False
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
If FI > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) Then
events.Add(cevent)
End If
End If
Select Case cevent.recurrenciatipo
Case 1
FI = DateAdd(DateInterval.Hour, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Hour, cevent.frecuencia, FF)
Case 2
FI = DateAdd(DateInterval.Day, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Day, cevent.frecuencia, FF)
Case 3
FI = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FF)
Case 4
FI = DateAdd(DateInterval.Month, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Month, cevent.frecuencia, FF)
Case 5
FI = DateAdd(DateInterval.Year, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Year, cevent.frecuencia, FF)
End Select
Loop Until FI > FT
End If
Next
Catch ex As Exception
GuardaLog(ex.ToString())
End Try
End If
End If
ObjContratos.Dispose()
cevent.CveActivoFijo = dr("CveAF").ToString.ToEntero
cevent.allDay = False
'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
If FI > DateAdd(DateInterval.Month, -6, ClsPaginas.NowADS()) Then
events.Add(cevent)
End If
End If
Select Case cevent.recurrenciatipo
Case 1
FI = DateAdd(DateInterval.Hour, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Hour, cevent.frecuencia, FF)
Case 2
FI = DateAdd(DateInterval.Day, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Day, cevent.frecuencia, FF)
Case 3
FI = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FF)
Case 4
FI = DateAdd(DateInterval.Month, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Month, cevent.frecuencia, FF)
Case 5
FI = DateAdd(DateInterval.Year, cevent.frecuencia, FI)
FF = DateAdd(DateInterval.Year, cevent.frecuencia, FF)
End Select
Loop Until FI > FT
End If
Next
Catch ex As Exception
GuardaLog(ex.ToString())
End Try
End If
End If
ObjContratos.Dispose()
Return ErrorEventos
End Function

View File

@@ -315,12 +315,16 @@
<asp:CheckBox ID="ChkCuentaRetorno" runat="server" Text="Caja" CssClass="checkbox" />
</div>
<div class="col-md-10 rowcheckCampos" id="DivRowCuenta2" style="display: none">
<div class="col-md-2" style="width: 205px;">
<div class="col-md-6" id="DivCuentaImporte" style="padding-left: 0px; padding-right: 0px;">
<div class="row">
<div class="col-md-2" id="DivCuentaImporte" style="padding-left: 0px; padding-right: 0px;">
<label>Importe:</label>
<asp:TextBox runat="server" ID="TxtCuentaRetorno" Class=" input-sm " Width="75px" onkeypress="return numericOnly(this);" ondrop="return false;" onpaste="return false;" CssClass="Numeros"></asp:TextBox>
</div>
</div>
</div>
<div class="col-md-6" style="padding-left: 0px; padding-right: 0px;">
<label>Obs:</label>
<asp:TextBox runat="server" ID="TxtCuentaRetornoObs" Class=" input-sm " Width="250px" ></asp:TextBox>
</div>
</div>
</div>
</div>

View File

@@ -184,10 +184,10 @@ Partial Class Bancos_DepositosCaja
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
Next
If TotalImporte = 0 AndAlso CuentaRetorno <> 0 Then
Alert("Seleccione una factura para realizar el depósito", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If TotalImporte = 0 AndAlso CuentaRetorno <> 0 Then
' Alert("Seleccione una factura para realizar el depósito", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
TotalImportePrePoliza = TotalImporte
If Comision <> 0 Then
@@ -243,14 +243,10 @@ Partial Class Bancos_DepositosCaja
Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuentaDeposito.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
Dim CveSubProyecto As Integer = DdlSubProyectos.SelectedValue.ToEntero
Dim CveClasificacion As Integer = -1
Dim CveSubProyectoComision As Integer
Dim CveClasificacionComision As Integer
Dim CveSubProyectoDescuento As Integer
Dim CveClasificacionDescuento As Integer
Dim imprimirFolios As String = ""
Dim CveSubProyectoIntermediario As Integer
Dim CveClasificacionIntermediario As Integer
@@ -294,7 +290,6 @@ Partial Class Bancos_DepositosCaja
OcurrioError = True
End If
End If
End If
Dim CveTransaccionBanco As Integer = DdlTipoDeposito.SelectedValue.ToEntero
@@ -329,6 +324,12 @@ Partial Class Bancos_DepositosCaja
Exit For
End If
Next
If CveSubProyecto <= 0 Then
'se saca de la cuenta de la caja chica
CveSubProyecto = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero, Estatus:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto")
End If
End If
If FolioIE <= 0 Then
@@ -367,7 +368,7 @@ Partial Class Bancos_DepositosCaja
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco)
Dim CveIEOrigenRetorno As Integer = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Retorno Depósito Bancario", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, "", "Retorno", CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigenRetorno) Then
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, "Depósito Bancario", TxtCuentaRetornoObs.Text.Trim, CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigenRetorno) Then
OcurrioError = True
End If
End If
@@ -415,11 +416,8 @@ Partial Class Bancos_DepositosCaja
End If
Next
Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEOrigen}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/><br/> ", StrEncript, "Depósito Bancario")
End If
If Not OcurrioError AndAlso ObjConta.ValidacionesPrePoliza(NuevaCvePrePoliza, UsuarioActual, Opcion:=1) Then
@@ -464,6 +462,8 @@ Partial Class Bancos_DepositosCaja
End If
Alert(documentos.ToString)
TxtCuentaRetorno.Text = ""
ChkCuentaRetorno.Checked = False
CargaDatos()
End If
@@ -489,8 +489,6 @@ Partial Class Bancos_DepositosCaja
Return Respuesta
End Function
Private Function ValidaCobranza() As Boolean
Dim Respuesta As Boolean = False
@@ -517,9 +515,7 @@ Partial Class Bancos_DepositosCaja
Alert("Error al consultarcobros pendientes.", TipoMensaje.MsgAdvertencia)
Respuesta = False
End If
ObjMovtos.Dispose()
Else
Respuesta = True
End If
@@ -527,7 +523,6 @@ Partial Class Bancos_DepositosCaja
Return Respuesta
End Function
Private Sub ObtenerTotalImporta()
Dim Total As Double = 0
@@ -577,7 +572,6 @@ Partial Class Bancos_DepositosCaja
If DdlTipoPago.SelectedValue.Contiene("11", "12", "-2") Then
e.Row.FCCheckBox("ChkFactura").Enabled = False
End If
End If
e.Row.FCCheckBox("ChkFactura").Attributes.Add("onclick", String.Format("FnSuma(this,{0});", e.Row.DBCampo("Importe")))
@@ -596,8 +590,6 @@ Partial Class Bancos_DepositosCaja
End Sub
Protected Sub DdlTipoPago_SelectedIndexChanged(sender As Object, e As EventArgs)
If DdlTipoPago.SelectedValue = "12" Then
DDlMesesSinIntereses.Visible = True

View File

@@ -1163,6 +1163,7 @@ Partial Class Bancos_PopIEVentas
Dim MsgError As String = ""
Dim Inserta As Boolean = True
Dim ImportePagado As Decimal = 0
Dim ImportePagadoVenta As Decimal = 0
Dim Fecha As Date = TxtFechaDocumento.Text.Trim.ToDate
If Not EmpresaPrueba Then CveIE = -1
@@ -1243,18 +1244,18 @@ Partial Class Bancos_PopIEVentas
Else
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL
End If
ImportePagadoVenta = ImportePagado
'Tipos de cambio
If Pago.CveMonedaPago = 1 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
End If
If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
If ChkPagarDolares.Checked Then Pago.TCPago = TxtTipoCambio.Text.ToDecimal
'Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
ImportePagadoVenta = (ImportePagado / TxtTipoCambio.Text.ToDecimal).RoundSQL
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso VentaActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
End If
'If ChkPagarPesos.Checked Then Pago.TCPago = 1 / TxtTipoCambio.Text.ToDecimal
If ChkPagarDolares.Checked Then Pago.TCPago = TxtTipoCambio.Text.ToDecimal
If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0
@@ -1266,7 +1267,7 @@ Partial Class Bancos_PopIEVentas
If CveIE > 0 Then
Pago.ImportePago = ImportePagado
Pago.ImportePagoVenta = ImportePagado - Pago.OtroGastoIngreso
Pago.ImportePagoVenta = ImportePagadoVenta
Pago.CveIE = CveIE
Pago.TipoPago = "B"

View File

@@ -5103,7 +5103,7 @@
<asp:RangeValidator ID="RVR" Display="Dynamic" ControlToValidate="TxtCant" runat="server" MinimumValue="0" Type="Double" ErrorMessage="Supera el total disponible"></asp:RangeValidator>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Cantidad" HeaderText="Total" />
<asp:BoundField DataField="Cantidad" HeaderText="Total" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.######}" />
<asp:BoundField DataField="UM" HeaderText="UM" />
<asp:BoundField DataField="CodigoPS" HeaderText="Producto" />
<asp:BoundField DataField="Total" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" />

View File

@@ -14808,8 +14808,6 @@ Partial Class Compras_Compras
Vinculacion()
End If
Else
LbSubTotalDif.Visible = True
LbSubTotalDif.Text = (SubTotalCompra - SubTotalGV).FormatoNumero
@@ -18396,7 +18394,9 @@ Partial Class Compras_Compras
#Region " DEVOLUCION DE ALMACEN - DEVOLUCION AL PROVEEDOR "
Private Sub InicializaDevolucionAlmacen()
If Not GvInv.Rows.Count > 0 Or LblCompraEstatus.Text = "CANCELADA" Then
Dim numpsalmacen As Integer = 1 'TmpDT.COUNT("CveTipoPS", "CveTipoPS = 2")
If LblCompraEstatus.Text = "CANCELADA" Or numpsalmacen = 0 Then 'Not GvInv.Rows.Count > 0
Exit Sub
End If
@@ -18421,7 +18421,7 @@ Partial Class Compras_Compras
End Sub
Protected Sub LBDevolucionAlmacen_Click(sender As Object, e As EventArgs)
GvSolDev.DataSource = TmpDT
GvSolDev.DataSource = TmpDT.FiltraParametros("CveTipoPS = 2")
GvSolDev.DataBind()
RegistraScript("$('#DivDevolucion').modal('show');", "DivDevolucion")
UPPSolDev.Update()

View File

@@ -2852,7 +2852,7 @@ Partial Class Compras_eFacturas
Protected Sub LnkSolicitarSat_Click(ByVal sender As Object, ByVal e As EventArgs)
Exit Sub
Dim sbResultado As StringBuilder = New StringBuilder()
Dim idSolicitudCFDI As Integer = 0

View File

@@ -14,7 +14,7 @@ Partial Class Contratos_ModificarPresupuesto
#Region "P R O P I E D A D E S"
Public ReadOnly Property EstatusFinal() As Integer
Get
Return 2
Return -1 '2
End Get
End Property
Public Property CvePresupuesto() As Integer
@@ -140,15 +140,11 @@ Partial Class Contratos_ModificarPresupuesto
End If
ValidaAcciones()
End Sub
Protected Sub GvPresupuestos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPresupuestos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim StrTipo = DdlTipo.SelectedValue
@@ -272,21 +268,15 @@ Partial Class Contratos_ModificarPresupuesto
If Ampliacion > 0 Then
TieneError = Not ObjPresu.AddPresupuestoMovimiento(CvePresupuestoDetalle, CveCompra, 1, Ampliacion, Fecha, Justificacion)
End If
If Not TieneError Then
Dim Reduccion = GvRow.FCTextBox("TxtReduccion").Text.ToDecimal
If Reduccion > 0 Then
TieneError = Not ObjPresu.AddPresupuestoMovimiento(CvePresupuestoDetalle, CveCompra, 2, Reduccion, Fecha, Justificacion)
End If
End If
End Select
End If
If TieneError Then
Exit For
End If
If TieneError Then Exit For
End If
Next
If TieneError Then
@@ -301,7 +291,6 @@ Partial Class Contratos_ModificarPresupuesto
End If
End Sub
Private Sub ValidaAcciones()
LnkAccionesAgregarClasificacion.Visible = False
If DtClasificaciones IsNot Nothing AndAlso DtClasificaciones.Rows.Count > 0 Then

View File

@@ -571,8 +571,8 @@ Partial Class Inventarios_RecepcionAlmacen
''' <param name="CveTiposAlmacen">Parametro sin espacios y separado por comas ["1,2,3,21"]</param>
Private Sub CargaAlmacenes(CveSubProyecto As Integer, Optional CveTiposAlmacen As String = "", Optional CveTipoCompra As Integer = -1)
Dim StrAlmacenes As String = ""
StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,15,14,19")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}"
Dim Strtmp As String = If(TipoMovimiento = 2, ",21", "") ' cuando es solicitud de devolución de almacen ,considerar los almacenes de dev prov
StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,15,14,19" & Strtmp)}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}"
If CveTipoCompra = 10 Then
StrAlmacenes = $"Modalidad = 0"

View File

@@ -190,8 +190,8 @@
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="lnkSurtir" NavigateUrl='<%# Eval("CveVenta", "/Inventarios/EntregaAlmacen.aspx?CveVenta={0}") %>' runat="server" CssClass="btn btn-sm blue" Text="Surtir <i class='fa fa-arrow-right' ></i>"></asp:HyperLink>
<asp:HyperLink ID="LnkRecibir" Visible="false" NavigateUrl='<%# Eval("CveVenta", "/Inventarios/EntregaAlmacen.aspx?CveVenta={0}") %>' runat="server" CssClass="btn btn-sm yellow-gold" Text="Recibir <i class='fa fa-arrow-left' ></i>"></asp:HyperLink>
<asp:HyperLink ID="lnkSurtir" NavigateUrl='<%# Eval("CveVenta", "/Inventarios/EntregaAlmacen.aspx?CveVenta={0}") %>' runat="server" Target="_blank" CssClass="btn btn-sm blue" Text="Surtir <i class='fa fa-arrow-right' ></i>"></asp:HyperLink>
<asp:HyperLink ID="LnkRecibir" Visible="false" NavigateUrl='<%# Eval("CveVenta", "/Inventarios/EntregaAlmacen.aspx?CveVenta={0}") %>' runat="server" Target="_blank" CssClass="btn btn-sm yellow-gold" Text="Recibir <i class='fa fa-arrow-left' ></i>"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>

View File

@@ -933,14 +933,13 @@ Partial Class OC_OC
ChkEntregaDirecta.Checked = False
End If
'If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then
' If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
' Alert("PrePoliza de Presupuesto Generada Correctamente")
' Else
' Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia)
' End If
'End If
If UsuarioActual.CveEmpresa.Contiene(83) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then
If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
Alert("PrePoliza de Presupuesto Generada Correctamente")
Else
Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia)
End If
End If
If UsuarioActual.CveRol = 1 Then
chkSubProyectoEntrega.Visible = True
@@ -6150,8 +6149,10 @@ Partial Class OC_OC
End Sub
Protected Sub EnviarCorreoCambioEstatus(pCveEstatus As Integer, Estatus As String, Optional NotificarAlert As Boolean = True, Optional AsuntoMail As String = "")
Dim strOpciones As New StringBuilder
If CveUsuario = -1 Or Not CBool(GlobalDTUsuarios(CveUsuario)(0)("Estatus").ToString) Then CveUsuario = UsuarioActual.CveUsuario
Dim Para As String = GlobalDTUsuarios(CveUsuario)(0)("correo").ToString
If CveUsuario = -1 Or Not CBool(GlobalDTUsuarios(CveUsuario, CveEmpresa:=CveEmpresaActual).FiltroPrimeroValor("Estatus")) Then
CveUsuario = UsuarioActual.CveUsuario
End If
Dim Para As String = GlobalDTUsuarios(CveUsuario, CveEmpresa:=CveEmpresaActual).FiltroPrimeroValor("correo")
Dim CorreosCCPNombre As New List(Of String)
Dim objUsuarios As New ClsSisUsuarios
Dim StrCorreos As New StringBuilder
@@ -8955,7 +8956,6 @@ Partial Class OC_OC
GvD.Columns(9).Visible = False
GvD.Columns(10).Visible = False
Dim MostrarColRetIVA As Boolean = False
Dim MostrarColRetISR As Boolean = False
@@ -8967,20 +8967,15 @@ Partial Class OC_OC
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProvedorSelecionado, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
If ObjProveedor.CveRegimenFiscal = 23 Then
If ObjProveedor.RetIVA > 0 Then
MostrarColRetIVA = True
End If
If ObjProveedor.RetISR > 0 Then
MostrarColRetISR = True
End If
End If
End If
ObjProveedor.Dispose()
@@ -9098,7 +9093,7 @@ Partial Class OC_OC
Dim Ejercido As Decimal = 0
Dim FechaCompra As Date = TxtFecha.Text.ToDate
If CveMoneda <> 1 Then ValImporte = ValImporte * GlobalTipoCambio(FechaCompra).ToDecimal
If CveMoneda > 1 Then ValImporte = ValImporte * GlobalTipoCambio(FechaCompra).ToDecimal
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, FechaCompra.FirstDayOfMonth, FechaCompra.LastDayOfMonth, 2) Then
Dim ColumnaSaldo As String = "Saldo"
@@ -9213,6 +9208,7 @@ Partial Class OC_OC
End If
Dim ObjConta As New ClsContabilidad(transaccion)
Dim CvePrePolizaPresupuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaPresupuesto > 0 Then

View File

@@ -152,8 +152,7 @@
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" Visible="false" ClientIDMode="Static" DataValueField="CveSubProyecto" DataTextField="SubProyecto" runat="server" CssClass="form-control select2me" Width="150px" AppendDataBoundItems="true"></asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
@@ -180,243 +179,181 @@
</asp:UpdatePanel>
<div class="row">
<div class="col-md-9">
</div>
<div class="col-md-3" style="text-align:right;">
<button type="button" class="btn btn-default" onclick="$('#ModalColores').modal('show');">Código Colores</button>
</div>
</div>
<div id="ModalColores" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title"><span id="spcol">Código Colores</span></h4>
</div>
<div class="modal-body">
<div class="row" id="divColores" style="color:white; width:200px;">
<div class="col-md-12" style="background-color:#3598dc; ">
Levantamiento
</div>
<div class="col-md-12" style="background-color:#002699">
Surtido
</div>
<div class="col-md-12" style="background-color:#8E44AD">
Asignado
</div>
<div class="col-md-12" style="background-color:#26C281">
Finalizado
</div>
<div class="col-md-12" style="background-color:#4B77BE">
Facturado
</div>
<div class="col-md-12" style="background-color:#29b4b6">
Cobrado
</div>
<div class="col-md-12" style="background-color:#e43a45">
Cancelado
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet light calendar ">
<div class="portlet-title ">
<div class="caption">
<i class="icon-calendar font-green-sharp"></i>
<span class="caption-subject font-green-sharp bold uppercase">Cirugías</span>
</div>
</div>
<div class="portlet-body">
<div class="portlet light calendar ">
<div class="portlet-title ">
<div class="caption">
<i class="icon-calendar font-green-sharp"></i>
<span class="caption-subject font-green-sharp bold uppercase">Cirugías</span>
</div>
</div>
<div class="portlet-body">
<div id="calendar">
</div>
<div id="calendar">
</div>
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button Text="" runat="server" ID="BtnActualizaAdd" ClientIDMode="Static" Style="display: none;" OnClick="BtnActualizaAdd_Click" />
<asp:HiddenField runat="server" ID="HdnU" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HdnE" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button Text="" runat="server" ID="BtnActualizaAdd" ClientIDMode="Static" Style="display: none;" OnClick="BtnActualizaAdd_Click" />
<asp:HiddenField runat="server" ID="HdnU" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HdnE" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalAgenda" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAgenda" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title"><span id="SpanTituloAgenda">Servicios a Domicilio</span></h4>
</div>
<div id="ModalAgenda" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAgenda" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title"><span id="SpanTituloAgenda">Servicios a Domicilio</span></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<asp:Label ID="LblEmpresaCRM" runat="server" Text="" Style="font-size: 16px; display: none; text-align: center;"></asp:Label>
</div>
</div>
<div class="row" style="display:none!important">
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
<asp:DropDownList ID="DdlAgedaTipo" ClientIDMode="Static" Width="100%" Enabled="false" DataTextField="AgendaTipo" DataValueField="CveAgendaTipo" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAgendaTipo" InitialValue="-1" runat="server" ControlToValidate="DdlAgedaTipo" CssClass="help-block errorimput" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de agenda''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label style="width: 90%;" for="<%=DdlAgedaTipo.ClientID.ToString()%>">Tipo de Asunto:</label>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<asp:Label ID="LblEmpresaCRM" runat="server" Text="" Style="font-size: 16px; display: none; text-align: center;"></asp:Label>
</div>
</div>
<div class="row" style="display:none!important">
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
<asp:DropDownList ID="DdlAgedaTipo" ClientIDMode="Static" Width="100%" Enabled="false" DataTextField="AgendaTipo" DataValueField="CveAgendaTipo" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAgendaTipo" InitialValue="-1" runat="server" ControlToValidate="DdlAgedaTipo" CssClass="help-block errorimput" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de agenda''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label style="width: 90%;" for="<%=DdlAgedaTipo.ClientID.ToString()%>">Tipo de Asunto:</label>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
<asp:DropDownList ID="DdlPrioridad" ClientIDMode="Static" Width="100%" runat="server" CssClass="form-control input-sm select2me" Enabled="false">
<asp:ListItem Selected="True" Text="Baja" Value="1"></asp:ListItem>
<asp:ListItem Text="Media" Value="2"></asp:ListItem>
<asp:ListItem Text="Alta" Value="3"></asp:ListItem>
</asp:DropDownList>
<label for="<%=DdlPrioridad.ClientID.ToString()%>">Prioridad:</label>
</div>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright selectmodal">
<asp:DropDownList ID="DdlPrioridad" ClientIDMode="Static" Width="100%" runat="server" CssClass="form-control input-sm select2me" Enabled="false">
<asp:ListItem Selected="True" Text="Baja" Value="1"></asp:ListItem>
<asp:ListItem Text="Media" Value="2"></asp:ListItem>
<asp:ListItem Text="Alta" Value="3"></asp:ListItem>
</asp:DropDownList>
<label for="<%=DdlPrioridad.ClientID.ToString()%>">Prioridad:</label>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAsuntoAgenda" ClientIDMode="Static" MaxLength="100" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAsuntoAgenda" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAsuntoAgenda" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Asunto''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label for="<%= TxtAsuntoAgenda.ClientID.ToString()%>">Asunto:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<div id="DivDescripcionUpdate" style="width: 400px; height: 75px; padding-top: 10px; font-size: 14px; display: none;"></div>
<asp:TextBox ID="TxtDescripcionAgenda" ClientIDMode="Static" MaxLength="5000" runat="server" TextMode="MultiLine" Rows="2" CausesValidation="true" Width="100%" CssClass="form-control MultiLineTextBox"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcionAgenda" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDescripcionAgenda" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Descripción''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label for="<%= TxtDescripcionAgenda.ClientID.ToString()%>" style="height: 60px;">Descripción:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAsuntoAgenda" ClientIDMode="Static" MaxLength="100" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAsuntoAgenda" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAsuntoAgenda" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Asunto''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label for="<%= TxtAsuntoAgenda.ClientID.ToString()%>">Asunto:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<div id="DivDescripcionUpdate" style="width: 400px; height: 75px; padding-top: 10px; font-size: 14px; display: none;"></div>
<asp:TextBox ID="TxtDescripcionAgenda" ClientIDMode="Static" MaxLength="5000" runat="server" TextMode="MultiLine" Rows="2" CausesValidation="true" Width="100%" CssClass="form-control MultiLineTextBox"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcionAgenda" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDescripcionAgenda" ErrorMessage="<span style='font-size: 11px;'><b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Descripción''</b> es necesario.</span>" ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
<label for="<%= TxtDescripcionAgenda.ClientID.ToString()%>" style="height: 60px;">Descripción:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ClientIDMode="Static" ID="LblDireccion" CssClass="form-control"></asp:Label>
<label for="<%= LblDireccion.ClientID.ToString()%>" style="height: 60px;">Dirección:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ClientIDMode="Static" ID="LblDireccion" CssClass="form-control"></asp:Label>
<label for="<%= LblDireccion.ClientID.ToString()%>" style="height: 60px;">Dirección:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ClientIDMode="Static" ID="LblSubProyecto" CssClass="form-control"></asp:Label>
<label for="<%= LblSubProyecto.ClientID.ToString()%>" style="height: 60px;"><asp:Label runat="server" ID="LblSubProyectoEtiqueta"></asp:Label>:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ClientIDMode="Static" ID="LblSubProyecto" CssClass="form-control"></asp:Label>
<label for="<%= LblSubProyecto.ClientID.ToString()%>" style="height: 60px;"><asp:Label runat="server" ID="LblSubProyectoEtiqueta"></asp:Label>:</label>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding-left: 0px !important;">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy hh:mm" style="width: 70%;">
<asp:TextBox ID="TxtFechaInicioAgenda" Enabled="false" ClientIDMode="Static" runat="server" Width="100%" CssClass="form-control input-sm " CausesValidation="true" MaxLength="18"></asp:TextBox>
<label style="margin-left: -3px; padding-bottom: 30px; width: 70%;" for="<%= TxtFechaInicioAgenda.ClientID.ToString()%>">Fecha de Inicio:</label>
</div>
<asp:RequiredFieldValidator ID="RFVFechaInicioAdd" Display="None" CssClass="help-block errorimput" runat="server" ControlToValidate="TxtFechaInicioAgenda" ErrorMessage="<b><span style='text-decoration: underline'>ERROR</span></b>:<br>El campo <b>''Fecha de Inicio''</b> es necesario." ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding-left: 0px !important;">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy hh:mm" style="width: 70%;">
<asp:TextBox ID="TxtFechaFinAgenda" Enabled="false" ClientIDMode="Static" runat="server" Width="100%" CssClass="form-control input-sm " CausesValidation="true" MaxLength="18"></asp:TextBox>
<label style="margin-left: -3px; padding-bottom: 30px; width: 70%;" for="<%= TxtFechaFinAgenda.ClientID.ToString()%>">Fecha de Fin:</label>
</div>
<asp:RequiredFieldValidator ID="RFVFechaFinAdd" Display="None" CssClass="help-block errorimput" runat="server" ControlToValidate="TxtFechaFinAgenda" ErrorMessage="<b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Fecha de Fin''</b> es necesario." ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
</div>
</div>
<div style="display:none">
<asp:CheckBox Text="Recurrencia" ClientIDMode="Static" runat="server" ID="CheckRecurrencia" />
</div>
<asp:UpdatePanel runat="server" ClientIDMode="Static" UpdateMode="Conditional" ID="UpRecurrencia">
<ContentTemplate>
<div style="width: 100%; float: left; margin-bottom: 10px; margin-left: 0px;">
<hr style="margin-top: 0px; margin-bottom: 15px;" />
<div style="float: left; width: 20%; height: 130px;">
<asp:RadioButtonList runat="server" CssClass="tablenopadding" RepeatDirection="Vertical" ID="RBLRecurrencia" AutoPostBack="true" OnSelectedIndexChanged="RBLRecurrencia_SelectedIndexChanged">
<asp:ListItem Text="1- Hora" Value="1" Selected="True" />
<asp:ListItem Text="2- Diario" Value="2" />
<asp:ListItem Text="3- Semanal" Value="3" />
<asp:ListItem Text="4- Mensual" Value="4" />
<asp:ListItem Text="5- Anual" Value="5" />
</asp:RadioButtonList>
</div>
<div style="float: left; width: 80%; height: 130px;">
<div runat="server" id="DivRecurrencia" visible="true" style="width: 100%; height: 100%;">
<asp:HiddenField runat="server" ID="HdnDiasSemanaAgendar" ClientIDMode="Static" Value="" />
<div class="col-md-12"></div>
<div class="row">
<div class="col-md-2" style="padding-right: 0px; text-align: right;">Cada:</div>
<div class="form-group col-md-1 form-md-line-input input-iconright" style="padding-left: 0px !important; padding-right: 0px; padding-top: 0px; padding-bottom: 0px; margin-top: -6px;">
<div class="input-group input-sm" style="padding-top: 0px;">
<asp:TextBox ID="TxtFrecuencia" ClientIDMode="Static" Text="1" runat="server" Style="padding-top: 0px; padding-bottom: 0px;" Width="20px" CssClass="form-control input-sm" CausesValidation="true" TextMode="Number"></asp:TextBox>
<label style="margin-top: -3px; margin-left: -5px; width: 20px;" for="<%= TxtFechaFinAgenda.ClientID.ToString()%>"></label>
</div>
</div>
<%--<td>
<asp:TextBox runat="server" ClientIDMode="Static" ID="TxtFrecuencia" Text="1" Width="20px" />
</td>--%>
<div class="col-md-2" style="padding-left: 0px;">
<asp:Label Text="Hora(s)" runat="server" ID="LblTextoFrecuencia" />
</div>
</div>
<div class="row" id="TrDiasSemanaAdd" runat="server" style="display: none;">
<div class="col-md-12">
<asp:CheckBoxList runat="server" ID="CheckDiasSemana" ClientIDMode="Static" RepeatColumns="5" RepeatDirection="Horizontal">
<asp:ListItem Text="Lunes" Value="2" />
<asp:ListItem Text="Martes" Value="3" />
<asp:ListItem Text="Miercoles" Value="4" />
<asp:ListItem Text="Jueves" Value="5" />
<asp:ListItem Text="Viernes" Value="6" />
<asp:ListItem Text="Sabado" Value="7" />
<asp:ListItem Text="Domingo" Value="1" />
</asp:CheckBoxList>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="width: 100%; float: left; margin-bottom: 10px; margin-left: 0px;display:none"">
<hr style="margin-top: 0px; margin-bottom: 15px;" />
<div class="col-md-6" style="padding-left: 0px !important;">
<div class="col-md-8" style="padding-left: 0px; padding-right: 0px;">
<asp:RadioButton Text="Terminar despues de:" ID="RBNumeroOcurrencias" ClientIDMode="Static" GroupName="GNFrecuenciaFinAdd" runat="server" />
</div>
<div class="form-group col-md-1 form-md-line-input input-iconright" style="padding: 0px !important; margin-top: -5px; margin-left: -10px">
<div class="input-group input-sm" style="padding-top: 0px; padding-left: 0px; padding-right: 0px;">
<asp:TextBox runat="server" onclick="FechaFinSet('RBNumeroOcurrencias','TxtFechaFinRecurrencia');" ClientIDMode="Static" CssClass="form-control" TextMode="Number" ID="TxtNumeroOcurrencias" Width="20px" />
<label style="margin-top: 5px; margin-left: -15px; width: 20px;" for="<%= TxtNumeroOcurrencias.ClientID.ToString()%>"></label>
</div>
</div>
<div class="col-md-2" style="margin-top: 5px; padding-left: 5px;">Veces</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-5" style="padding-left: 0px !important;">
<asp:RadioButton Text="Terminar en:" ID="RBFechaFin" ClientIDMode="Static" GroupName="GNFrecuenciaFinAdd" runat="server" Width="85px" />
</div>
<div class="col-md-6" style="padding-left: 0px !important;">
<div class="form-group form-md-line-input input-iconright" style="padding: 0px !important; margin-top: -5px; margin-left: -10px">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 108px!important; padding-top: 0px;">
<asp:TextBox ID="TxtFechaFinRecurrencia" ClientIDMode="Static" runat="server" CssClass="form-control" Height="28px" Width="80px" Font-Size="13px"></asp:TextBox>
<label style="margin-left: 10px; width: 85%;" for="<%= TxtFechaFinRecurrencia.ClientID.ToString()%>"></label>
<span class="input-group-btn " style="width: 28px">
<asp:LinkButton ID="imgFechaFinRecurrenciaAdd" class="btn default" runat="server" Style="padding-left: 8px; padding-top: 5px;" Height="28px" Width="28px"><i class="fa fa-calendar"></i></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaFinRecurrenciaAdd" runat="server" TargetControlID="TxtFechaFinRecurrencia" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarioFechaFinRecurrenciaAdd" TargetControlID="TxtFechaFinRecurrencia" PopupButtonID="ImgFechaFinRecurrenciaAdd" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<%--<asp:RequiredFieldValidator ID="RFVFechaFinRecurrenciaAdd" runat="server" ControlToValidate="TxtFechaFinRecurrencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaFinRecurrenciaAdd" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFinRecurrenciaAdd" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="width: 100%; float: left; margin-bottom: 10px; margin-left: 0px;display:none">
<hr style="margin-top: 5px; margin-bottom: 10px;" />
<div class="col-md-3" style="padding-left: 0px; padding-right: 0px;">
<asp:CheckBox Text="Gasto Recurrente:" ClientIDMode="Static" runat="server" ID="ChkGastoRecurrente" />
</div>
<div class="form-group col-md-4 form-md-line-input input-iconright" style="padding: 0px !important; margin-top: -5px; margin-left: 0px">
<div class="input-group input-sm" style="padding-top: 0px; padding-left: 0px; padding-right: 0px;">
<asp:TextBox runat="server" ClientIDMode="Static" CssClass="form-control" ID="TxtImporteGastoRecurrente" Width="100px" onkeyup="FormatoMoneda(this)" />
<label style="margin-top: 5px; margin-left: -15px;" for="<%= TxtImporteGastoRecurrente.ClientID.ToString()%>"></label>
<%--<ajax:MaskedEditExtender ID="MEEgastoRecurrente" runat="server" TargetControlID="TxtImporteGastoRecurrente" Mask="999,999.99" MaskType="Number" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>--%>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:HiddenField runat="server" ID="HdnCveEvento" ClientIDMode="Static" Value="-1" />
<%--<div style="display:none">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="VGGuardarAgenda" />
<asp:Button ID="BtnEliminar" runat="server" CssClass="btn btn-danger" OnClick="BtnEliminar_Click" Text="Eliminar" Style="display: none" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea continuar?" data-btn-ok-label="si" />
</div>--%>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding-left: 0px !important;">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy hh:mm" style="width: 70%;">
<asp:TextBox ID="TxtFechaInicioAgenda" Enabled="false" ClientIDMode="Static" runat="server" Width="100%" CssClass="form-control input-sm " CausesValidation="true" MaxLength="18"></asp:TextBox>
<label style="margin-left: -3px; padding-bottom: 30px; width: 70%;" for="<%= TxtFechaInicioAgenda.ClientID.ToString()%>">Fecha de Inicio:</label>
</div>
<asp:RequiredFieldValidator ID="RFVFechaInicioAdd" Display="None" CssClass="help-block errorimput" runat="server" ControlToValidate="TxtFechaInicioAgenda" ErrorMessage="<b><span style='text-decoration: underline'>ERROR</span></b>:<br>El campo <b>''Fecha de Inicio''</b> es necesario." ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding-left: 0px !important;">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy hh:mm" style="width: 70%;">
<asp:TextBox ID="TxtFechaFinAgenda" Enabled="false" ClientIDMode="Static" runat="server" Width="100%" CssClass="form-control input-sm " CausesValidation="true" MaxLength="18"></asp:TextBox>
<label style="margin-left: -3px; padding-bottom: 30px; width: 70%;" for="<%= TxtFechaFinAgenda.ClientID.ToString()%>">Fecha de Fin:</label>
</div>
<asp:RequiredFieldValidator ID="RFVFechaFinAdd" Display="None" CssClass="help-block errorimput" runat="server" ControlToValidate="TxtFechaFinAgenda" ErrorMessage="<b><span style='text-decoration: underline'>ERROR</span></b>: El campo <b>''Fecha de Fin''</b> es necesario." ValidationGroup="VGGuardarAgenda"></asp:RequiredFieldValidator>
</div>
</div>
</div>
<div class="modal-footer">
<asp:HiddenField runat="server" ID="HdnCveEvento" ClientIDMode="Static" Value="-1" />
<%--<div style="display:none">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="VGGuardarAgenda" />
<asp:Button ID="BtnEliminar" runat="server" CssClass="btn btn-danger" OnClick="BtnEliminar_Click" Text="Eliminar" Style="display: none" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea continuar?" data-btn-ok-label="si" />
</div>--%>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
<div id="DVModalOS" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalOS" UpdateMode="Conditional">
@@ -509,7 +446,23 @@
<%--TÉCNICO--%>
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtTecnico" runat="server" MaxLength="100" CssClass="form-control" />
<asp:DropDownList ID="DdlTecnicoAsignar" Width="85%" runat="server" CssClass="form-control select2me" DataTextField="Nombre" DataValueField="CveUsuario" visible="false" ></asp:DropDownList>
<label for="<%= TxtTecnico.ClientID.ToString()%>">Técnico: </label>
<asp:Button ID="BtnAsignar" runat="server" ClientIDMode="Static" Text="+" OnClick="BtnAsignar_Click" CssClass="btn btn-primary" Width="12%" Visible="false" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 " id="divPedido" runat="server">
<div class="form-group form-md-line-input ">
<asp:HyperLink ID="HplPedido" runat="server" Target="_blank" CssClass="Texto form-control" />
<label for="<%= TxtTipoVenta.ClientID.ToString()%>">Pedido: </label>
</div>
</div>
<div class="col-md-6" id="divRemision" runat="server">
<div class="form-group form-md-line-input">
<asp:HyperLink ID="HplRemision" runat="server" Target="_blank" CssClass="Texto form-control" />
<label for="<%= TxtTecnico.ClientID.ToString()%>">Remisión: </label>
</div>
</div>
</div>
@@ -548,6 +501,7 @@
<asp:HiddenField runat="server" ID="HFCveOsDetalle" Value="-1" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HFOCveOIEvento" Value="-1" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HFCveUsuarioAtendio" Value="-1" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="HdnFechaCita" Value="" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
@@ -596,25 +550,18 @@
}
function updateEvent(event, element) {
function updateEvent(event, element) {
$('#<%=HFCveOS.ClientID%>').val(event.CveOS);
$('#<%=HFCveOsDetalle.ClientID%>').val(event.CveOSDetalle);
$('#<%=HFCveUsuarioAtendio.ClientID%>').val(event.CveUsuarioAtendio);
$('#<%=HFOCveOIEvento.ClientID%>').val(event.id);
$('#<%=HFOCveOIEvento.ClientID%>').val(event.id);
$('#<%=LnkCommando.ClientID%>').click();
}
function RadionButtonSelectedValueSet(name, SelectdValue) {
$('input[name="' + name + '"][value="' + SelectdValue + '"]').prop('checked', true);
}
function CheckUpdate(check) {
if (check.checked) {
$("#UpRecurrenciaUpdate").show("slow");
@@ -631,8 +578,6 @@
}
}
function deleteEvent() {
//var id = $get('HdnId').val;
//PageMethods.EliminaEvento(id, deleteSuccess);
@@ -825,13 +770,9 @@
function InitCalendar() {
$(document).ready(function () {
Calendario();
});
}

View File

@@ -1,10 +1,11 @@
Option Explicit On
Option Strict On
Imports APP_Code_CSharp
Imports Extensiones
Imports System.Data
Imports Microsoft.Reporting.WebForms
Imports System.Web.Services
Partial Class OS_RepServiciosMedicos
Inherits ClsPaginas
@@ -267,11 +268,13 @@ Partial Class OS_RepServiciosMedicos
GetCargaTiposOrden()
cargaDropsModal()
End If
End Sub
Private Sub CargaUsuariosTecnicos()
If not UsuarioActual.TienePermisoProceso(171) Then Exit Sub
Dim DTTecnicosresultado As DataTable = Nothing
DTTecnicos = New DataTable
Dim ObjOS As New ClsOS
@@ -292,6 +295,11 @@ Partial Class OS_RepServiciosMedicos
End If
ObjOS.Dispose()
DdlTecnicoAsignar.DataSource = DTTecnicos
DdlTecnicoAsignar.DataBind()
DdlTecnicoAsignar.Visible = True
DdlTecnicoAsignar.Items.Insert(0, New ListItem("-", "-1"))
'Dim ObjUsuarios As New ClsSisUsuarios
'If ObjUsuarios.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 351, UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) Then
' If UsuarioActual.CveRol = 1 Then
@@ -318,7 +326,6 @@ Partial Class OS_RepServiciosMedicos
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
CargaTiposAgenda()
CheckRecurrencia.Attributes.Add("onclick", "CheckAdd(this);")
End Sub
Private Sub CargaTiposAgenda()
Dim ObjEventos As New ClsOIEventos
@@ -378,47 +385,10 @@ Partial Class OS_RepServiciosMedicos
RegistraScript("GetView();")
Dim RecurrenciaTipo = 0, Frecuencia = -1, DiasSemana = "-1", Dias = -1, Mes = -1, RecurrenciaFin = "-1"
If CheckRecurrencia.Checked Then
RecurrenciaTipo = RBLRecurrencia.SelectedValue.ToEntero
Frecuencia = TxtFrecuencia.Text.ToEntero
'OBTENEMOS LOS DIAS SELECCIONADOS EN LA OPCION DE RECURRENCIA POR SEMANA
Select Case RecurrenciaTipo
Case 3
Dim StringDias = ""
For Each item As ListItem In CheckDiasSemana.Items
If item.Selected Then
If StringDias.Length > 0 Then
StringDias += ","
End If
StringDias += item.Value
End If
Next
If StringDias.Length > 0 Then
DiasSemana = StringDias
End If
End Select
'If RBSinFechaFinAdd.Checked Then
' RecurrenciaFin = "-1"
'Else
If RBNumeroOcurrencias.Checked Then
RecurrenciaFin = TxtNumeroOcurrencias.Text
ElseIf RBFechaFin.Checked Then
RecurrenciaFin = TxtFechaFinRecurrencia.Text
Else
RecurrenciaFin = "-1"
End If
Else
If HdnCveEvento.Value.ToEntero > 0 Then
Frecuencia = -2 : DiasSemana = "-2" : Dias = -2 : Mes = -2 : RecurrenciaFin = "-2"
End If
End If
'11/05/2018 - GASTO RECURRENTE
Dim CveTipoEvento As Integer = IIf(ChkGastoRecurrente.Checked, 10, 2).ToString().ToEntero()
Dim Importe As Double = Convert.ToDouble(IIf(ChkGastoRecurrente.Checked, TxtImporteGastoRecurrente.Text, "-1"))
Dim CveTipoEvento As Integer = 2
Dim Importe As Double = -1
If HdnCveEvento.Value.ToEntero > 0 Then
If ObjEventos.UpdateEvento(TxtAsuntoAgenda.Text, TxtDescripcionAgenda.Text, DdlPrioridad.SelectedValue.ToEntero, DdlAgedaTipo.SelectedValue.ToEntero, -1, FechaInicio, FechaFin, -1, "-1", HdnCveEvento.Value.ToEntero, "-1",
@@ -446,15 +416,10 @@ Partial Class OS_RepServiciosMedicos
TxtDescripcionAgenda.Text = ""
TxtAsuntoAgenda.Text = ""
DdlPrioridad.SelectedValue = "1"
TxtNumeroOcurrencias.Text = ""
TxtFechaFinRecurrencia.Text = ""
RBFechaFin.Checked = False
RBNumeroOcurrencias.Checked = False
RBLRecurrencia.SelectedValue = "1"
CheckDiasSemana.ClearSelection()
RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty)
TxtFrecuencia.Text = "1"
LblEmpresaCRM.Text = ""
'RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty)
'TxtFrecuencia.Text = "1"
'LblEmpresaCRM.Text = ""
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs)
@@ -495,38 +460,9 @@ Partial Class OS_RepServiciosMedicos
ObjEventos.Dispose()
Return "a"
End Function
Protected Sub RBLRecurrencia_SelectedIndexChanged(sender As Object, e As EventArgs)
Select Case RBLRecurrencia.SelectedValue.ToEntero
Case 1
LblTextoFrecuencia.Text = "Hora(s)"
TrDiasSemanaAdd.Style("display") = "none"
Case 2
LblTextoFrecuencia.Text = "Dia(s)"
TrDiasSemanaAdd.Style("display") = "none"
Case 3
LblTextoFrecuencia.Text = "Semana(s)"
TrDiasSemanaAdd.Style("display") = "block"
'Chequea los dias seleccionados en la recurrencia
For Each item As ListItem In CheckDiasSemana.Items
If HdnDiasSemanaAgendar.Value.Contains(item.Value) Then
item.Selected = True
Else
item.Selected = False
End If
Next
Case 4
LblTextoFrecuencia.Text = "Mes(es)"
TrDiasSemanaAdd.Style("display") = "none"
Case 5
LblTextoFrecuencia.Text = "Año(s)"
TrDiasSemanaAdd.Style("display") = "none"
Case Else
End Select
UpRecurrencia.Update()
End Sub
Protected Sub BtnActualizaAdd_Click(sender As Object, e As EventArgs)
RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty)
'RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty)
End Sub
#End Region
@@ -618,7 +554,6 @@ Partial Class OS_RepServiciosMedicos
LipiaModalOS()
If TipoAccion = OSModalTipoAccion.Agregar Then
TxtFechaOS.Text = NowADS().ToString("dd/MM/yyyy")
RegistraScript("$('#DVModalOS').modal('show');")
LblModalOStitulo.Text = "Agregar Orden de Servicio"
@@ -648,6 +583,7 @@ Partial Class OS_RepServiciosMedicos
HFCveOS.Value = ObjOS.CveOS.ToString
HFCveOsDetalle.Value = ObjOS.CveOSDetalle.ToString
HdnFechaCita.Value = ObjOS.FechaCita.ToString
TxtDescripcion.Text = ObjOS.Descripcion
TxtFechaOS.Text = ObjOS.FechaCita.ToString("dd/MM/yyyy HH:mm")
TxtProcedimiento.Text = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Procedimiento", "CveProcedimiento =" & ObjOS.CveProcedimiento)
@@ -655,6 +591,12 @@ Partial Class OS_RepServiciosMedicos
TxtCliente.Text = thospital
TxtTipoVenta.Text = GlobalDTTipoVenta(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoVenta", $"CveTipoVenta ={ObjOS.CveTipoVenta}")
TxtTecnico.Text = ObjOS.UsuarioAtendio
divPedido.Visible = ObjOS.CveCotizacion > 0
HplPedido.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={ObjOS.CveCotizacion}"
HplPedido.Text = ObjOS.SerieFolioCotizacion
divRemision.Visible = ObjOS.CveVenta > 0
HplRemision.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={ObjOS.CveVenta}"
HplRemision.Text = ObjOS.SerieFolioVenta
Dim tCve As Integer = ObjOS.CveVenta 'busca la remisión
If tCve <= 0 Then tCve = ObjOS.CveCotizacion 'sino hay remisión toma el pedido
@@ -675,8 +617,17 @@ Partial Class OS_RepServiciosMedicos
LblModalOStitulo.Text = "Orden Cancelada"
End If
RegistraScript("$('#DVModalOS').modal('show');")
If ObjOS.CveUsuarioAtendio = 0 Then
TxtTecnico.Visible = False
DdlTecnicoAsignar.Visible = True
BtnAsignar.Visible = True
Else
TxtTecnico.Visible = True
DdlTecnicoAsignar.Visible = False
BtnAsignar.Visible = False
End If
RegistraScript("$('#DVModalOS').modal('show');")
End If
ObjOS.Dispose()
@@ -736,4 +687,32 @@ Partial Class OS_RepServiciosMedicos
End Sub
Protected Sub BtnAsignar_Click(sender As Object, e As EventArgs)
Dim TieneError As Boolean = False
Dim ObjOS As New ClsOS
ObjOS.IniciaTransacSQL()
Dim CveOsDetalle As Integer = HFCveOsDetalle.Value.ToEntero
Dim CveOS As Integer = HFCveOS.Value.ToEntero
Dim CveEstatusAsignada = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 2", "CveEstatusOrdenServicio ASC").ToEntero
If Not ObjOS.UpdateOrdenesServiciosAsignadas(CveOsDetalle, DdlTecnicoAsignar.SelectedValue.ToEntero, HdnFechaCita.Value.ToDate, HdnFechaCita.Value.ToDateTime(), UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
TieneError = True
End If
If Not TieneError AndAlso Not ObjOS.UpdateOrdenesServiciosEstatus(CveEstatusAsignada, UsuarioActual.CveUsuario, CveOS) Then
TieneError = True
End If
If Not TieneError Then
ObjOS.Commit()
Alert("La Orden ha sido asignada")
Else
ObjOS.RollBack()
End If
ObjOS.Dispose()
End Sub
End Class

View File

@@ -106,7 +106,7 @@ Partial Class Sistemas_PopUpCambiaUsuario
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario, CveEmpresa:=tCveEmpresa)
ADSSessionConfig.sessionUser = Usuario
ADSSessionConfig.sessionUser.CvePlataforma = 1
If Usuario.CveRol = 1200 Then

View File

@@ -105,7 +105,7 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario, CveEmpresa:=tCveEmpresa)
ADSSessionConfig.sessionUser = Usuario
ADSSessionConfig.sessionUser.CvePlataforma = 1
If Usuario.CveRol = 1200 Then
@@ -123,11 +123,8 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
CargaZonasHorarias(UsuarioActual)
End If
End If
RegistraScript("gotourl();")
End If
End If
End Sub
Private Sub CargaZonasHorarias(ByRef UsuarioActual As Usuario)
@@ -174,7 +171,7 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
End Sub
Private Sub CargaUsuarios(Optional Orden As String = "Nombre")
Dim dtt As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("CveRol <> 1")
Dim dtt As DataTable = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol <> 1")
dtt = dtt.FiltraParametros("Estatus = 1", Orden, {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"})
gvUsuarios.DataSource = dtt
gvUsuarios.DataBind()

View File

@@ -117,8 +117,7 @@
<div class="portlet-body rowpadding">
<div class="row my-1">
<label class="col-md-4 bold text-primary">Folio</label>
<asp:Label class="col-md-8" runat="server" ID="LbFolio" Text=""></asp:Label>
<asp:Label runat="server" ID="LbCveSubProyecto" Visible="false"></asp:Label>
<asp:Label class="col-md-8" runat="server" ID="LbFolio" Text=""></asp:Label>
</div>
<div class="row my-1">
@@ -136,6 +135,21 @@
</div>
</div>
<div class="row my-1">
<label class="col-md-4">
<asp:Label runat="server" ID="LblSubProyectoModal"></asp:Label>
</label>
<div class="col-md-8">
<asp:DropDownList runat="server" ID="DdlSubProyecto" Width="100%" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" InitialValue="-1" ErrorMessage="Campo sub Proyecto requerido." Display="None"
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfvDdlSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="input-group">
</div>
</div>
<div class="row">
<label class="col-md-4">Servicio</label>
<div class="col-md-8">

View File

@@ -125,6 +125,15 @@ Partial Class RepContratoDetalle
'Lista de Monedas
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoModal)
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
Private Sub CargaDatos()
'Información General
@@ -139,7 +148,7 @@ Partial Class RepContratoDetalle
SubProyecto = Contrato.Rows(0)("SubProyecto").ToString
CveMasivo = Contrato.Rows(0)("CveMasivo").ToString.ToEntero
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
LbCveSubProyecto.Text = Contrato.Rows(0)("CveSubProyecto").ToString
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
DdlMoneda.SelectedValue = Contrato.Rows(0)("CveMoneda").ToString
@@ -147,13 +156,14 @@ Partial Class RepContratoDetalle
TxtObservaciones.Text = Contrato.Rows(0)("Observaciones").ToString
TelefonoEmpresa = Contrato.Rows(0)("Telefono").ToString
TxtUbicacion.Text = Contrato.Rows(0)("Ubicacion").ToString
TxtFechaSalida.Text = Contrato.Rows(0)("FechaInicial").ToString
TxtFechaRegreso.Text = Contrato.Rows(0)("FechaFinal").ToString
TxtFechaSalida.Text = Contrato.Rows(0)("FechaInicial").ToString.ToDate.ToString("dd/MM/yyyy HH:mm:ss")
TxtFechaRegreso.Text = Contrato.Rows(0)("FechaFinal").ToString.ToDate.ToString("dd/MM/yyyy HH:mm:ss")
TxtCantidadPasajeros.Text = Contrato.Rows(0)("CantidadPasajeros").ToString
DdlTipoAF.SelectedValue = If(Contrato.Rows(0)("CveTipoAF") Is Nothing, "", Contrato.Rows(0)("CveTipoAF").ToString)
TxtImporte.Text = Math.Round(Importe, 2).ToString
TxtAnticipo.Text = Math.Round(Anticipo, 2).ToString
CveContratoEstatus = Contrato.Rows(0)("CveContratosEstatus").ToString.ToEntero
DdlSubProyecto.SelectedValueExist(Contrato.Rows(0)("CveSubProyecto").ToString)
If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then
ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo)
@@ -277,7 +287,7 @@ Partial Class RepContratoDetalle
ObjContratos.IniciaTransacSQL()
Try
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
LbCveSubProyecto.Text.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservacion.Text) Then
Alert("Contrato actualizado correctamente")
End If

View File

@@ -262,7 +262,8 @@
<label class="col-md-4">Cliente</label>
<div class="col-md-8">
<div class="input-group">
<ADS:Dropdownlost ID="DdlClientes" CssClass="form-control" data-metodo="getcliente"
<ADS:Dropdownlost ID="DdlClientes" CssClass="form-control" data-metodo="getcliente" Width="100%" CssStyle="width: 100%;"
runat="server" DataTextField="NombreComercial" DataValueField="CveCliente"
UsaWebService="true" Enabled="false"></ADS:Dropdownlost>
<div class="input-group-addon" style="background-color: #428bca">
@@ -273,6 +274,28 @@
</div>
</div>
<div class="row my-1">
<label class="col-md-4">
<asp:Label runat="server" ID="LblSubProyectoModal"></asp:Label>
</label>
<div class="col-md-8">
<div class="input-group">
<asp:DropDownList runat="server" ID="DdlSubProyectoModal" Width="100%" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass="select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyectoModal" runat="server" ControlToValidate="DdlSubProyectoModal" InitialValue="-1" ErrorMessage="Campo sub Proyecto requerido."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfvDdlSubProyectoModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlSubProyectoModal" Width="300px"></ajax:ValidatorCalloutExtender>
<%-- <div class="input-group-addon" style="background-color: #428bca">
<asp:LinkButton runat="server" ForeColor="White" Text="<i class='fa fa-add'></i>"
PostBackUrl="~/Ventas/Clientes.aspx?CveCliente=-1"></asp:LinkButton>
</div>--%>
</div>
</div>
</div>
<div class="row">
<label class="col-md-4">Servicio</label>
<div class="col-md-8">
@@ -323,18 +346,16 @@
<label class="col-md-4">Fecha Salida</label>
<div class="col-md-8">
<div class="input-group">
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True"
<asp:TextBox ID="TxtFechaSalida" runat="server" CssClass="form-control" CausesValidation="True" type="datetime-local"
Width="100%"
type="datetime"></asp:TextBox>
></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtFechaSalida" runat="server" ControlToValidate="TxtFechaSalida"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Salida''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFechaSalida" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaSalida" Width="100%">
</ajax:ValidatorCalloutExtender>
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>
</div>
</div>
@@ -344,18 +365,16 @@
<div class="col-md-8">
<div class="input-group">
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True"
<asp:TextBox ID="TxtFechaRegreso" runat="server" CssClass="form-control" CausesValidation="True" type="datetime-local"
Width="100%"
type="datetime"></asp:TextBox>
></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtFechaRegreso" runat="server" ControlToValidate="TxtFechaRegreso"
Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Regreso''</b> es necesario, por favor ingréselo."
ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco"
TargetControlID="RFVTxtFechaRegreso" Width="100%">
</ajax:ValidatorCalloutExtender>
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>
</div>
</div>
@@ -468,10 +487,10 @@
Text="Agregar"
ValidationGroup="GrpGuardar"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-secondary" runat="server" clientidmode="Static"
<%-- <button type="button" class="btn btn-secondary" runat="server" clientidmode="Static"
id="BtnArchivo" data-toggle="modal" data-target="#ModalUpload" visible="true">
<i class="fa fa-upload"
aria-hidden="true"></i>Subir Archivo</button>
aria-hidden="true"></i>Subir Archivo</button>--%>
</div>
</div>
</asp:Panel>

View File

@@ -51,6 +51,11 @@ Partial Class ListadoContratos
DdlEstatus.DataBind()
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoModal)
DdlSubProyectoModal.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyectoModal.DataBind()
DdlSubProyectoModal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
Private Sub CargaDatos()
Dim ObjContratos As New ClsContratos
@@ -91,27 +96,102 @@ Partial Class ListadoContratos
End Sub
Protected Sub AddContrato(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = False
Dim CveContrato As Integer = -1
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Extensiones.Archivo) = Anexo.getfiles().Archivos
Dim Filename As String = ""
Dim folderContratosPath As String = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos")
If Not Directory.Exists(folderContratosPath) Then
Directory.CreateDirectory(folderContratosPath)
End If
If DdlClientes.SelectedValue = "" Then
Alert("Debe seleccionar al cliente", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
'Dim CveSubProyecto As Integer = GlobalDTSubProyectos(-1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", "TipoSucursal = 1").ToEntero
'Agregamos Contrato
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
If ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDateTime, TxtFechaRegreso.Text.ToDateTime, TxtUbicacion.Text, "", CveSubProyecto, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text, CveVendedor:=UsuarioActual.CveVendedor) > 0 Then
ObjContratos.Commit()
Alert("Agregado Correctamente.")
CveContrato = ObjContratos.AddContratos(LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDateTime, TxtFechaRegreso.Text.ToDateTime, TxtUbicacion.Text, "",
DdlSubProyectoModal.SelectedValue.ToEntero, -1, -1, -1, -1, LbArchivo.Text, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=34, CveContratosEstatus:=50, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text,
CveVendedor:=UsuarioActual.CveVendedor)
If CveContrato > 0 Then
If Filesgral.Count > 0 Then
For Each fileItem As Archivo In Filesgral
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
Dim fDestino = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", $"{CveContrato.ToString}.{ FileExtension}")
Try
If File.Exists(fDestino) Then
File.Delete(fDestino)
End If
File.Move(fileItem.FileUrl, fDestino)
If Not File.Exists(fDestino) Then
ErrorProceso = True
End If
If ObjContratos.UpdateContratoArchivo(CveContrato, $"{CveContrato.ToString}.{ FileExtension}", UsuarioActual.CveEmpresa) Then
ErrorProceso = False
End If
Catch ex As Exception
ErrorProceso = True
End Try
Exit For
Next
Else
ErrorProceso = False
End If
Anexo.Text = ""
Else
ErrorProceso = True
End If
ObjContratos.Dispose()
'Aumentamos Folio
Dim ObjFolios As New ClsGralFolios
If ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then
ObjFolios.Dispose()
Dim ObjFolios As New ClsGralFolios(ObjContratos.IniciaTransacSQL())
If Not ObjFolios.UpdateFolioActual(DdlSubProyectoModal.SelectedValue.ToEntero, "Con", True, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
End If
If Not ErrorProceso Then
ObjContratos.Commit()
Alert("Agregado Correctamente.")
Else
ObjContratos.RollBack()
Alert("Se presento un error al guardar el contrato.", TipoMensaje.MsgAdvertencia)
End If
ObjContratos.Dispose()
ResetModal()
CargaDatos()
RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1")
End Sub
Protected Sub ResetModal()
'Reiniciamos modal
TxtDescripcion.Text = ""
TxtFechaSalida.Text = ""
@@ -119,6 +199,7 @@ Partial Class ListadoContratos
TxtObservaciones.Text = ""
TxtUbicacion.Text = ""
DdlClientes.SelectedText = ""
DdlSubProyectoModal.SelectedValueExist(-1)
DdlTipoAF.SelectedValueExist(-1)
TxtImporte.Text = ""
TxtAnticipo.Text = ""
@@ -126,8 +207,6 @@ Partial Class ListadoContratos
LbArchivo.Text = ""
UpModal.Update()
CargaDatos()
RegistraScript("$('#ModalAgregar').modal('hide')", "hidemodal1")
End Sub
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)

View File

@@ -46,7 +46,7 @@
<%-- Filtros --%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet solid grey-cascade portlet-filter" id="dvFiltros">
<%-- Filtro Visible - Consulta --%>
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
@@ -103,7 +103,7 @@
<%-- Estatus --%>
<label class="col-md-1 ">Estatus:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEstatusConsulta" data-text="Todos" AppendDataBoundItems="true"
<asp:DropDownList ID="DdlEstatusConsulta" data-text="Todos" AppendDataBoundItems="true" ClientIDMode="Static"
DataTextField="ContratoEstatus"
DataValueField="CveContratoEstatus" CssClass="form-control ddlFiltros input-sm select2me Widthall"
Style="width: 100%;" runat="server">
@@ -118,7 +118,7 @@
<label class="col-md-1 truncate ">Centro de Costos</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlSubProyectos" data-text="Todos" AppendDataBoundItems="true"
DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall"
DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall" ClientIDMode="Static"
Style="width: 100%;" runat="server">
</asp:DropDownList>
</div>
@@ -126,7 +126,7 @@
<label class="col-md-1 ">Tipo de Unidad</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTipoUnidad" data-text="Todos" AppendDataBoundItems="true"
DataTextField="TipoActivoFijo" DataValueField="CveTipoActivoFijo" CssClass="form-control ddlFiltros input-sm select2me Widthall"
DataTextField="TipoActivoFijo" DataValueField="CveTipoActivoFijo" CssClass="form-control ddlFiltros input-sm select2me Widthall" ClientIDMode="Static"
Style="width: 100%;" runat="server">
</asp:DropDownList>
</div>
@@ -134,7 +134,7 @@
<label class="col-md-1 ">Chofer:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlChoferFiltro" data-text="Todos" AppendDataBoundItems="true"
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me Widthall"
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me Widthall" ClientIDMode="Static"
Style="width: 100%;" runat="server">
</asp:DropDownList>
</div>
@@ -148,7 +148,7 @@
<div class="col-md-12">
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
<%--Calendario Tab--%>
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Calendario">
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Calendario" OnClientClick="TabAltaClicked" >
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
@@ -208,7 +208,7 @@
<asp:GridView ID="GvContratos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se Encontró Contrato Registrado"
CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn miGrid"
GridLines="None"
data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros,CveMoneda">
data-sort="true" DataKeyNames="CveContrato, NumeroContrato, DescripcionContrato, Ubicacion, FechaInicial, FechaFinal, CveCliente, NombreComercial, CveTipoAF, Importe, ImporteMin, ImporteMax, Observaciones, CveAF, CveChofer, CveChofer2, CveContratosEstatus, CantidadPasajeros,CveMoneda,Moneda,CveSubProyecto">
<Columns>
<asp:TemplateField HeaderText="Contrato">
<ItemTemplate>
@@ -358,6 +358,17 @@
</div>
</div>
<div class="row my-1">
<label class="col-md-4">
<asp:Label runat="server" ID="LblSubProyectoModal"></asp:Label>
</label>
<div class="col-md-8">
<asp:DropDownList runat="server" ID="DdlSubProyectoModal" Width="100%" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass="select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyectoModal" runat="server" ControlToValidate="DdlSubProyectoModal" InitialValue="-1" ErrorMessage="Campo sub Proyecto requerido." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfvDdlSubProyectoModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlSubProyectoModal" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-4">Servicio:</label>
<div class="col-md-8">
@@ -401,7 +412,7 @@
<div class="row my-1">
<label class="col-md-4">Moneda:</label>
<div class="col-md-8">
<asp:TextBox ID="TxtMoneda" runat="server" ReadOnly="true" Width="100%"></asp:TextBox>
<asp:TextBox ID="TxtMoneda" runat="server" Width="100%" Enabled="false"></asp:TextBox>
</div>
</div>
@@ -601,12 +612,22 @@
yAxis.data.setAll(categorias);
// Obtener valores de las cajas de texto
var fechaI = document.getElementById('<%= txtFechaI.ClientID %>').value;
var fechaF = document.getElementById('<%= txtFechaF.ClientID %>').value;
// Convertir valores a objetos Date
var minDate = new Date(fechaI.split("/").reverse().join("-"));
var maxDate = new Date(fechaF.split("/").reverse().join("-"));
dateAxis = am5xy.DateAxis.new(root, {
baseInterval: { timeUnit: "minute", count: 1 },
baseInterval: { timeUnit: "day", count: 1 },
renderer: am5xy.AxisRendererX.new(root, {
minorGridEnabled: true,
minGridDistance: 90
})
}),
min: minDate.getTime(),
max: maxDate.getTime()
//min: new Date(2024, 6, 15).getTime(),
//max: new Date(2024, 6, 31).getTime()
});
@@ -752,10 +773,17 @@
$('#<%=DdlEstatusContrato.ClientID%>').val(event.CveEventoEstatus);
$('#<%=TxtDolares.ClientID%>').val(event.Dolares);
$('#<%=TxtPesos.ClientID%>').val(event.Pesos);
$('#<%=TxtMoneda.ClientID%>').val(event.Moneda);
//document.getElementById('<%= TxtMoneda.ClientID %>').value = event.Moneda;
$('#<%=TxtAnticipo.ClientID%>').val(event.Anticipo);
$('#<%=HdnCveContrato.ClientID%>').val(event.id);
$('#<%=DdlTipoAF.ClientID%>').val(event.CveTipoAF);
$('#<%=DdlSubProyectoModal.ClientID%>').val(event.CveSubProyecto);
// alert(event.Moneda);
if (event.NombreComercial !== null) {
@@ -769,29 +797,46 @@
}
function formatearFechaISO(fechaISO) {
let fecha = new Date(fechaISO);
function formatearFechaISO(fechaISO) {
let fecha = new Date(fechaISO);
// Formatear la fecha en DD/MM/YYYY
let dia = fecha.getDate().toString().padStart(2, '0');
let mes = (fecha.getMonth() + 1).toString().padStart(2, '0'); // getMonth() devuelve mes de 0-11
let año = fecha.getFullYear();
// Formatear la hora en formato 24 horas
let horas = fecha.getHours().toString().padStart(2, '0');
let minutos = fecha.getMinutes().toString().padStart(2, '0');
let segundos = fecha.getSeconds().toString().padStart(2, '0');
// Combinar la fecha y la hora
return `${dia}/${mes}/${año} ${horas}:${minutos}:${segundos}`;
}
//function formatearFechaISO(fechaISO) {
// let fecha = new Date(fechaISO);
// Formatear la fecha en DD/MM/YYYY
let dia = fecha.getDate().toString().padStart(2, '0');
let mes = (fecha.getMonth() + 1).toString().padStart(2, '0'); // getMonth() devuelve mes de 0-11
let año = fecha.getFullYear();
// // Formatear la fecha en DD/MM/YYYY
// let dia = fecha.getDate().toString().padStart(2, '0');
// let mes = (fecha.getMonth() + 1).toString().padStart(2, '0'); // getMonth() devuelve mes de 0-11
// let año = fecha.getFullYear();
// Formatear la hora en formato 12 horas con AM/PM
let horas = fecha.getHours();
let minutos = fecha.getMinutes().toString().padStart(2, '0');
let periodo = 'a. m.';
if (horas >= 12) {
periodo = 'p. m.';
horas = horas > 12 ? horas - 12 : horas; // Convertir hora de formato 24 a 12 horas
}
if (horas === 0) horas = 12; // Medianoche se muestra como 12 a.m.
horas = horas.toString().padStart(2, '0');
// // Formatear la hora en formato 12 horas con AM/PM
// let horas = fecha.getHours();
// let minutos = fecha.getMinutes().toString().padStart(2, '0');
// let periodo = 'a. m.';
// if (horas >= 12) {
// periodo = 'p. m.';
// horas = horas > 12 ? horas - 12 : horas; // Convertir hora de formato 24 a 12 horas
// }
// if (horas === 0) horas = 12; // Medianoche se muestra como 12 a.m.
// horas = horas.toString().padStart(2, '0');
// Combinar la fecha y la hora
return `${dia}/${mes}/${año} ${horas}:${minutos}:00 ${periodo}`;
}
// // Combinar la fecha y la hora
// return `${dia}/${mes}/${año} ${horas}:${minutos}:00 ${periodo}`;
//}
function RadionButtonSelectedValueSet(name, SelectdValue) {
$('input[name="' + name + '"][value="' + SelectdValue + '"]').prop('checked', true);
@@ -905,7 +950,11 @@
tipoVista: '<%= RBTipoVista.Text %>',
METODO: 'contrato_transportes',
CveUsuarioPara: $('#DdlTecnico').val(),
CveSubProyecto: $('#DdlSubProyecto').val()
CveSubProyecto: $('#DdlSubProyecto').val(),
CveCliente: $('#C_DdlCliente_Value').val(),
CveContratoEstatus: $('#DdlEstatusConsulta').val(),
CveTipoActivoFijo: $('#DdlTipoUnidad').val(),
CvePersonal: $('#DdlChoferFiltro').val()
}
},
eventDrop: eventDropped,
@@ -944,6 +993,16 @@
}
function TabAltaClicked(sender, e) {
setTimeout(function () {
InitCalendar();
}, 10);
}
</script>

View File

@@ -75,6 +75,8 @@ Partial Class RepContratosCalendario
GvContratos.DataBind()
UpTitulos.Update()
RegistraScript("InitCalendar();")
End Sub
Public Shared Function GetLastDayOfMonth(ByVal dateTime As DateTime) As DateTime
@@ -157,7 +159,7 @@ Partial Class RepContratosCalendario
DdlTipoUnidad.DataBind()
'Lista de Activos fijos
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros(" EstadoActivoFijo= 'Activo' ")
DdlAF.DataBind()
DdlAF.Items.Insert(0, New ListItem("-", "-1"))
@@ -187,7 +189,13 @@ Partial Class RepContratosCalendario
DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyectos.DataBind()
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyectoModal)
DdlSubProyectoModal.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyectoModal.DataBind()
DdlSubProyectoModal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
'CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
UpModal.Update()
@@ -196,7 +204,8 @@ Partial Class RepContratosCalendario
Private Sub OnRowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvContratos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim BackgroundColor As String = DataBinder.Eval(e.Row.DataItem, "BackgroundColor").ToString()
e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BackgroundColor)
e.Row.BackColor = Drawing.ColorTranslator.FromHtml(BackgroundColor)
e.Row.Cells(1).Attributes.Add("data-order", e.Row.DBCampo("FechaInicial").ToDate.Ticks.ToString)
End If
End Sub
Protected Sub MostrarModal(sender As Object, e As System.EventArgs)
@@ -219,15 +228,40 @@ Partial Class RepContratosCalendario
Protected Sub UpdateContrato(sender As Object, e As EventArgs)
Dim ObjContratos As New ClsContratos
If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim) Then
RegistraScript("$('#ModalActualizar').modal('hide');")
Dim DTAgendadados As New DataTable
If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, UsuarioActual.CveEmpresa, CveContrato) Then
DTAgendadados = ObjContratos.DtResultados.Copy
If DTAgendadados.Rows.Count > 0 Then
Dim sb As New StringBuilder
sb.Append($"Se detectaron Contratos con la unidad {DdlAF.SelectedItem.Text} asignada en las fechas especificadas.</br></br>")
For Each dr As DataRow In DTAgendadados.Rows
sb.AppendLine($"Contrato: <b>{dr("NumeroContrato").ToString }</b>, Salida: {dr("FechaInicial").ToString.ToDate.ToString("dd/MM/yyyy HH:mm:ss")}, Regreso: {dr("FechaFinal").ToString.ToDate.ToString("dd/MM/yyyy HH:mm:ss")} </br>")
Next
Alert(sb.ToString, TipoMensaje.MsgAdvertencia)
DTAgendadados.Dispose()
ObjContratos.Dispose()
Exit Sub
End If
End If
If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", DdlSubProyectoModal.SelectedValue.ToEntero,
-1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero, Observaciones:=TxtObservaciones.Text.Trim) Then
RegistraScript("$('#ModalActualizar').modal('hide');")
Alert("Actualizado Correctamente.")
End If
ObjContratos.Dispose()
UpTitulos.Update()
CargaDatos()
InicializaCalendar()
ObjContratos.Dispose()
UpTitulos.Update()
CargaDatos()
InicializaCalendar()
End Sub
Protected Sub UpdateModal(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
@@ -238,14 +272,15 @@ Partial Class RepContratosCalendario
TxtDescripcion.Text = GvRow.DataKey("DescripcionContrato")
TxtObservaciones.Text = GvRow.DataKey("Observaciones")
TxtUbicacion.Text = GvRow.DataKey("Ubicacion")
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy hh:mm tt")
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy hh:mm tt")
TxtMoneda.Text = GvRow.DataKey("CveMoneda")
TxtFechaSalida.Text = Convert.ToDateTime(GvRow.DataKey("FechaInicial")).ToString("dd/MM/yyyy HH:mm:ss")
TxtFechaRegreso.Text = Convert.ToDateTime(GvRow.DataKey("FechaFinal")).ToString("dd/MM/yyyy HH:mm:ss ")
TxtMoneda.Text = GvRow.DataKey("Moneda")
'Requeridos
DdlAF.SelectedValue = GvRow.DataKey("CveAF")
DdlAF.SelectedValueExist(GvRow.DataKey("CveAF"))
DdlChofer.SelectedValueExist(GvRow.DataKey("CveChofer"))
DdlChofer2.SelectedValueExist(GvRow.DataKey("CveChofer2"))
DdlEstatusContrato.SelectedValue = GvRow.DataKey("CveContratosEstatus")
DdlEstatusContrato.SelectedValueExist(GvRow.DataKey("CveContratosEstatus"))
DdlSubProyectoModal.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
CveContrato = GvRow.DataKey("CveContrato").ToEntero
UpCommando.Update()
UpModal.Update()
@@ -283,6 +318,8 @@ Partial Class RepContratosCalendario
Protected Sub RBTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
InicializaCalendar()
CargaCronograma()
End Sub
Protected Sub DdlTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)

View File

@@ -1032,7 +1032,7 @@
$get("TxtCambio").value = FormatoNumero(total - totalVenta);
} else {
lblCambio.innerHTML = "Faltante:";
HdnCambioFaltante.value = "0";
//HdnCambioFaltante.value = "0";
$get("TxtCambio").value = FormatoNumero(total - totalVenta, 2);
}

View File

@@ -532,6 +532,9 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
{
Modelos.Factura.MCancelacionVentaMensaje retorno = null;
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion: true);
if (factura.ErrorList.Count > 0) { retorno.HuboError = true; return retorno; }
if (EsRefacturacion)
{
//SI YA FUE REFACTURADA MARCALA COMO REFACTURADA