diff --git a/App_Code/CalendarEvent.vb b/App_Code/CalendarEvent.vb
index da3261896..f0a7a8aca 100644
--- a/App_Code/CalendarEvent.vb
+++ b/App_Code/CalendarEvent.vb
@@ -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
diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb
index 52d3826f9..6d8b7fdf3 100644
--- a/App_Code/ClsContratos.vb
+++ b/App_Code/ClsContratos.vb
@@ -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
diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb
index d6af2b03d..3b0a253bc 100644
--- a/App_Code/ClsOS.vb
+++ b/App_Code/ClsOS.vb
@@ -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
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 998390c5c..220fc411a 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -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
'''
'''
'''
- 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
diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx
index d5dbda671..75b6ae9e5 100644
--- a/Ashx/CargaEventos.ashx
+++ b/Ashx/CargaEventos.ashx
@@ -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
diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx
index 1b258fe1f..1c2baa635 100644
--- a/Bancos/DepositosCaja.aspx
+++ b/Bancos/DepositosCaja.aspx
@@ -315,12 +315,16 @@
-
-
+
+
-
-
+
+
+
+
+
+
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index 0338bb999..1742628f5 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -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("Imprimir {1}
", 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
diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb
index 9f9dcaf4e..0dd21d7fd 100644
--- a/Bancos/PopIEVentas.aspx.vb
+++ b/Bancos/PopIEVentas.aspx.vb
@@ -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"
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index d9b266f58..c43a2ee8b 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -5103,7 +5103,7 @@
-
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 1359cb59e..61edd533d 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -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()
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index 0c556ae5a..722ac2d7f 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -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
diff --git a/Contratos/ModificarPresupuesto.aspx.vb b/Contratos/ModificarPresupuesto.aspx.vb
index f26d46780..1e8aaf511 100644
--- a/Contratos/ModificarPresupuesto.aspx.vb
+++ b/Contratos/ModificarPresupuesto.aspx.vb
@@ -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
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 42ab686b6..1fd1718ba 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -571,8 +571,8 @@ Partial Class Inventarios_RecepcionAlmacen
''' Parametro sin espacios y separado por comas ["1,2,3,21"]
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"
diff --git a/Inventarios/RepNotasSinAlmacen.aspx b/Inventarios/RepNotasSinAlmacen.aspx
index b91d91863..e6270a0dd 100644
--- a/Inventarios/RepNotasSinAlmacen.aspx
+++ b/Inventarios/RepNotasSinAlmacen.aspx
@@ -190,8 +190,8 @@
-
-
+
+
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index 3b435163b..934be7223 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -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
diff --git a/OS/RepServiciosMedicos.aspx b/OS/RepServiciosMedicos.aspx
index 13814deaa..7659d6de4 100644
--- a/OS/RepServiciosMedicos.aspx
+++ b/OS/RepServiciosMedicos.aspx
@@ -152,8 +152,7 @@
-
-
+
@@ -180,243 +179,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Código Colores
+
+
+
+
+
+ Levantamiento
+
+
+ Surtido
+
+
+ Asignado
+
+
+ Finalizado
+
+
+ Facturado
+
+
+ Cobrado
+
+
+ Cancelado
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cirugías
+
+
+
-
-
-
-
- Cirugías
-
-
-
+
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
Servicios a Domicilio
+
-
-
-
-
-
-
-
-
Servicios a Domicilio
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Cada:
-
-
-
-
-
-
- <%--
-
-
--%>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Veces
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%--
- --%>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%----%>
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
@@ -509,7 +446,23 @@
<%--TÉCNICO--%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -548,6 +501,7 @@
+
@@ -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();
-
-
-
+
});
}
diff --git a/OS/RepServiciosMedicos.aspx.vb b/OS/RepServiciosMedicos.aspx.vb
index a3e7bfff5..d6ba29431 100644
--- a/OS/RepServiciosMedicos.aspx.vb
+++ b/OS/RepServiciosMedicos.aspx.vb
@@ -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
diff --git a/Sistemas/PopUpCambiaUsuario.aspx.vb b/Sistemas/PopUpCambiaUsuario.aspx.vb
index fcf77c1d4..e84b800d4 100644
--- a/Sistemas/PopUpCambiaUsuario.aspx.vb
+++ b/Sistemas/PopUpCambiaUsuario.aspx.vb
@@ -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
diff --git a/Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb b/Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb
index ad903f0d1..3a81bbd96 100644
--- a/Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb
+++ b/Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb
@@ -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()
diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx
index eb0470f9f..5812337ce 100644
--- a/Transportes/RepContratoDetalle.aspx
+++ b/Transportes/RepContratoDetalle.aspx
@@ -117,8 +117,7 @@
diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb
index e77e81d96..f1b92413e 100644
--- a/Transportes/RepContratos.aspx.vb
+++ b/Transportes/RepContratos.aspx.vb
@@ -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)
diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx
index 9902036ff..9eae17ef2 100644
--- a/Transportes/RepContratosCalendario.aspx
+++ b/Transportes/RepContratosCalendario.aspx
@@ -46,7 +46,7 @@
<%-- Filtros --%>
-