Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -1683,7 +1683,7 @@ Public Class ClsCompras
|
|||||||
|
|
||||||
#Region "F A C T U R A S "
|
#Region "F A C T U R A S "
|
||||||
|
|
||||||
Public Function GetFacturas(CveFactura As Integer, Folio As String, FechaFacturaI As Date, FechaFacturaF As Date, RFC As String, Proveedor As String, FueValidado As Integer, CveResponsable As Integer, CveProveedorClasificacion As Integer, CveTipoProveedor As Integer, TipoComprobante As String, CveEmpresa As Integer) As Boolean
|
Public Function GetFacturas(CveFactura As Integer, Folio As String, FechaFacturaI As Date, FechaFacturaF As Date, RFC As String, Proveedor As String, FueValidado As Integer, CveResponsable As Integer, CveProveedorClasificacion As Integer, CveTipoProveedor As Integer, TipoComprobante As String, CveEmpresa As Integer, Optional Opcion As Integer = 1) As Boolean
|
||||||
Dim OnError As Boolean = False
|
Dim OnError As Boolean = False
|
||||||
|
|
||||||
'StrSQL.Clear()
|
'StrSQL.Clear()
|
||||||
@@ -1719,6 +1719,7 @@ Public Class ClsCompras
|
|||||||
.Add("@CveProveedorClasificacion", SqlDbType.Int).Value = CveProveedorClasificacion
|
.Add("@CveProveedorClasificacion", SqlDbType.Int).Value = CveProveedorClasificacion
|
||||||
.Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
|
.Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
|
||||||
.Add("@TipoComprobante", SqlDbType.VarChar).Value = TipoComprobante
|
.Add("@TipoComprobante", SqlDbType.VarChar).Value = TipoComprobante
|
||||||
|
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@@ -2412,6 +2413,47 @@ Public Class ClsCompras
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function AddComplementoTraslado(CveFactura As Integer, CveCompra As Integer, CveUsuario As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Comp_ComplementoTrasladoAdd")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|
||||||
|
.Add("@CveFactura", SqlDbType.Int).Value = CveFactura
|
||||||
|
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al vincular el traslado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function RemoveComplementoTraslado(CveComplementoTraslado As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_Comp_ComplementoTrasladoRemove")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|
||||||
|
.Add("@CveComplementoTraslado", SqlDbType.Int).Value = CveComplementoTraslado
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
|
||||||
|
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al vincular el traslado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function AddVincularPago(CveFactura As Integer) As Boolean
|
Public Function AddVincularPago(CveFactura As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Comp_VincularPagoAdd")
|
DataAdapter("PA_Comp_VincularPagoAdd")
|
||||||
|
|||||||
@@ -3758,7 +3758,7 @@ Public Class ClsGenerales
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function AddInvEntregaAlmacenRuta(CveSubProyectoOrigen As Integer, CveMovimientoAlmacen As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, Tipo As String, Orden As Integer) As Integer
|
Public Function AddInvEntregaAlmacenRuta(CveSubProyectoOrigen As Integer, CveMovimientoAlmacen As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, Tipo As String, Orden As Integer, Estatus As Integer) As Integer
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
DataAdapter("PA_Inv_EntregaAlmacenRutaAdd")
|
DataAdapter("PA_Inv_EntregaAlmacenRutaAdd")
|
||||||
|
|
||||||
@@ -3773,6 +3773,7 @@ Public Class ClsGenerales
|
|||||||
.Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
|
.Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega
|
||||||
.Add("@Orden", SqlDbType.Int).Value = Orden
|
.Add("@Orden", SqlDbType.Int).Value = Orden
|
||||||
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
|
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo
|
||||||
|
.Add("@Estatus", SqlDbType.VarChar).Value = Estatus
|
||||||
.Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output
|
.Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
End With
|
End With
|
||||||
|
|
||||||
@@ -3811,7 +3812,7 @@ Public Class ClsGenerales
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetInvEntregaAlmacenRuta(CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Opcion As Integer) As Boolean
|
Public Function GetInvEntregaAlmacenRuta(CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Opcion As Integer, Optional Estatus As Integer = -1) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
@@ -3824,6 +3825,7 @@ Public Class ClsGenerales
|
|||||||
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||||
|
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||||
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
@@ -3831,7 +3833,29 @@ Public Class ClsGenerales
|
|||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error obtener las entregas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al obtener las entregas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Function RemoveInvEntregaAlmacenRuta(CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Inv_EntregaAlmacenRutaRemove")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar la entregas o Recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
@@ -3858,7 +3882,77 @@ Public Class ClsGenerales
|
|||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error obtener las entregas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
OnError("Ocurrió un error al obtener las entregas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Function AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, CveUsuario As Integer) As Boolean
|
||||||
|
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleAdd")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|
||||||
|
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
|
||||||
|
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||||
|
.Add("@Cantidad", SqlDbType.Float).Value = Cantidad
|
||||||
|
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar el detalle de recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Public Function RemoveEntregaAlmacenRutaDetalle(CveEntregaAlmacenDetalle As Integer) As Boolean
|
||||||
|
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleRemove")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveEntregaAlmacenDetalle", SqlDbType.Int).Value = CveEntregaAlmacenDetalle
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar el detalle de recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer) As Boolean
|
||||||
|
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Inv_EntregaAlmacenRutaDetalleGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el detalle de recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -5503,7 +5503,8 @@ Public Class ClsInventarios
|
|||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer, ConfigCartaPorte As String, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String, NumPolizaSeguro As String, CveUsuario As Integer) As Boolean
|
Public Function AddCamiones(Placa As String, Especificacion As String, CveEmpresa As Integer, ConfigCartaPorte As String, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String,
|
||||||
|
NumPolizaSeguro As String, CveUsuario As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguroCarga As String) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Inv_CamionesAdd")
|
DataAdapter("PA_Inv_CamionesAdd")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
@@ -5517,6 +5518,10 @@ Public Class ClsInventarios
|
|||||||
.Add("@NumPolizaSeguro", SqlDbType.VarChar).Value = NumPolizaSeguro
|
.Add("@NumPolizaSeguro", SqlDbType.VarChar).Value = NumPolizaSeguro
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
.Add("@NombreAseguradoraMedioAmbiente", SqlDbType.VarChar).Value = NombreAseguradoraMedioAmbiente
|
||||||
|
.Add("@NumPolizaSeguroMedioAmbiente", SqlDbType.VarChar).Value = NumPolizaSeguroMedioAmbiente
|
||||||
|
.Add("@NombreAseguradoraCarga", SqlDbType.VarChar).Value = NombreAseguradoraCarga
|
||||||
|
.Add("@NumPolizaSeguroCarga", SqlDbType.VarChar).Value = NumPolizaSeguroCarga
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
@@ -5541,7 +5546,8 @@ Public Class ClsInventarios
|
|||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String, ConfigCartaPorte As String, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String, NumPolizaSeguro As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
Public Function UpdateCamiones(CveCamion As Integer, Placa As String, Especificacion As String, ConfigCartaPorte As String, Anio As Integer, CveTipoPermisoSCT As Integer, NumPermisoSCT As String, NombreAseguradora As String,
|
||||||
|
NumPolizaSeguro As String, CveUsuario As Integer, CveEmpresa As Integer, NombreAseguradoraMedioAmbiente As String, NumPolizaSeguroMedioAmbiente As String, NombreAseguradoraCarga As String, NumPolizaSeguroCarga As String) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Inv_CamionesUpdate")
|
DataAdapter("PA_Inv_CamionesUpdate")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
@@ -5556,6 +5562,10 @@ Public Class ClsInventarios
|
|||||||
.Add("@NumPolizaSeguro", SqlDbType.VarChar).Value = NumPolizaSeguro
|
.Add("@NumPolizaSeguro", SqlDbType.VarChar).Value = NumPolizaSeguro
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@NombreAseguradoraMedioAmbiente", SqlDbType.VarChar).Value = NombreAseguradoraMedioAmbiente
|
||||||
|
.Add("@NumPolizaSeguroMedioAmbiente", SqlDbType.VarChar).Value = NumPolizaSeguroMedioAmbiente
|
||||||
|
.Add("@NombreAseguradoraCarga", SqlDbType.VarChar).Value = NombreAseguradoraCarga
|
||||||
|
.Add("@NumPolizaSeguroCarga", SqlDbType.VarChar).Value = NumPolizaSeguroCarga
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -67,6 +67,24 @@ Public Class ClsSisNotificaciones
|
|||||||
'End Property
|
'End Property
|
||||||
|
|
||||||
'Push Notifications
|
'Push Notifications
|
||||||
|
ReadOnly Property GlobalDTUsuarios(Optional CveUsuario As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1) As DataTable
|
||||||
|
Get
|
||||||
|
Dim Str As New StringBuilder
|
||||||
|
If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario)
|
||||||
|
If CveEmpresa <> -1 Then Str.AppendFormat(" {0} CveEmpresa = {1}", If(Str.Length > 0, "AND", ""), CveEmpresa)
|
||||||
|
If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente)
|
||||||
|
If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor)
|
||||||
|
|
||||||
|
If CveUsuario <> -1 OrElse CveEmpresa <> -1 Then
|
||||||
|
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
|
||||||
|
GlobalDTUsuarios = Dv.ToTable
|
||||||
|
Dv.Dispose()
|
||||||
|
Else
|
||||||
|
GlobalDTUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public Const FirebaseWebService As String = "https://fcm.googleapis.com/fcm/send"
|
Public Const FirebaseWebService As String = "https://fcm.googleapis.com/fcm/send"
|
||||||
Public Const FirebaseServerKey As String = "AAAAqx0xsBA:APA91bHip_JcMGhNQiIzdnodY9ynkHIjX9wEc4TrLkepXK0Lz1QEar5dys6sa3ourPLGiEJD4fGGnSzrk2M_9aJuQo55LjvSJs2c1bU74u-yArMcbI0F_cKzbYAcOMRc8pbRknuWGsXX"
|
Public Const FirebaseServerKey As String = "AAAAqx0xsBA:APA91bHip_JcMGhNQiIzdnodY9ynkHIjX9wEc4TrLkepXK0Lz1QEar5dys6sa3ourPLGiEJD4fGGnSzrk2M_9aJuQo55LjvSJs2c1bU74u-yArMcbI0F_cKzbYAcOMRc8pbRknuWGsXX"
|
||||||
Public Const SenderID As String = "734929203216"
|
Public Const SenderID As String = "734929203216"
|
||||||
@@ -143,6 +161,7 @@ Public Class ClsSisNotificaciones
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "N O T I F I C A C I O N E S"
|
#Region "N O T I F I C A C I O N E S"
|
||||||
|
|
||||||
Public Sub DispararNotificacion(CveNotificacion As Integer, CvesFiltro As List(Of Object), CveEmpresa As Integer)
|
Public Sub DispararNotificacion(CveNotificacion As Integer, CvesFiltro As List(Of Object), CveEmpresa As Integer)
|
||||||
@@ -232,6 +251,42 @@ Public Class ClsSisNotificaciones
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
#Region "V A L I D A - U S U A R I O"
|
||||||
|
Private Function ValidaUsuarioSistema(CveEmpresa As Integer) As Usuario
|
||||||
|
Dim UsuarioActual As Usuario = Nothing
|
||||||
|
Dim ObjUsuarios As New ClsSisUsuarios
|
||||||
|
If ObjUsuarios.GetUsuarios(100) Then
|
||||||
|
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
|
||||||
|
Dim Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
|
||||||
|
Dim Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
|
||||||
|
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, IMEI, CveEmpresa)
|
||||||
|
UsuarioActual.CveEmpresa = CveEmpresa
|
||||||
|
CreaObjetoEmpresa(UsuarioActual)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjUsuarios.Dispose()
|
||||||
|
Return UsuarioActual
|
||||||
|
End Function
|
||||||
|
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
|
||||||
|
|
||||||
|
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
|
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
|
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
|
|
||||||
|
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||||
|
For Each Row As Data.DataRow In dttmp.Rows
|
||||||
|
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||||
|
Next
|
||||||
|
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||||
|
End If
|
||||||
|
|
||||||
|
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||||
|
End If
|
||||||
|
ObjEmpresa.Dispose()
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
|
||||||
#Region "N O T I F I C A C I O N E S - M E T O D O S G E N E R A L E S"
|
#Region "N O T I F I C A C I O N E S - M E T O D O S G E N E R A L E S"
|
||||||
|
|
||||||
Public Function ObtenerNotificaciones() As Boolean
|
Public Function ObtenerNotificaciones() As Boolean
|
||||||
@@ -261,20 +316,30 @@ Public Class ClsSisNotificaciones
|
|||||||
|
|
||||||
Public Sub ArmarReportesProgramados()
|
Public Sub ArmarReportesProgramados()
|
||||||
Try
|
Try
|
||||||
|
|
||||||
For Each RowReporte As DataRow In DTReportesProgramados.Rows
|
For Each RowReporte As DataRow In DTReportesProgramados.Rows
|
||||||
Dim CveReporteProgramado As Integer = RowReporte("CveReporteProgramado").ToString.ToEntero
|
Dim CveReporteProgramado As Integer = RowReporte("CveReporteProgramado").ToString.ToEntero
|
||||||
Dim CveNotificacionBitacora As Integer = RowReporte("CveNotificacionBitacora").ToString.ToEntero
|
Dim CveNotificacionBitacora As Integer = RowReporte("CveNotificacionBitacora").ToString.ToEntero
|
||||||
|
|
||||||
Dim Correos As String = RowReporte("Correos").ToString
|
Dim Correos As String = RowReporte("Correos").ToString
|
||||||
|
Dim NombreCliente As String = RowReporte("Cliente").ToString
|
||||||
|
|
||||||
Dim FechaI As DateTime = RowReporte("FechaI").ToString.ToDateTime
|
Dim FechaI As DateTime = RowReporte("FechaI").ToString.ToDateTime
|
||||||
Dim FechaF As DateTime = RowReporte("FechaF").ToString.ToDateTime
|
Dim FechaF As DateTime = RowReporte("FechaF").ToString.ToDateTime
|
||||||
|
|
||||||
Dim CveReporte As Integer = RowReporte("CveReporte").ToString.ToEntero
|
Dim CveReporte As Integer = RowReporte("CveReporte").ToString.ToEntero
|
||||||
Dim CveCliente As Integer = RowReporte("CveCliente").ToString.ToEntero
|
Dim CveCliente As Integer = RowReporte("CveCliente").ToString.ToEntero
|
||||||
|
Dim CveEmpresa As Integer = RowReporte("CveEmpresa").ToString.ToEntero
|
||||||
|
|
||||||
Dim DtExtras As DataTable = Nothing
|
Dim DtExtras As DataTable = Nothing
|
||||||
Dim DtDispositivos As DataTable = Nothing
|
Dim DtDispositivos As DataTable = Nothing
|
||||||
|
|
||||||
Dim Formato As String = RowReporte("Formato").ToString
|
Dim Formato As String = RowReporte("Formato").ToString
|
||||||
|
|
||||||
|
Dim UsuarioActual As Usuario = ValidaUsuarioSistema(CveEmpresa)
|
||||||
|
|
||||||
Dim ObjGPS As New ClsGPS
|
Dim ObjGPS As New ClsGPS
|
||||||
If CveReporte.Contiene(1, 2, 3, 4, 5, 6, 7, 8) Then
|
If CveReporte.Contiene(1, 2, 3, 4, 5, 6, 7, 8, 10) Then
|
||||||
If ObjGPS.ReportesProgramadosDispositivosGet(CveReporteProgramado) Then
|
If ObjGPS.ReportesProgramadosDispositivosGet(CveReporteProgramado) Then
|
||||||
DtDispositivos = ObjGPS.DtResultados.Copy()
|
DtDispositivos = ObjGPS.DtResultados.Copy()
|
||||||
End If
|
End If
|
||||||
@@ -286,7 +351,7 @@ Public Class ClsSisNotificaciones
|
|||||||
End If
|
End If
|
||||||
ObjGPS.Dispose()
|
ObjGPS.Dispose()
|
||||||
|
|
||||||
EnviarReporteProgramado(CveCliente, Formato, Correos, FechaI, FechaF, CveReporte, CveNotificacionBitacora, DtDispositivos, DtExtras)
|
EnviarReporteProgramado(CveCliente, NombreCliente, Formato, Correos, FechaI, FechaF, CveReporte, CveNotificacionBitacora, DtDispositivos, DtExtras, UsuarioActual)
|
||||||
|
|
||||||
If DtExtras IsNot Nothing Then
|
If DtExtras IsNot Nothing Then
|
||||||
DtExtras.Clear()
|
DtExtras.Clear()
|
||||||
@@ -297,6 +362,10 @@ Public Class ClsSisNotificaciones
|
|||||||
DtDispositivos.Clear()
|
DtDispositivos.Clear()
|
||||||
DtDispositivos.Dispose()
|
DtDispositivos.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual IsNot Nothing Then
|
||||||
|
UsuarioActual = Nothing
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al enviar el reporte programado", ex)
|
OnError("Ocurrió un error al enviar el reporte programado", ex)
|
||||||
@@ -311,11 +380,12 @@ Public Class ClsSisNotificaciones
|
|||||||
' Return New DataTable()
|
' Return New DataTable()
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
Public Sub EnviarReporteProgramado(CveCliente As Integer, Formato As String, Correos As String, FechaI As DateTime, FechaF As DateTime, CveReporte As Integer, CveNotificacionBitacora As Integer, DtDispositivos As DataTable, DtExtras As DataTable)
|
Public Sub EnviarReporteProgramado(CveCliente As Integer, NombreCliente As String, Formato As String, Correos As String, FechaI As DateTime, FechaF As DateTime, CveReporte As Integer, CveNotificacionBitacora As Integer, DtDispositivos As DataTable, DtExtras As DataTable, UsuarioActual As Usuario)
|
||||||
Dim CveDispositivo As Integer = -1
|
Dim CveDispositivo As Integer = -1
|
||||||
Dim NombreVehiculo As String = ""
|
Dim NombreVehiculo As String = ""
|
||||||
Dim RutaReporte As String
|
Dim RutaReporte As String
|
||||||
Dim retorno As Byte() = Nothing
|
Dim retorno As Byte() = Nothing
|
||||||
|
|
||||||
Select Case CveReporte
|
Select Case CveReporte
|
||||||
Case 1 'Ultima Posicion
|
Case 1 'Ultima Posicion
|
||||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||||
@@ -397,7 +467,7 @@ Public Class ClsSisNotificaciones
|
|||||||
GuardaLog(String.Format("Ocurrio un error al obtener las direcciones {0}", ex))
|
GuardaLog(String.Format("Ocurrio un error al obtener las direcciones {0}", ex))
|
||||||
End Try
|
End Try
|
||||||
If Formato = "PDF" Then
|
If Formato = "PDF" Then
|
||||||
retorno = GenerarReporteHistorico(ObjGPS.DtResultados, RutaReporte, FechaI, FechaF, Correos, NombreReporte)
|
retorno = GenerarReporteHistorico(ObjGPS.DtResultados, RutaReporte, FechaI, FechaF, Correos, NombreReporte, NombreCliente, UsuarioActual)
|
||||||
ElseIf Formato = "Excel" Then
|
ElseIf Formato = "Excel" Then
|
||||||
ObjGPS.DtResultados.TableName = NombreVehiculo
|
ObjGPS.DtResultados.TableName = NombreVehiculo
|
||||||
DataSource.Tables.Add(ObjGPS.DtResultados)
|
DataSource.Tables.Add(ObjGPS.DtResultados)
|
||||||
@@ -496,7 +566,7 @@ Public Class ClsSisNotificaciones
|
|||||||
Next
|
Next
|
||||||
Dim NombreArchivo As String = ""
|
Dim NombreArchivo As String = ""
|
||||||
If Formato = "Excel" Then
|
If Formato = "Excel" Then
|
||||||
retorno = GenerarReporteEventosExcel(ObjGPS.DtResultados, FechaI, FechaF, Correos)
|
retorno = GenerarReporteEventosExcel(DtDispositivos, ObjGPS.DtResultados, FechaI, FechaF, Correos)
|
||||||
NombreArchivo = "ReporteEventos.xlsx"
|
NombreArchivo = "ReporteEventos.xlsx"
|
||||||
ElseIf Formato = "PDF" Then
|
ElseIf Formato = "PDF" Then
|
||||||
retorno = GenerarReporteEventos(ObjGPS.DtResultados, RutaReporte, FechaI, FechaF, Correos)
|
retorno = GenerarReporteEventos(ObjGPS.DtResultados, RutaReporte, FechaI, FechaF, Correos)
|
||||||
@@ -729,6 +799,72 @@ Public Class ClsSisNotificaciones
|
|||||||
' End Try
|
' End Try
|
||||||
' ObjGPS.Dispose()
|
' ObjGPS.Dispose()
|
||||||
' End If
|
' End If
|
||||||
|
Case 10 'Reporte de Ignicion
|
||||||
|
Dim ObjGPS As New ClsGPS
|
||||||
|
Try
|
||||||
|
RutaReporte = $"{ModExtensiones.DirectorioBaseEmpresas}/Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc"
|
||||||
|
Dim ObjMail As New ClsSisMail()
|
||||||
|
Dim ResultadoMail As Integer = 0
|
||||||
|
Dim Archivos As New List(Of ClsSisMail.ArchivoMail)
|
||||||
|
Dim NombreReporte As String = "Reporte"
|
||||||
|
Dim DataSource As DataSet = Nothing
|
||||||
|
|
||||||
|
If Formato = "Excel" Then
|
||||||
|
DataSource = New DataSet()
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each RowDisp As DataRow In DtDispositivos.Rows
|
||||||
|
CveDispositivo = RowDisp("CveDispositivo").ToString().ToEntero
|
||||||
|
NombreVehiculo = RowDisp("NombreVehiculo").ToString()
|
||||||
|
NombreReporte = $"Reporte_Ignicion_{NombreVehiculo}_{FechaI.ToString("yyyy_MM_dd_HH_mm_ss")}_{ FechaF.ToString("yyyy_MM_dd_HH_mm_ss")}"
|
||||||
|
|
||||||
|
Dim DireccionesInicial As JArray = Nothing, DireccionesFinal As JArray = Nothing
|
||||||
|
|
||||||
|
If ObjGPS.GetRepIgnicion(CveDispositivo, FechaI, FechaF, CveCliente) Then
|
||||||
|
Try
|
||||||
|
DireccionesInicial = ConsultarDireccionesIgnicion(ObjGPS.DtResultados, "CveTramaEncendido", "LatitudInicial", "LongitudInicial")
|
||||||
|
DireccionesFinal = ConsultarDireccionesIgnicion(ObjGPS.DtResultados, "CveTramaApagado", "LatitudFinal", "LongitudFinal")
|
||||||
|
|
||||||
|
For Each Dir As JObject In DireccionesInicial
|
||||||
|
ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("DireccionInical") = Dir("Direccion").ToString()
|
||||||
|
Next
|
||||||
|
|
||||||
|
For Each Dir As JObject In DireccionesFinal
|
||||||
|
ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("DireccionFinal") = Dir("Direccion").ToString()
|
||||||
|
Next
|
||||||
|
Catch ex As Exception
|
||||||
|
GuardaLog(String.Format("Ocurrio un error al obtener las direcciones {0}", ex))
|
||||||
|
End Try
|
||||||
|
If Formato = "PDF" Then
|
||||||
|
retorno = GenerarReporteIgnicion(ObjGPS.DtResultados, RutaReporte, FechaI, FechaF, Correos, NombreReporte)
|
||||||
|
ElseIf Formato = "Excel" Then
|
||||||
|
ObjGPS.DtResultados.TableName = NombreVehiculo
|
||||||
|
DataSource.Tables.Add(ObjGPS.DtResultados)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If retorno IsNot Nothing Then
|
||||||
|
Archivos.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = retorno, .NombreArchivo = $"{NombreReporte}.pdf"})
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If DataSource IsNot Nothing Then
|
||||||
|
NombreReporte = $"Reporte_Ignicion_{FechaI.ToString("yyyy_MM_dd_HH_mm_ss")}_{ FechaF.ToString("yyyy_MM_dd_HH_mm_ss")}"
|
||||||
|
retorno = GenerarReporteIgnicionExcel(DataSource, RutaReporte, FechaI, FechaF, Correos, NombreReporte)
|
||||||
|
If retorno IsNot Nothing Then
|
||||||
|
Archivos.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = retorno, .NombreArchivo = $"{NombreReporte}.xlsx"})
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Archivos.Count > 0 Then
|
||||||
|
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", $"Se adjunta el {Formato} en el Reporte Programado.", "", Archivos) Then
|
||||||
|
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||||
|
End Try
|
||||||
|
ObjGPS.Dispose()
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -785,10 +921,15 @@ Public Class ClsSisNotificaciones
|
|||||||
|
|
||||||
Return Retorno.ToArray()
|
Return Retorno.ToArray()
|
||||||
End Function
|
End Function
|
||||||
Private Function GenerarReporteHistorico(DataSource As DataTable, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String, NombreReporte As String) As Byte()
|
Private Function GenerarReporteHistorico(DataSource As DataTable, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String, NombreReporte As String, NombreCliente As String, UsuarioActual As Usuario) As Byte()
|
||||||
Dim Retorno As Byte() = Nothing
|
Dim Retorno As Byte() = Nothing
|
||||||
Try
|
Try
|
||||||
Dim RptParametro As New List(Of CrystalParametro)
|
Dim RptParametro As New List(Of CrystalParametro)
|
||||||
|
|
||||||
|
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||||
|
|
||||||
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
|
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
|
||||||
RptParametro.Add(New CrystalParametro("FechaFin", FechaF.ToString))
|
RptParametro.Add(New CrystalParametro("FechaFin", FechaF.ToString))
|
||||||
RptParametro.Add(New CrystalParametro("UsuarioImprimio", Correos))
|
RptParametro.Add(New CrystalParametro("UsuarioImprimio", Correos))
|
||||||
@@ -798,6 +939,15 @@ Public Class ClsSisNotificaciones
|
|||||||
Else
|
Else
|
||||||
RptParametro.Add(New CrystalParametro("KMRecorridos", "0 KM"))
|
RptParametro.Add(New CrystalParametro("KMRecorridos", "0 KM"))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
RptParametro.Add(New CrystalParametro("NombreEmpresa", NombreCliente))
|
||||||
|
|
||||||
|
If Imagen.Exists Then
|
||||||
|
RptParametro.Add(New CrystalParametro("LogoPath", logouri))
|
||||||
|
Else
|
||||||
|
RptParametro.Add(New CrystalParametro("LogoPath", ""))
|
||||||
|
End If
|
||||||
|
|
||||||
Retorno = StreamPDFCrystal(Liga, DataSource, RptParametro, NombreReporte, "PDF")
|
Retorno = StreamPDFCrystal(Liga, DataSource, RptParametro, NombreReporte, "PDF")
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||||
@@ -856,6 +1006,81 @@ Public Class ClsSisNotificaciones
|
|||||||
End If
|
End If
|
||||||
Return Retorno.ToArray()
|
Return Retorno.ToArray()
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function GenerarReporteIgnicion(DataSource As DataTable, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String, NombreReporte As String) As Byte()
|
||||||
|
Dim Retorno As Byte() = Nothing
|
||||||
|
Try
|
||||||
|
Dim RptParametro As New List(Of ReportParameter)
|
||||||
|
|
||||||
|
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToString))
|
||||||
|
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
|
||||||
|
RptParametro.Add(New ReportParameter("UsuarioImprimio", Correos))
|
||||||
|
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
||||||
|
|
||||||
|
Retorno = StreamPDF(Liga, DataSource, RptParametro, "ReporteIgnicion", "PDF", MR:=Nothing, RDSName:="DsOC")
|
||||||
|
Catch ex As Exception
|
||||||
|
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function GenerarReporteIgnicionExcel(DataSource As DataSet, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String, NombreReporte As String) As Byte()
|
||||||
|
Dim Retorno As New MemoryStream()
|
||||||
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
|
|
||||||
|
Dim FileExcel As ExcelFile = New ExcelFile
|
||||||
|
For Each Dt As DataTable In DataSource.Tables
|
||||||
|
|
||||||
|
Dt.Columns.Remove("CveDispositivo")
|
||||||
|
Dt.Columns.Remove("CveTramaEncendido")
|
||||||
|
Dt.Columns.Remove("CveTramaApagado")
|
||||||
|
|
||||||
|
Dt.Columns("Vehiculo").SetOrdinal(0)
|
||||||
|
Dt.Columns("Vehiculo").ColumnName = "Vehículo"
|
||||||
|
|
||||||
|
Dt.Columns("VMedia").ColumnName = "Velocidad Media"
|
||||||
|
Dt.Columns("VMax").ColumnName = "Velocidad Maxima"
|
||||||
|
|
||||||
|
Dt.Columns("FechaEncendido").ColumnName = "Fecha Encendido"
|
||||||
|
Dt.Columns("FechaApagado").ColumnName = "Fecha Apagado"
|
||||||
|
Dt.Columns("LatitudInicial").ColumnName = "Latitud Inicial"
|
||||||
|
Dt.Columns("LatitudFinal").ColumnName = "Latitud Final"
|
||||||
|
|
||||||
|
Dt.Columns("LongitudInicial").ColumnName = "Longitud Inicial"
|
||||||
|
Dt.Columns("LongitudFinal").ColumnName = "Longitud Final"
|
||||||
|
|
||||||
|
Dt.Columns("Duracion").ColumnName = "Duración"
|
||||||
|
|
||||||
|
Dt.Columns("DireccionInical").SetOrdinal(Dt.Columns.Count - 1)
|
||||||
|
Dt.Columns("DireccionInical").ColumnName = "Dirección Inicial"
|
||||||
|
|
||||||
|
Dt.Columns("DireccionFinal").SetOrdinal(Dt.Columns.Count - 1)
|
||||||
|
Dt.Columns("DireccionFinal").ColumnName = "Dirección Final"
|
||||||
|
|
||||||
|
Dim item = FileExcel.Worksheets.Add(Dt.TableName)
|
||||||
|
item.InsertDataTable(Dt, New InsertDataTableOptions() With
|
||||||
|
{
|
||||||
|
.ColumnHeaders = True,
|
||||||
|
.StartRow = 0,
|
||||||
|
.StartColumn = 0
|
||||||
|
})
|
||||||
|
item.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
|
||||||
|
item.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
|
||||||
|
|
||||||
|
Dim columnCount = item.CalculateMaxUsedColumns()
|
||||||
|
For i = 0 To columnCount
|
||||||
|
item.Columns(i).AutoFit(1, item.Rows(i), item.Rows(item.Rows.Count - 1))
|
||||||
|
Next
|
||||||
|
|
||||||
|
Next
|
||||||
|
FileExcel.Save(Retorno, SaveOptions.XlsxDefault)
|
||||||
|
If DataSet IsNot Nothing Then
|
||||||
|
DataSet.Clear()
|
||||||
|
DataSet.Dispose()
|
||||||
|
End If
|
||||||
|
Return Retorno.ToArray()
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function GenerarReporteTiempoMuerto(DataSource As DataTable, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String, NombreReporte As String) As Byte()
|
Private Function GenerarReporteTiempoMuerto(DataSource As DataTable, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String, NombreReporte As String) As Byte()
|
||||||
Dim Retorno As Byte() = Nothing
|
Dim Retorno As Byte() = Nothing
|
||||||
Try
|
Try
|
||||||
@@ -953,7 +1178,7 @@ Public Class ClsSisNotificaciones
|
|||||||
End Function
|
End Function
|
||||||
Private Function GenerarReporteEventos(DataSource As DataTable, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String) As Byte()
|
Private Function GenerarReporteEventos(DataSource As DataTable, Liga As String, FechaI As DateTime, FechaF As DateTime, Correos As String) As Byte()
|
||||||
Dim Retorno As Byte() = Nothing
|
Dim Retorno As Byte() = Nothing
|
||||||
If DataSource IsNot Nothing AndAlso DataSource.Rows.Count > 0 Then
|
If DataSource IsNot Nothing Then
|
||||||
Try
|
Try
|
||||||
Dim RptParametro As New List(Of CrystalParametro)
|
Dim RptParametro As New List(Of CrystalParametro)
|
||||||
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
|
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
|
||||||
@@ -970,15 +1195,16 @@ Public Class ClsSisNotificaciones
|
|||||||
End If
|
End If
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Private Function GenerarReporteEventosExcel(DataSource As DataTable, FechaI As DateTime, FechaF As DateTime, Correos As String) As Byte()
|
Private Function GenerarReporteEventosExcel(DtDispositivos As DataTable, DataSource As DataTable, FechaI As DateTime, FechaF As DateTime, Correos As String) As Byte()
|
||||||
Dim Retorno As New MemoryStream()
|
Dim Retorno As New MemoryStream()
|
||||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
|
|
||||||
Dim FileExcel As ExcelFile = New ExcelFile
|
Dim FileExcel As ExcelFile = New ExcelFile
|
||||||
Dim DtDispositivos As DataTable = DataSource.FiltraParametros("", "", {"CveDispositivo", "Unidad"})
|
'Dim DtDispositivos As DataTable = DataSource.FiltraParametros("", "", {"CveDispositivo", "Unidad"})
|
||||||
|
|
||||||
For Each Dr As DataRow In DtDispositivos.Rows
|
For Each Dr As DataRow In DtDispositivos.Rows
|
||||||
Dim CveDispositivo As Integer = Dr("CveDispositivo").ToString().ToEntero()
|
Dim CveDispositivo As Integer = Dr("CveDispositivo").ToString().ToEntero()
|
||||||
Dim NombreVehiculo = Dr("Unidad").ToString()
|
Dim NombreVehiculo = Dr("NombreVehiculo").ToString()
|
||||||
Dim FilterRows = DataSource.FiltraParametros($"CveDispositivo = {CveDispositivo}")
|
Dim FilterRows = DataSource.FiltraParametros($"CveDispositivo = {CveDispositivo}")
|
||||||
|
|
||||||
Dim Dt = GenerarDTEventos(NombreVehiculo, FilterRows)
|
Dim Dt = GenerarDTEventos(NombreVehiculo, FilterRows)
|
||||||
@@ -1209,6 +1435,7 @@ Public Class ClsSisNotificaciones
|
|||||||
dt.Columns.Add("Conductor", Type.GetType("System.String"))
|
dt.Columns.Add("Conductor", Type.GetType("System.String"))
|
||||||
dt.Columns.Add("Dirección", Type.GetType("System.String"))
|
dt.Columns.Add("Dirección", Type.GetType("System.String"))
|
||||||
|
|
||||||
|
If rows IsNot Nothing Then
|
||||||
For Each Row As DataRow In rows.Rows
|
For Each Row As DataRow In rows.Rows
|
||||||
Dim dr = dt.NewRow()
|
Dim dr = dt.NewRow()
|
||||||
dr("Vehículo") = Row("Unidad").ToString()
|
dr("Vehículo") = Row("Unidad").ToString()
|
||||||
@@ -1221,6 +1448,8 @@ Public Class ClsSisNotificaciones
|
|||||||
|
|
||||||
dt.Rows.Add(dr)
|
dt.Rows.Add(dr)
|
||||||
Next
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
Return dt
|
Return dt
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
@@ -2059,6 +2288,41 @@ Public Class ClsSisNotificaciones
|
|||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function ConsultarDireccionesIgnicion(Dt As DataTable, StrCveTrama As String, StrLatitud As String, StrLongitud As String) As JArray
|
||||||
|
Dim retorno As JArray = Nothing
|
||||||
|
Dim posicionesArray = New JArray(From Row As DataRow In Dt
|
||||||
|
Let index = Dt.Rows().IndexOf(Row)
|
||||||
|
Select New JObject(
|
||||||
|
New JProperty("indice", index),
|
||||||
|
New JProperty("cveTrama", Row(StrCveTrama).ToString.ToEntero),
|
||||||
|
New JProperty("lat", Row(StrLatitud).ToString.ToDouble),
|
||||||
|
New JProperty("lon", Row(StrLongitud).ToString.ToDouble)
|
||||||
|
))
|
||||||
|
|
||||||
|
Dim Base64array = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(posicionesArray.ToString()))
|
||||||
|
|
||||||
|
Using wc As New HttpClient()
|
||||||
|
Try
|
||||||
|
Dim Url = New Uri(String.Format("{0}nominatim/reverseMultiple.php", ClsPaginas.UrlDirecciones))
|
||||||
|
Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||||
|
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||||
|
Dim response = wc.PostAsync(Url, content).Result
|
||||||
|
Dim result = response.Content.ReadAsStringAsync().Result
|
||||||
|
retorno = JArray.Parse(result)
|
||||||
|
response.Dispose()
|
||||||
|
content = Nothing
|
||||||
|
Url = Nothing
|
||||||
|
FormStuff = Nothing
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||||
|
End Try
|
||||||
|
End Using
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Region " IDisposable Support "
|
#Region " IDisposable Support "
|
||||||
' IDisposable
|
' IDisposable
|
||||||
Protected Overridable Sub Dispose(disposing As Boolean)
|
Protected Overridable Sub Dispose(disposing As Boolean)
|
||||||
|
|||||||
@@ -2086,7 +2086,7 @@ Namespace Extensiones
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Sub ExportToExcelGembox(GridView As GridView, NombreArchivoXLSx As String, Usuario As Usuario, FechaIMes As String, FechaFMes As String, Titulo As String, SubProyecto As String, Divisor As Integer, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional DatoTituloExtra As String = "")
|
Public Sub ExportToExcelGembox(GridView As GridView, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional DatoTituloExtra As String = "", Optional DatosFiltros As String = "", Optional AnchoImagen As Integer = 100, Optional AlturaImagen As Integer = 100)
|
||||||
|
|
||||||
Dim sw1 As New StringWriter()
|
Dim sw1 As New StringWriter()
|
||||||
Dim htw1 As New HtmlTextWriter(sw1)
|
Dim htw1 As New HtmlTextWriter(sw1)
|
||||||
@@ -2117,7 +2117,7 @@ Namespace Extensiones
|
|||||||
|
|
||||||
If Usuario IsNot Nothing Then
|
If Usuario IsNot Nothing Then
|
||||||
|
|
||||||
Dim TotalRowHeader As Integer = 8
|
Dim TotalRowHeader As Integer = 6
|
||||||
Dim TotalRowFooter As Integer = 2
|
Dim TotalRowFooter As Integer = 2
|
||||||
|
|
||||||
|
|
||||||
@@ -2143,50 +2143,44 @@ Namespace Extensiones
|
|||||||
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||||
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||||
|
|
||||||
|
|
||||||
If FechaIMes.Trim.Length > 0 And FechaFMes.Trim.Length > 0 Then
|
|
||||||
Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex)
|
|
||||||
RangoFechas.Merged = True
|
|
||||||
RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}"
|
|
||||||
RangoFechas.Style.Font.Size = 15 * 20
|
|
||||||
RangoFechas.Style.Font.Name = "Calibri Light"
|
|
||||||
RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
|
||||||
RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If SubProyecto.Length > 0 Then
|
|
||||||
Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex)
|
|
||||||
RangoSubProyecto.Merged = True
|
|
||||||
RangoSubProyecto.Value = SubProyecto
|
|
||||||
RangoSubProyecto.Style.Font.Size = 20 * 20
|
|
||||||
RangoSubProyecto.Style.Font.Name = "Calibri Light"
|
|
||||||
RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
|
||||||
RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If DatoTituloExtra.Length > 0 Then
|
If DatoTituloExtra.Length > 0 Then
|
||||||
Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
|
Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
|
||||||
RangoDatoTituloExtra.Merged = True
|
RangoDatoTituloExtra.Merged = True
|
||||||
RangoDatoTituloExtra.Value = DatoTituloExtra
|
RangoDatoTituloExtra.Value = DatoTituloExtra
|
||||||
RangoDatoTituloExtra.Style.Font.Size = 20 * 20
|
RangoDatoTituloExtra.Style.Font.Size = 20 * 20
|
||||||
RangoDatoTituloExtra.Style.Font.Name = "Calibri Light"
|
RangoDatoTituloExtra.Style.Font.Name = "Calibri Light"
|
||||||
RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
|
||||||
RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If DatosFiltros.Length > 0 Then
|
||||||
|
|
||||||
|
Dim Arreglo As String() = DatosFiltros.Split("|"c)
|
||||||
|
worksheet.Rows.InsertEmpty(TotalRowHeader, Arreglo.Count)
|
||||||
|
For Each TextoFiltro As String In Arreglo
|
||||||
|
Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
|
||||||
|
RangoDatoTituloExtra.Merged = True
|
||||||
|
RangoDatoTituloExtra.Value = TextoFiltro
|
||||||
|
RangoDatoTituloExtra.Style.Font.Size = 12 * 20
|
||||||
|
RangoDatoTituloExtra.Style.Font.Name = "Calibri Light"
|
||||||
|
RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
|
||||||
|
RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||||
|
TotalRowHeader += 1
|
||||||
|
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
TotalRowHeader += 2
|
||||||
|
|
||||||
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
|
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
|
||||||
|
|
||||||
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
|
worksheet.Rows(TotalRowHeader).Cells(i).Style.Font.Size = 12 * 20
|
||||||
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
worksheet.Rows(TotalRowHeader).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
|
||||||
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
worksheet.Rows(TotalRowHeader).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
|
||||||
|
|
||||||
worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
|
|
||||||
worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
|
|
||||||
|
|
||||||
|
|
||||||
|
worksheet.Rows(TotalRowHeader).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
|
||||||
|
worksheet.Rows(TotalRowHeader).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
|
||||||
|
|
||||||
If i > 0 Then
|
If i > 0 Then
|
||||||
Try
|
Try
|
||||||
@@ -2221,7 +2215,7 @@ Namespace Extensiones
|
|||||||
|
|
||||||
If I > 0 Then
|
If I > 0 Then
|
||||||
|
|
||||||
If Divisor = 1 Then
|
If 1 = 1 Then
|
||||||
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
|
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
|
||||||
Else
|
Else
|
||||||
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
|
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
|
||||||
|
|||||||
@@ -77,15 +77,6 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
URLParametros = Parametros(context.Request("var"))
|
URLParametros = Parametros(context.Request("var"))
|
||||||
metodo = URLParametros("metodo")
|
metodo = URLParametros("metodo")
|
||||||
'SI TRAE UN JSON COMO PARAMETRO
|
'SI TRAE UN JSON COMO PARAMETRO
|
||||||
ElseIf context.Request.Headers("Content-Type") IsNot Nothing AndAlso context.Request.Headers("Content-Type").Contains("json") AndAlso context.Request.InputStream IsNot Nothing AndAlso (context.Request("var") Is Nothing AndAlso context.Request("metodo") IsNot Nothing) Then
|
|
||||||
context.Response.ContentType = "application/json"
|
|
||||||
Using reader As New StreamReader(context.Request.InputStream)
|
|
||||||
Dim json = reader.ReadToEnd()
|
|
||||||
Dim JsonRequest As JObject = JObject.Parse(json)
|
|
||||||
If JsonRequest IsNot Nothing Then
|
|
||||||
metodo = JsonRequest("Metodo").ToString
|
|
||||||
End If
|
|
||||||
End Using
|
|
||||||
ElseIf context.Request("metodo") IsNot Nothing Then
|
ElseIf context.Request("metodo") IsNot Nothing Then
|
||||||
metodo = context.Request("metodo").ToString()
|
metodo = context.Request("metodo").ToString()
|
||||||
If context.Request("FechaEnvio") IsNot Nothing Then
|
If context.Request("FechaEnvio") IsNot Nothing Then
|
||||||
@@ -422,7 +413,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
Dim CveVendedor As Integer = -1
|
Dim CveVendedor As Integer = -1
|
||||||
Dim Grupo As Integer = 5
|
Dim Grupo As Integer = 5
|
||||||
Dim TipoCambio As Integer = 1
|
Dim TipoCambio As Integer = 1
|
||||||
Dim TipoDocto As String = "-1"
|
Dim TipoDocto As String = "Ing"
|
||||||
Dim FechaCorte As DateTime = New DateTime(Now.Year, 12, 31)
|
Dim FechaCorte As DateTime = New DateTime(Now.Year, 12, 31)
|
||||||
|
|
||||||
If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte,
|
If ObjMov.GetCxC(FechaI, FechaF, CveCliente, CveSubProyecto, CveVendedor, -1, -1, "-1", UsuarioActual.CveEmpresa, Grupo, -1, TipoCambio, TCEspecifico, TipoDocto, FechaVI, FechaVF, FechaCorte:=FechaCorte,
|
||||||
@@ -436,7 +427,8 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
|
|
||||||
If DTClientes IsNot Nothing OrElse EnviarPendientes Then
|
If DTClientes IsNot Nothing OrElse EnviarPendientes Then
|
||||||
|
|
||||||
'DTClientes = DTClientes.FiltraParametros("CveCliente IN (227289,227429,227733,227838,228181,228544,229176,229481,230029,230432,230860,230911,230918,231197,231576,232173,232185,233055,233295,233357,233588,236379,236460,237161,237635,238285,238530,238622,238724,239033,239099,239865,239895,239903,240202,240235,240236,240238,240303,240340,262404,262517,264765,264806,264825,264848,264930,265063,265180,265213,265214,265236,265344,265492,265555,265669,265797,265952,265963,266156,266182,268346,268396,268488,268535,268539,268558,268562,268706,268726,268787,268868,268889,268910,268925,269023,269081,269089,272066,272070,272657,273080,273084,275627,276259,276587,281115,283110,284664,285392,287653,288711,291374,292444,295578,296375,296598,302728,303936,306897,307183,311007,320060,320685,320800,323520,323772,325237,326996,327801,330630,331741,332118,337105,340502,341796,342807,343858,355862,358123,365794,371524,375391,377122,377948,378267,380167,381210,381878,383098,383250,383339,383650,384472,385321,385585,386630,387114,388987,396341,396405,396541,401995,404175,408306,416386,416819,420275,438732,447566,447636,450284,464150,464376,468051,475172,475932,476984,477997,478426)")
|
DTClientes = DTClientes.FiltraParametros("CveCliente NOT IN (228080,228565,228910,233126,231465,232730,232697,227338)")
|
||||||
|
|
||||||
Dim DtNotificaciones As DataTable = Nothing
|
Dim DtNotificaciones As DataTable = Nothing
|
||||||
|
|
||||||
Dim TieneErrorRegistro As Boolean = False
|
Dim TieneErrorRegistro As Boolean = False
|
||||||
@@ -478,7 +470,10 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjMovimientos.Dispose()
|
ObjMovimientos.Dispose()
|
||||||
|
|
||||||
|
If DTClientes IsNot Nothing Then
|
||||||
DTClientes.Dispose()
|
DTClientes.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
If DtNotificaciones IsNot Nothing Then
|
If DtNotificaciones IsNot Nothing Then
|
||||||
@@ -557,7 +552,7 @@ Public Class TareasProgramadas : Implements IHttpHandler
|
|||||||
Dim ContaAnt As Integer = 0
|
Dim ContaAnt As Integer = 0
|
||||||
Dim FechaCorte As Date = ("9999/01/01").ToDate
|
Dim FechaCorte As Date = ("9999/01/01").ToDate
|
||||||
|
|
||||||
Dim TipoDocto2 As String = "'Ing','NC','Dev'"
|
Dim TipoDocto2 As String = "'Ing'"
|
||||||
Dim FechaVencimientoI As String = "-1"
|
Dim FechaVencimientoI As String = "-1"
|
||||||
Dim FechaVencimientoF As String = "-1"
|
Dim FechaVencimientoF As String = "-1"
|
||||||
Dim FI As String = "-1"
|
Dim FI As String = "-1"
|
||||||
|
|||||||
@@ -567,7 +567,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SumaValores() {
|
function SumaValores(aplicaTC) {
|
||||||
|
|
||||||
var Importe = 0;
|
var Importe = 0;
|
||||||
var Comision = 0.00;
|
var Comision = 0.00;
|
||||||
@@ -581,7 +581,13 @@
|
|||||||
if (textBoxes[i].value != '') {
|
if (textBoxes[i].value != '') {
|
||||||
idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', '');
|
idd = textBoxes[i].id.replace('C_GvCxP_TxtAbonar_', '');
|
||||||
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText;
|
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_GvCxP_HplF_" + idd).innerText;
|
||||||
Importe = parseFloat(Importe) + parseFloat(textBoxes[i].value.split(',').join(''));
|
let importeFactura = 0;
|
||||||
|
if (aplicaTC && $get('TxtTC') != null) {
|
||||||
|
importeFactura = parseFloat(FormatoNumero(parseFloat(textBoxes[i].value.split(',').join('')) * parseFloat($get('TxtTC').value), 2).split(',').join(''));
|
||||||
|
} else {
|
||||||
|
importeFactura = parseFloat(textBoxes[i].value.split(',').join(''));
|
||||||
|
}
|
||||||
|
Importe = parseFloat(Importe) + importeFactura;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (textBoxes[i].id.indexOf('C_GvCxP_TxtComision') >= 0) {
|
if (textBoxes[i].id.indexOf('C_GvCxP_TxtComision') >= 0) {
|
||||||
@@ -641,13 +647,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function CambiaPesosDolares() {
|
function CambiaPesosDolares() {
|
||||||
$get('TxtImporte').value = FormatoNumero(SumaValores(), 2);
|
let ImporteDolares = SumaValores(true);
|
||||||
$('#LtlTotalMXN').text(FormatoNumero(SumaValores(), 2))
|
|
||||||
|
$get('TxtImporte').value = FormatoNumero(ImporteDolares, 2);
|
||||||
|
$('#LtlTotalMXN').text(FormatoNumero(ImporteDolares, 2))
|
||||||
|
|
||||||
if ($("#LbImporteME").length) {
|
if ($("#LbImporteME").length) {
|
||||||
$get('LbImporteME').innerHTML = '$ ' + $get('TxtImporte').value + ' USD';
|
$get('LbImporteME').innerHTML = '$ ' + FormatoNumero(SumaValores(false),2) + ' USD';
|
||||||
$get('TxtImporte').value = FormatoNumero(ToDouble($get('TxtImporte').value.replace(',', '')) * ToDouble($get('TxtTC').value), 2);
|
$get('TxtImporte').value = FormatoNumero(ToDouble(ImporteDolares), 2);
|
||||||
$get('LtlTotalMXN').value = FormatoNumero(ToDouble($get('TxtImporte').value) * ToDouble($get('TxtTC').value), 2);
|
$get('LtlTotalMXN').value = FormatoNumero(ToDouble(ImporteDolares), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($get('TxtTotal') != null) {
|
if ($get('TxtTotal') != null) {
|
||||||
|
|||||||
@@ -187,6 +187,14 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Ir5(CveCompra,FolioCompra) {
|
||||||
|
window.opener.CargaVinculacionTraslado(CveCompra, FolioCompra);
|
||||||
|
window.close();
|
||||||
|
parent.$('#ajax').modal('hide');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//$(document).ready(function () {
|
//$(document).ready(function () {
|
||||||
// $("#TxtFolioFiscal").mask("********-****-****-****-************");
|
// $("#TxtFolioFiscal").mask("********-****-****-****-************");
|
||||||
//});
|
//});
|
||||||
|
|||||||
@@ -11,6 +11,15 @@ Partial Class Compras_PopUpBuscarFolioC
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property Opcion As String
|
||||||
|
Get
|
||||||
|
Return ViewState("Opcion").ToString
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("Opcion") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||||
@@ -24,9 +33,15 @@ Partial Class Compras_PopUpBuscarFolioC
|
|||||||
|
|
||||||
If Request("Opt") = "Fact" Then
|
If Request("Opt") = "Fact" Then
|
||||||
ViewState("Opt") = "MandaCveCompra"
|
ViewState("Opt") = "MandaCveCompra"
|
||||||
|
|
||||||
|
ElseIf Request("Opt") = "ComplementosTraslado" Then
|
||||||
|
ViewState("Opt") = "ComplementosTraslado"
|
||||||
Else
|
Else
|
||||||
ViewState("Opt") = "RecargaCompra"
|
ViewState("Opt") = "RecargaCompra"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -91,6 +106,8 @@ Partial Class Compras_PopUpBuscarFolioC
|
|||||||
Liga = String.Format("<a class='Texto' href='javascript:Ir3(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
Liga = String.Format("<a class='Texto' href='javascript:Ir3(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
||||||
Case "FactFlete"
|
Case "FactFlete"
|
||||||
Liga = String.Format("<a class='Texto' href='javascript:Ir4(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
Liga = String.Format("<a class='Texto' href='javascript:Ir4(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
||||||
|
Case "ComplementosTraslado"
|
||||||
|
Liga = String.Format("<a class='Texto' href='javascript:Ir5(""{0}"",""{1}"");'>", e.Row.DBCampo("CveCompra"), e.Row.DBCampo("SerieFolio"))
|
||||||
Case Else
|
Case Else
|
||||||
Liga = String.Format("<a class='Texto' href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
Liga = String.Format("<a class='Texto' href='javascript:Ir(""{0}"");'>", e.Row.DBCampo("CveCompra"))
|
||||||
End Select
|
End Select
|
||||||
|
|||||||
@@ -393,7 +393,7 @@
|
|||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
<ItemStyle HorizontalAlign="Center" />
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="PDF">
|
<asp:TemplateField HeaderText="PDF" >
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="LnkRegenerarPdf" OnClick="LnkRegenerarPdfnew_Click" CssClass="btn btn-circle btn-sm blue" runat="server"><i class="fa fa-refresh" aria-hidden="true"></i></asp:LinkButton>
|
<asp:LinkButton ID="LnkRegenerarPdf" OnClick="LnkRegenerarPdfnew_Click" CssClass="btn btn-circle btn-sm blue" runat="server"><i class="fa fa-refresh" aria-hidden="true"></i></asp:LinkButton>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
@@ -409,6 +409,124 @@
|
|||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
|
|
||||||
|
<ajax:TabPanel ID="TabTraslados" runat="server" HeaderText="Traslados">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:UpdatePanel runat="server" ID="UpTraslados" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table cellpadding="0" border="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<th style="text-align: left;">
|
||||||
|
<asp:Label ID="LblTotalTraslados" runat="server" Text="Pagos" Font-Bold="True"></asp:Label></th>
|
||||||
|
<th style="text-align: right">
|
||||||
|
<%--<asp:LinkButton ID="LinkButton2" CssClass="Texto" runat="server">No Recibidas</asp:LinkButton>--%>
|
||||||
|
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<asp:GridView ID="GvTraslados" runat="server" Width="100%" AutoGenerateColumns="False" DataKeyNames="CveFactura,CveCompra,CveProveedor,SerieFolio,NombreProveedor,UUID,RFCDe,RFCPara,TipoFactura,FueValidado,TipoComprobante,Version,RFCde,XML,CveComplementoTraslado,PDF,SerieFolioVinculado,CveCompraTraslado"
|
||||||
|
EmptyDataText="No se encontraron Registros con el filtro actual" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField HeaderText="Tipo">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LtTipoComprobante" runat="server" Text='<%# Eval("TipoComprobante") %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Folio">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlFolio" runat="server" Text='<%# Eval("SerieFolio") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Fecha Fact">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlFechaFactura" runat="server" Text='<%# Eval("FechaFactura", "{0:d}") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Proveedor">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:HyperLink ID="HplProveedor" runat="server" CssClass="Texto" Target="_blank" rel="opener" Text='<%# Eval("NombreProveedor") %>'></asp:HyperLink>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Left" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Importe">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Right" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="XML">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlXML" runat="server"></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="PDF">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlPDF" runat="server"></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Prov">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:HyperLink ID="HplProv" runat="server" Visible='False' CssClass="btn btn-circle btn-sm blue" ToolTip="Agregar Proveedor" rel="opener" Target="_blank"><i class="fa fa-pencil"></i></asp:HyperLink>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Estatus SAT">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlValidado" runat="server" Text="Validada" Visible="false"></asp:Literal>
|
||||||
|
<asp:LinkButton ID="ImgValidarCFDi" runat="server" CssClass="btn btn-xs btn-success" Text="Validar" Visible="false" CommandName="ValidarCFDi" CommandArgument='<%# Eval("CveFactura") %>' />
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Agregar">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:HyperLink ID="HplAgregarT" runat="server" CssClass="btn btn-circle btn-sm green" Visible='<%# Eval("CveProveedor").ToString <> "" %>' data-toggle="tooltip" title="Agregar Factura" Target="_blank" rel="opener"><i class="fa fa-plus"></i></asp:HyperLink>
|
||||||
|
<asp:LinkButton ID="LnkAgregarTraslado" runat="server" OnClick="LnkAgregarTraslado_Click" CssClass="btn btn-sm blue" Visible="false" data-toggle="tooltip" ></asp:LinkButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="imgDP" runat="server" OnClick="imgDP_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-minus'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar esta factura?" data-btn-ok-label="si" />
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<div>
|
||||||
|
<asp:LinkButton ID="LnkOP" runat="server" AlternateText="Omitir" ToolTip="Omitir Factura" CommandArgument='<%# Eval("CveFactura") %>' Visible='<%# Eval("CveCompra").ToString = "" AndAlso Eval("CveFactura").ToString <> "" AndAlso Eval("FueValidado").ToString <> "3" %>'
|
||||||
|
CssClass="btn btn-circle btn-sm grey-cascade" CausesValidation="False" CommandName="Omitir" OnClientClick="javascript:return confirm('¿Está seguro que desea omitir la factura?');">
|
||||||
|
<i class='fa fa-eye-slash fa-2x'></i>
|
||||||
|
</asp:LinkButton>
|
||||||
|
</div>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="PDF" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkRegenerarPdf" CssClass="btn btn-circle btn-sm blue" runat="server"><i class="fa fa-refresh" aria-hidden="true"></i></asp:LinkButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
<HeaderStyle CssClass="Titulos" />
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</ContentTemplate>
|
||||||
|
</ajax:TabPanel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ajax:TabContainer>
|
</ajax:TabContainer>
|
||||||
|
|
||||||
|
|
||||||
@@ -776,6 +894,59 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="DvModalVincularTrasaldo" class="modal ADS fade" role="dialog">
|
||||||
|
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalVincularTraslado" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title" id="H2" runat="server"><asp:Literal runat="server" ID="LtlModalVincularTrasaldoTitulo">Agregar</asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row" runat="server" id="DvMomdalVincualarTrasladoBusqueda">
|
||||||
|
<div class="col-md-12" style="text-align:center">
|
||||||
|
<a onclick="javascript:AbrirVentana('/Compras/PopUpBuscarFolioC.aspx?Opt=ComplementosTraslado');" class="texto" ><i class="fa fa-search" aria-hidden="true"></i> Buscar Compra</a>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" runat="server" id="DvModalVincularTrasladoVinculado" visible="false">
|
||||||
|
|
||||||
|
<div class="col-md-6" style="text-align:right">
|
||||||
|
<strong>Folio Compra:</strong>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6" style="text-align:left">
|
||||||
|
<strong><asp:HyperLink runat="server" ID="LnkModalModalVincularTrasaldoFolio" target="_blanc"></asp:HyperLink></strong>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<asp:HiddenField runat="server" ID="HdnCveCompraComplementoTraslado" ClientIDMode="Static" Value="-1" />
|
||||||
|
<asp:HiddenField runat="server" ID="HdnFolioCompraComplementoTraslado" ClientIDMode="Static" Value="-1" />
|
||||||
|
|
||||||
|
|
||||||
|
<asp:Button runat="server" ClientIDMode="Static" ID="BtnCargaCompraComplementoTraslado" OnClick="BtnCargaCompraComplementoTraslado_Click" Style="display: none;" class="btn btn-primary" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:LinkButton ID="LnkVincularTraslado" runat="server" CssClass="btn btn-primary" Visible="false" OnClick="LnkVincularTraslado_Click" >Guardar</asp:LinkButton>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -785,6 +956,15 @@
|
|||||||
$('#BtnVincularManualmente').click();
|
$('#BtnVincularManualmente').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CargaVinculacionTraslado(CveCompra, FolioCompra) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#HdnCveCompraComplementoTraslado').val(CveCompra);
|
||||||
|
$('#HdnFolioCompraComplementoTraslado').val(FolioCompra ) ;
|
||||||
|
$('#BtnCargaCompraComplementoTraslado').click();
|
||||||
|
}
|
||||||
|
|
||||||
//function VinculacionManual(v) {
|
//function VinculacionManual(v) {
|
||||||
// $get("HdnCveIE").value = v;
|
// $get("HdnCveIE").value = v;
|
||||||
// $('#BtnVincularManualmente').click();
|
// $('#BtnVincularManualmente').click();
|
||||||
|
|||||||
@@ -668,6 +668,20 @@ Partial Class Compras_eFacturas
|
|||||||
|
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property CveFacturaComplementoTraslado As Integer
|
||||||
|
Get
|
||||||
|
If ViewState("CveFacturaComplementoTraslado") Is Nothing Then
|
||||||
|
Return -1
|
||||||
|
Else
|
||||||
|
Return ViewState("CveFacturaComplementoTraslado").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveFacturaComplementoTraslado") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Property ComprasEnComplemento As Integer
|
Private Property ComprasEnComplemento As Integer
|
||||||
Get
|
Get
|
||||||
@@ -682,6 +696,19 @@ Partial Class Compras_eFacturas
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property SeVinculoConComprasFaltantes As Boolean
|
||||||
|
Get
|
||||||
|
If ViewState("SeVinculoConComprasFaltantes") Is Nothing Then
|
||||||
|
Return False
|
||||||
|
Else
|
||||||
|
Return Boolean.Parse(ViewState("SeVinculoConComprasFaltantes").ToString)
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("SeVinculoConComprasFaltantes") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -763,37 +790,55 @@ Partial Class Compras_eFacturas
|
|||||||
txtFechaI.Text = MinFecha.ToString
|
txtFechaI.Text = MinFecha.ToString
|
||||||
txtFechaF.Text = Now.ToShortDateString
|
txtFechaF.Text = Now.ToShortDateString
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim DtPagos As DataTable = Nothing
|
Dim DtPagos As DataTable = Nothing
|
||||||
|
Dim DTTrasaldos As DataTable = Nothing
|
||||||
|
|
||||||
Dim ObjDatos As New ClsCompras
|
Dim ObjDatos As New ClsCompras
|
||||||
If ObjDatos.GetFacturas(-1, Folio, FechaI, FechaF, RFC, Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa) Then
|
If ObjDatos.GetFacturas(-1, Folio, FechaI, FechaF, RFC, Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
If ObjDatos.DtResultados.Rows.Count > 0 Then
|
If ObjDatos.DtResultados.Rows.Count > 0 Then
|
||||||
GvD.DataSource = ObjDatos.DtResultados.FiltraParametros("TipoComprobante <> 'P'") '.AsEnumerable().Take(100).CopyToDataTable()
|
|
||||||
|
GvD.DataSource = ObjDatos.DtResultados.FiltraParametros("TipoComprobante <> 'P' and TipoComprobante <> 'T' ") '.AsEnumerable().Take(100).CopyToDataTable()
|
||||||
DtPagos = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'P'")
|
DtPagos = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'P'")
|
||||||
'Else
|
|
||||||
' GvD.DataSource = Nothing
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ObjDatos.GetFacturas(-1, Folio, FechaI, FechaF, RFC, Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa, Opcion:=2) Then
|
||||||
|
|
||||||
|
If ObjDatos.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
LblRegistros.Text = String.Format("{0} Registros", ObjDatos.DtResultados.FiltraParametros("TipoComprobante <> 'P'").Rows.Count.ToString("N0"))
|
DTTrasaldos = ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'")
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
LblRegistros.Text = String.Format("{0} Registros", ObjDatos.DtResultados.FiltraParametros("TipoComprobante <> 'P' and TipoComprobante <> 'T' ").Rows.Count.ToString("N0"))
|
||||||
LblTotalPagos.Text = String.Format("{0} Pagos", ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'P'").Rows.Count.ToString("N0"))
|
LblTotalPagos.Text = String.Format("{0} Pagos", ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'P'").Rows.Count.ToString("N0"))
|
||||||
|
LblTotalTraslados.Text = String.Format("{0} Traslados", ObjDatos.DtResultados.FiltraParametros("TipoComprobante = 'T'").Rows.Count.ToString("N0"))
|
||||||
|
|
||||||
If DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then
|
If DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then
|
||||||
GvPagos.DataSource = DtPagos
|
GvPagos.DataSource = DtPagos
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If DTTrasaldos IsNot Nothing AndAlso DTTrasaldos.Rows.Count > 0 Then
|
||||||
|
GvTraslados.DataSource = DTTrasaldos
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
ObjDatos.Dispose()
|
ObjDatos.Dispose()
|
||||||
|
|
||||||
|
|
||||||
GvPagos.DataBind()
|
|
||||||
UpPagos.Update()
|
|
||||||
|
|
||||||
GvD.DataBind()
|
GvD.DataBind()
|
||||||
|
GvPagos.DataBind()
|
||||||
|
GvTraslados.DataBind()
|
||||||
|
|
||||||
|
UpPagos.Update()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
|
UpTraslados.Update()
|
||||||
UPRegistros.Update()
|
UPRegistros.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||||
@@ -2746,7 +2791,7 @@ Partial Class Compras_eFacturas
|
|||||||
#Region "V I N C U L A R P A G O"
|
#Region "V I N C U L A R P A G O"
|
||||||
|
|
||||||
Protected Sub LnkAgregarPago_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkAgregarPago_Click(sender As Object, e As EventArgs)
|
||||||
|
SeVinculoConComprasFaltantes = False
|
||||||
Dim sbSinIE As New StringBuilder
|
Dim sbSinIE As New StringBuilder
|
||||||
Dim TieneCompras As Boolean = False
|
Dim TieneCompras As Boolean = False
|
||||||
|
|
||||||
@@ -2933,7 +2978,13 @@ Partial Class Compras_eFacturas
|
|||||||
Try
|
Try
|
||||||
|
|
||||||
If drow("CveIE").ToString.ToEntero > 0 Then
|
If drow("CveIE").ToString.ToEntero > 0 Then
|
||||||
|
dRow2("CveIE") = drow("CveIE").ToString.ToEntero
|
||||||
|
dRow2("ImportePago") = drow("Importe").ToString.ToDecimal
|
||||||
|
|
||||||
|
dRow2("FolioPago") = drow("FolioIE")
|
||||||
|
dRow2("FechaPago") = drow("FechaDocumento")
|
||||||
dRow2("CvePrePolizaDetalle") = drow("CvePrePolizaDetalle").ToString
|
dRow2("CvePrePolizaDetalle") = drow("CvePrePolizaDetalle").ToString
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -2941,13 +2992,7 @@ Partial Class Compras_eFacturas
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
|
||||||
If drow("CveIE").ToString.ToEntero > 0 Then
|
|
||||||
dRow2("CveIE") = drow("CveIE").ToString.ToEntero
|
|
||||||
dRow2("ImportePago") = drow("Importe").ToString.ToDecimal
|
|
||||||
End If
|
|
||||||
|
|
||||||
dRow2("FolioPago") = drow("FolioIE")
|
|
||||||
dRow2("FechaPago") = drow("FechaDocumento")
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -3149,6 +3194,41 @@ Partial Class Compras_eFacturas
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
BtnVincularPago.Attributes.Add("data-toggle", "")
|
||||||
|
BtnVincularPago.Attributes.Add("data-popout", "")
|
||||||
|
BtnVincularPago.Attributes.Add("data-original-title", "")
|
||||||
|
BtnVincularPago.Attributes.Add("data-btn-ok-label", "")
|
||||||
|
|
||||||
|
If UsuarioActual.TienePermisoProceso(332) And (BtnVincularPago.Visible = False Or BtnVincularPago.Enabled = False) Then
|
||||||
|
|
||||||
|
Dim FaltanCompras As Boolean = False
|
||||||
|
For Each GvRowVal As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
|
||||||
|
If GvRowVal.DataKey("CveCompra").ToEntero > 0 Then
|
||||||
|
FaltanCompras = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
If FaltanCompras Then
|
||||||
|
|
||||||
|
For Each GvRowVal As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
|
||||||
|
If GvRowVal.DataKey("CveIE").ToEntero > 0 Then
|
||||||
|
|
||||||
|
BtnVincularPago.Enabled = True
|
||||||
|
BtnVincularPago.Visible = True
|
||||||
|
|
||||||
|
BtnVincularPago.Attributes.Add("data-toggle", "confirmation")
|
||||||
|
BtnVincularPago.Attributes.Add("data-popout", "true")
|
||||||
|
BtnVincularPago.Attributes.Add("data-original-title", "Se realizará la vinculación sin tener compras previamente registradas")
|
||||||
|
BtnVincularPago.Attributes.Add("data-btn-ok-label", "Si")
|
||||||
|
|
||||||
|
SeVinculoConComprasFaltantes = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
UpVincularPago.Update()
|
UpVincularPago.Update()
|
||||||
@@ -3159,6 +3239,8 @@ Partial Class Compras_eFacturas
|
|||||||
|
|
||||||
Private Sub BtnVincularPago_Click(sender As Object, e As EventArgs) Handles BtnVincularPago.Click
|
Private Sub BtnVincularPago_Click(sender As Object, e As EventArgs) Handles BtnVincularPago.Click
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'VERIFICA QUE HALLA UN PAGO
|
'VERIFICA QUE HALLA UN PAGO
|
||||||
'Dim Contador = 0
|
'Dim Contador = 0
|
||||||
'For Each Gv As GridViewRow In GvVincularPago.Rows
|
'For Each Gv As GridViewRow In GvVincularPago.Rows
|
||||||
@@ -3181,7 +3263,7 @@ Partial Class Compras_eFacturas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Gv.DataKey("CveCompra").ToEntero > 0 Then
|
If Gv.DataKey("CveCompra").ToEntero > 0 And Gv.DataKey("CveIE").ToEntero > 0 Then
|
||||||
|
|
||||||
If Not ObjCompra.AddComplementoPago(Gv.DataKey("CveIE").ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("ImpPagado").ToDecimal, Gv.DataKey("CvePrePolizaDetalle").ToEntero, CveFacturaPago) > 0 Then
|
If Not ObjCompra.AddComplementoPago(Gv.DataKey("CveIE").ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("ImpPagado").ToDecimal, Gv.DataKey("CvePrePolizaDetalle").ToEntero, CveFacturaPago) > 0 Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
@@ -3232,7 +3314,6 @@ Partial Class Compras_eFacturas
|
|||||||
|
|
||||||
|
|
||||||
For Each Gv As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
|
For Each Gv As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
|
||||||
|
|
||||||
If Boolean.Parse(Gv.DataKey("Manual").ToString) Then
|
If Boolean.Parse(Gv.DataKey("Manual").ToString) Then
|
||||||
objEventos.AddEventoBitacora($"Complemento { LblSerieFolioPago.Text} vinculado manualmente a compra {Gv.DataKey("SerieFolio").ToString} y Pago { Gv.DataKey("FolioPago").ToString }", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=Gv.DataKey("CveCompra").ToString.ToEntero)
|
objEventos.AddEventoBitacora($"Complemento { LblSerieFolioPago.Text} vinculado manualmente a compra {Gv.DataKey("SerieFolio").ToString} y Pago { Gv.DataKey("FolioPago").ToString }", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=Gv.DataKey("CveCompra").ToString.ToEntero)
|
||||||
End If
|
End If
|
||||||
@@ -4174,4 +4255,184 @@ Partial Class Compras_eFacturas
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Region "TRASLADOS"
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub GvTraslados_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTraslados.RowDataBound
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
|
If e.Row.DBCampo("TipoComprobante") = "T" Then
|
||||||
|
e.Row.FCLabel("LtTipoComprobante").Text = "Traslado"
|
||||||
|
e.Row.FCLabel("LtTipoComprobante").CssClass = "label label-sm label-primary"
|
||||||
|
e.Row.FCLabel("LtTipoComprobante").Attributes.Add("data-toggle", "tooltip")
|
||||||
|
e.Row.FCLabel("LtTipoComprobante").Attributes.Add("title", "Traslado")
|
||||||
|
End If
|
||||||
|
|
||||||
|
e.Row.Cells(2).Attributes.Add("data-order", e.Row.DBCampo("FechaFactura").ToDate.Ticks.ToString)
|
||||||
|
|
||||||
|
Dim RutaXML As String = String.Format("{0}{1}\{2}", Destino, e.Row.DBCampo("RFCDe"), e.Row.DBCampo("XML"))
|
||||||
|
|
||||||
|
If File.Exists(String.Format("{0}{1}\{2}", Destino, e.Row.DBCampo("RFCDe"), e.Row.DBCampo("XML"))) Then
|
||||||
|
e.Row.FCLiteral("LtlXML").Text = String.Format("<a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?RFC={0}&File={1}"">Ver</a>", HttpUtility.UrlEncode(e.Row.DBCampo("RFCDe")), HttpUtility.UrlEncode(e.Row.DBCampo("XML")))
|
||||||
|
If e.Row.DBCampo("TipoComprobante") = "T" And e.Row.DBCampo("FueValidado") = "1" Then
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").Visible = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
e.Row.FCLiteral("LtlXML").Text = "N/D" ' String.Format("{0}{1}\{2}", Destino, e.Row.DBCampo("RFCDe"), e.Row.DBCampo("XML")) '
|
||||||
|
If e.Row.DBCampo("TipoComprobante") = "T" Then
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").Visible = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If File.Exists(String.Format("{0}{1}/{2}", Destino, e.Row.DBCampo("RFCDe"), e.Row.DBCampo("PDF"))) Then
|
||||||
|
e.Row.FCLiteral("LtlPDF").Text = String.Format("<a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?RFC={0}&File={1}"">Ver</a>", HttpUtility.UrlEncode(e.Row.DBCampo("RFCDe")), HttpUtility.UrlEncode(e.Row.DBCampo("PDF")))
|
||||||
|
Else
|
||||||
|
e.Row.FCLiteral("LtlPDF").Text = "N/D" ' String.Format("{0}{1}/{2}", Destino, e.Row.DBCampo("RFCDe"), e.Row.DBCampo("PDF"))
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DBCampo("FueValidado").Contiene("1", "2", "3") Then
|
||||||
|
e.Row.FCLinkButton("ImgValidarCFDi").Visible = False
|
||||||
|
e.Row.FCLiteral("LtlValidado").Visible = True
|
||||||
|
If e.Row.DBCampo("FueValidado") = "2" Then
|
||||||
|
e.Row.FCLiteral("LtlValidado").Text = "Cancelada"
|
||||||
|
e.Row.ForeColor = Drawing.Color.Red
|
||||||
|
e.Row.FCHyperLink("HplProveedor").ForeColor = Drawing.Color.Red
|
||||||
|
ElseIf e.Row.DBCampo("FueValidado") = "3" Then
|
||||||
|
e.Row.FCLiteral("LtlValidado").Text = "Omitida"
|
||||||
|
e.Row.ForeColor = Drawing.Color.Gray
|
||||||
|
e.Row.FCHyperLink("HplProveedor").ForeColor = Drawing.Color.Gray
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If e.Row.DBCampo("TipoFactura") = "CFD" Then
|
||||||
|
e.Row.FCLinkButton("ImgValidarCFDi").CommandName = "ValidarCFD"
|
||||||
|
e.Row.FCLinkButton("ImgValidarCFDi").OnClientClick = "return confirm('La factura se validó en el sitio del SAT de comprobantes fiscales?');"
|
||||||
|
End If
|
||||||
|
e.Row.FCLinkButton("ImgValidarCFDi").Visible = True
|
||||||
|
e.Row.FCLiteral("LtlValidado").Visible = False
|
||||||
|
|
||||||
|
End If
|
||||||
|
If e.Row.DBCampo("CveCompra") <> "" Then
|
||||||
|
e.Row.FCLiteral("LtlFolio").Text = String.Format("<a class=""Texto"" style=""cursor:pointer;text-decoration: underline;"" href='/Compras/Compras.aspx?CveCompra={0}' target='_blank' rel='opener');"">{1}</a>", e.Row.DBCampo("CveCompra"), e.Row.DBCampo("SerieFolio")) '1\Compras\GAPC480413QL3\A-69.xml
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DBCampo("CveProveedor") = "" Then
|
||||||
|
e.Row.FCHyperLink("HplProv").Visible = True
|
||||||
|
e.Row.FCHyperLink("HplProv").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveFactura={0}", e.Row.DBCampo("CveFactura"))
|
||||||
|
|
||||||
|
Else
|
||||||
|
e.Row.FCHyperLink("HplProveedor").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor"))
|
||||||
|
|
||||||
|
If e.Row.DBCampo("CveCompra") = "" AndAlso (e.Row.DBCampo("FueValidado") = "1") Then
|
||||||
|
e.Row.FCHyperLink("HplAgregarT").Visible = False
|
||||||
|
Else
|
||||||
|
e.Row.FCHyperLink("HplAgregarT").Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim CveComplementoTraslado As Integer = e.Row.DataKey("CveComplementoTraslado").ToString.ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
If CveComplementoTraslado > 0 Then
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").CssClass = "btn btn-sm green"
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").Text = "<i class='fa fa-info' ></i>"
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").Attributes.Add("Title", "Ver vinculación")
|
||||||
|
Else
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").CssClass = "btn btn-sm blue"
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").Text = "<i class='fa fa-check'></i>"
|
||||||
|
e.Row.FCLinkButton("LnkAgregarTraslado").Attributes.Add("Title", "Vincular Traslado")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Protected Sub LnkAgregarTraslado_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||||
|
Dim CveComplementoTraslado As Integer = gvRow.DataKey("CveComplementoTraslado").ToEntero
|
||||||
|
CveFacturaComplementoTraslado = gvRow.DataKey("CveFactura").ToEntero
|
||||||
|
Dim SerieFolioTraslado As String = gvRow.DataKey("SerieFolio").ToString
|
||||||
|
LnkVincularTraslado.Visible = False
|
||||||
|
|
||||||
|
|
||||||
|
If CveComplementoTraslado > 0 Then
|
||||||
|
DvMomdalVincualarTrasladoBusqueda.Visible = False
|
||||||
|
DvModalVincularTrasladoVinculado.Visible = True
|
||||||
|
LtlModalVincularTrasaldoTitulo.Text = "Traslado Vinculado"
|
||||||
|
LnkModalModalVincularTrasaldoFolio.Text = gvRow.DataKey("SerieFolioVinculado")
|
||||||
|
LnkModalModalVincularTrasaldoFolio.NavigateUrl = $"~/Compras/Compras.aspx?CveCompra={gvRow.DataKey("CveCompraTraslado")}"
|
||||||
|
|
||||||
|
|
||||||
|
Else
|
||||||
|
DvMomdalVincualarTrasladoBusqueda.Visible = True
|
||||||
|
DvModalVincularTrasladoVinculado.Visible = False
|
||||||
|
LtlModalVincularTrasaldoTitulo.Text = "Vincular Traslado"
|
||||||
|
End If
|
||||||
|
|
||||||
|
UpModalVincularTraslado.Update()
|
||||||
|
RegistraScript("$('#DvModalVincularTrasaldo').modal('show');")
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Protected Sub BtnCargaCompraComplementoTraslado_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If HdnCveCompraComplementoTraslado.Value.ToString.ToEntero > 0 Then
|
||||||
|
|
||||||
|
LnkVincularTraslado.Visible = True
|
||||||
|
LnkModalModalVincularTrasaldoFolio.Text = HdnFolioCompraComplementoTraslado.Value.ToString
|
||||||
|
LnkModalModalVincularTrasaldoFolio.NavigateUrl = $"~/Compras/Compras.aspx?CveCompra={HdnCveCompraComplementoTraslado.Value.ToString}"
|
||||||
|
DvModalVincularTrasladoVinculado.Visible = True
|
||||||
|
|
||||||
|
|
||||||
|
Else
|
||||||
|
LnkVincularTraslado.Visible = False
|
||||||
|
LnkModalModalVincularTrasaldoFolio.Text = ""
|
||||||
|
LnkModalModalVincularTrasaldoFolio.NavigateUrl = ""
|
||||||
|
DvModalVincularTrasladoVinculado.Visible = False
|
||||||
|
LnkVincularTraslado.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
UpModalVincularTraslado.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub LnkVincularTraslado_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim ProcesoOk As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If HdnCveCompraComplementoTraslado.Value.ToString.ToEntero > 0 Then
|
||||||
|
Dim objCompras As New ClsCompras
|
||||||
|
|
||||||
|
If objCompras.AddComplementoTraslado(CveFacturaComplementoTraslado, HdnCveCompraComplementoTraslado.Value.ToString.ToEntero, UsuarioActual.CveUsuario) Then
|
||||||
|
ProcesoOk = True
|
||||||
|
End If
|
||||||
|
objCompras.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ProcesoOk Then
|
||||||
|
RegistraScript("$('#DvModalVincularTrasaldo').modal('hide');")
|
||||||
|
CargaDatos()
|
||||||
|
Alert("Traslado Vinculado correctamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -471,18 +471,29 @@ public partial class GPS_WizardDispositivos : ClsPaginas
|
|||||||
{
|
{
|
||||||
ClsGPS ObjGPS = new ClsGPS();
|
ClsGPS ObjGPS = new ClsGPS();
|
||||||
ObjGPS.ProveedoresComunicacionCuentasGet(-1, UsuarioActual.CveEmpresa);
|
ObjGPS.ProveedoresComunicacionCuentasGet(-1, UsuarioActual.CveEmpresa);
|
||||||
DdlLineaTelefono.SelectedIndex = -1;
|
|
||||||
DdlLineaTelefono.DataSource = ObjGPS.DtResultados.FiltraParametros($"CveDispositivo is NULL OR CveDispositivo = {CveDispositivo}");
|
DataTable DtProveedores = ObjGPS.DtResultados.FiltraParametros($"CveDispositivo IS NULL OR CveDispositivo = {CveDispositivo}");
|
||||||
|
DdlLineaTelefono.DataSource = DtProveedores;
|
||||||
|
|
||||||
ObjGPS.Dispose();
|
ObjGPS.Dispose();
|
||||||
|
|
||||||
DdlLineaTelefono.DataBind();
|
DdlLineaTelefono.DataBind();
|
||||||
DdlLineaTelefono.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
DdlLineaTelefono.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||||
DdlLineaTelefono.SelectedValue = "-1";
|
|
||||||
DataRow drow = ObjGPS.DtResultados.FiltroPrimero($"CveDispositivo is NULL OR CveDispositivo = {CveDispositivo}");
|
DataRow drow = DtProveedores.FiltroPrimero($"CveDispositivo IS NULL OR CveDispositivo = {CveDispositivo}");
|
||||||
if (drow != null)
|
if (drow != null)
|
||||||
{
|
{
|
||||||
DdlLineaTelefono.SelectedValue = drow["CveProveedorComunicacionCuenta"].ToString();
|
DdlLineaTelefono.SelectedValueExist(drow["CveProveedorComunicacionCuenta"].ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DtProveedores != null)
|
||||||
|
{
|
||||||
|
DtProveedores.Dispose();
|
||||||
|
DtProveedores = null;
|
||||||
|
}
|
||||||
|
|
||||||
upLinea.Update();
|
upLinea.Update();
|
||||||
|
UpModelo.Update();
|
||||||
}
|
}
|
||||||
protected void DdlProveedorComunicacion_SelectedIndexChanged1(object sender, EventArgs e)
|
protected void DdlProveedorComunicacion_SelectedIndexChanged1(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,10 +99,17 @@
|
|||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<asp:GridView ID="GVDatos" runat="server"
|
<asp:GridView ID="GVDatos" runat="server"
|
||||||
DataKeyNames="CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen"
|
DataKeyNames="CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen,Tipo,AplicaCP,RFCReceptor,RFCEmisor"
|
||||||
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
|
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
|
||||||
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
|
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
|
||||||
<Columns>
|
<Columns>
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderText="Tipo">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LtTipo" runat="server" Text='<%# Eval("TipoDescripcion") %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -351,6 +351,79 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
|||||||
protected void LnkCancelaTimbre_Click(object sender, EventArgs e)
|
protected void LnkCancelaTimbre_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
return;
|
||||||
|
bool ProcesoOK = false;
|
||||||
|
LinkButton LnkCancelarFolioFiscal = (LinkButton)sender;
|
||||||
|
GridViewRow GvRow = (GridViewRow)LnkCancelarFolioFiscal.BindingContainer;
|
||||||
|
|
||||||
|
int CveTimbre = GvRow.DataKey("CveTimbre").ToEntero();
|
||||||
|
string FolioFiscalCancelar = GvRow.DataKey("FolioFiscal").ToString();
|
||||||
|
string RFCReceptor = GvRow.DataKey("RFCReceptor").ToString();
|
||||||
|
string RFCEmisor = GvRow.DataKey("RFCEmisor").ToString();
|
||||||
|
|
||||||
|
int CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero();
|
||||||
|
bool AplicaCP = bool.Parse( GvRow.DataKey("AplicaCP") );
|
||||||
|
|
||||||
|
|
||||||
|
Timbrado ObjCancelacion = new Timbrado();
|
||||||
|
ClsGenerales ObjGenrales = new ClsGenerales();
|
||||||
|
|
||||||
|
if (EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptor))
|
||||||
|
{
|
||||||
|
if (ObjGenrales.UpdateGralTimbre(CveTimbre, "-1", "-1", -1, "-1", new DateTime(1900, 01, 01), UsuarioActual.CveEmpresa, UsuarioActual.CveEmpresa, 2, -1, CvePACCancelacion, DateTime.Now, AplicaCP,"-1")){
|
||||||
|
ProcesoOK = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion)) {
|
||||||
|
|
||||||
|
|
||||||
|
if(ObjGenrales.UpdateGralTimbre(CveTimbre,"-1","-1",-1,"-1",new DateTime(1900,01,01),UsuarioActual.CveEmpresa,UsuarioActual.CveEmpresa,2,-1, CvePACCancelacion,DateTime.Now, AplicaCP,SelloCancelacion: ObjCancelacion.CancelacionAcuse)){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Alert("El complemento se cancelo correctamente.");
|
||||||
|
ProcesoOK = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert("Se presento un error al cancelar el Folio Fiscal", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ObjGenrales.Dispose();
|
||||||
|
|
||||||
|
if (ProcesoOK)
|
||||||
|
{
|
||||||
|
CargaDatos();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool EstatusSATCancelado(string FolioFiscal, string RFCDe, string RFCReceptor)
|
||||||
|
{
|
||||||
|
bool respuesta = false;
|
||||||
|
var Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, RFCDe, RFCReceptor, "0", true);
|
||||||
|
if (Vigencia is object)
|
||||||
|
{
|
||||||
|
if (Vigencia.Estado.ToUpper() == "CANCELADO")
|
||||||
|
{
|
||||||
|
respuesta = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
respuesta = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
respuesta = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return respuesta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -412,6 +485,19 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
|||||||
|
|
||||||
LnkCancelaTimbre.Visible = true;
|
LnkCancelaTimbre.Visible = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
switch (e.Row.DataKey("Tipo"))
|
||||||
|
{
|
||||||
|
case "E":
|
||||||
|
e.Row.FCLabel("LtTipo").CssClass = "label label-sm label-success";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
e.Row.FCLabel("LtTipo").CssClass = "label label-sm label-warning";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1215,7 +1215,7 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim NoEncontrados As Integer = 0
|
Dim NoEncontrados As Integer = 0
|
||||||
Dim Encontrados As Integer = 0
|
Dim Encontrados As Integer = 0
|
||||||
Dim StrRFCNoencontrados As New StringBuilder
|
Dim StrRFCNoencontrados As New StringBuilder
|
||||||
Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("")
|
Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("AplicaParaVenta = 1")
|
||||||
Dim CvePS As Integer = drr("CvePS").ToString.ToEntero
|
Dim CvePS As Integer = drr("CvePS").ToString.ToEntero
|
||||||
Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString.ToEntero
|
Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString.ToEntero
|
||||||
Dim CveClasificacion As Integer = drr("CveClasificacion").ToString.ToEntero
|
Dim CveClasificacion As Integer = drr("CveClasificacion").ToString.ToEntero
|
||||||
@@ -1728,7 +1728,7 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim SubP As String = Row("SubProyecto").ToString.Trim
|
Dim SubP As String = Row("SubProyecto").ToString.Trim
|
||||||
If SubP <> "" OrElse SubP <> "-" Then
|
If SubP <> "" AndAlso SubP <> "-" Then
|
||||||
DataTemp = SubProTemp.FiltraParametros(String.Format("SubProyecto = '{0}'", SubP))
|
DataTemp = SubProTemp.FiltraParametros(String.Format("SubProyecto = '{0}'", SubP))
|
||||||
CveSubProyecto = DataTemp.FiltroPrimeroValor("CveSubProyecto", "").ToEntero
|
CveSubProyecto = DataTemp.FiltroPrimeroValor("CveSubProyecto", "").ToEntero
|
||||||
If CveSubProyecto <= 0 Then
|
If CveSubProyecto <= 0 Then
|
||||||
@@ -2053,6 +2053,7 @@ Partial Class General_SaldosIniciales
|
|||||||
ObjRH.IniciaTransacSQL()
|
ObjRH.IniciaTransacSQL()
|
||||||
Dim ErrorRH As Boolean = False
|
Dim ErrorRH As Boolean = False
|
||||||
Dim Contador As Integer = 0
|
Dim Contador As Integer = 0
|
||||||
|
Dim ContadorAgregados As Integer = 0
|
||||||
Dim NumRow As Integer = 0
|
Dim NumRow As Integer = 0
|
||||||
|
|
||||||
For Each Row As DataRow In dt.Rows
|
For Each Row As DataRow In dt.Rows
|
||||||
@@ -2095,6 +2096,12 @@ Partial Class General_SaldosIniciales
|
|||||||
Dim MetodoPago As String = Row("Metodo Pago").ToString
|
Dim MetodoPago As String = Row("Metodo Pago").ToString
|
||||||
Dim Nominista As String = Row("Nominista").ToString
|
Dim Nominista As String = Row("Nominista").ToString
|
||||||
|
|
||||||
|
Dim NombreCompleto As String = $"{Nombre} {ApellidoPaterno} {ApellidoMaterno}"
|
||||||
|
|
||||||
|
If NombreCompleto.Trim.Replace(" ", "") = String.Empty Then
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
|
||||||
'CLAVES
|
'CLAVES
|
||||||
Dim CveGenero As Integer = 0
|
Dim CveGenero As Integer = 0
|
||||||
Dim CveEstadoCivil As Integer = 0
|
Dim CveEstadoCivil As Integer = 0
|
||||||
@@ -2152,7 +2159,7 @@ Partial Class General_SaldosIniciales
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
myarraystr = TipoContrato.Split(":"c)
|
myarraystr = TipoContrato.Split(":"c)
|
||||||
If (myarraystr.Length > 0) Then
|
If (myarraystr.Length > 1) Then
|
||||||
CveTipoContrato = myarraystr(0).ToEntero()
|
CveTipoContrato = myarraystr(0).ToEntero()
|
||||||
Else
|
Else
|
||||||
CveTipoContrato = GlobalDTTiposContrato().FiltroPrimeroValor("CveTipoContrato", $"TipoContrato = '{TipoContrato}'").ToString.ToEntero
|
CveTipoContrato = GlobalDTTiposContrato().FiltroPrimeroValor("CveTipoContrato", $"TipoContrato = '{TipoContrato}'").ToString.ToEntero
|
||||||
@@ -2215,7 +2222,12 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
'VALIDACIONES
|
'VALIDACIONES
|
||||||
' If Not CveSucursal > 0 Then Alert("La Empresa no cuenta con Sucursal, es necesario dar una Sucursal de alta.", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
' If Not CveSucursal > 0 Then Alert("La Empresa no cuenta con Sucursal, es necesario dar una Sucursal de alta.", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
||||||
If Not CveDepartamento > 0 Then Alert($"No se encontró el Departamento: {Departamento} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
If Not CveDepartamento > 0 Then
|
||||||
|
Alert($"No se encontró el Departamento: {Departamento} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia)
|
||||||
|
ErrorRH = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
If Not CvePuesto > 0 Then Alert($"No se encontró el Puesto: {Puesto} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
If Not CvePuesto > 0 Then Alert($"No se encontró el Puesto: {Puesto} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
||||||
If Not CveTurno > 0 Then Alert($"No se encontró el turno: {Turno} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
If Not CveTurno > 0 Then Alert($"No se encontró el turno: {Turno} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
||||||
If Not CveEstado > 0 Then Alert($"No se encontró el Estado: {Estado} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
If Not CveEstado > 0 Then Alert($"No se encontró el Estado: {Estado} Renglón: {NumRow}: ", TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
||||||
@@ -2226,7 +2238,7 @@ Partial Class General_SaldosIniciales
|
|||||||
If Not CveUsuarioNomina > 0 Then CveUsuarioNomina = -1 'Alert("No se encontró el Nominista: " + Nominista + " Renglón: " + NumRow, TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
If Not CveUsuarioNomina > 0 Then CveUsuarioNomina = -1 'Alert("No se encontró el Nominista: " + Nominista + " Renglón: " + NumRow, TipoMensaje.MsgAdvertencia) : ErrorRH = True : Exit For
|
||||||
|
|
||||||
|
|
||||||
Dim NombreCompleto As String = $"{Nombre} {ApellidoPaterno} {ApellidoMaterno}"
|
|
||||||
Dim CvePersonal As Integer = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"NombreCompletoNombre = '{NombreCompleto}'").ToString.ToEntero()
|
Dim CvePersonal As Integer = GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePersonal", $"NombreCompletoNombre = '{NombreCompleto}'").ToString.ToEntero()
|
||||||
|
|
||||||
|
|
||||||
@@ -2280,6 +2292,8 @@ Partial Class General_SaldosIniciales
|
|||||||
ClabeInterbancaria, "", CveJornada, CveJornada, "", -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina) Then
|
ClabeInterbancaria, "", CveJornada, CveJornada, "", -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveUsuarioNomina) Then
|
||||||
ErrorRH = True
|
ErrorRH = True
|
||||||
Exit For
|
Exit For
|
||||||
|
Else
|
||||||
|
ContadorAgregados = ContadorAgregados + 1
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2289,7 +2303,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
If Not ErrorRH Then
|
If Not ErrorRH Then
|
||||||
If Contador > 0 Then
|
If Contador > 0 Then
|
||||||
Alert(String.Format("Se agregaron: <b>{0}</b> Empleados correctamente. <br>Se Omitieron: <b>{1}</b> Empleados ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
|
Alert(String.Format("Se agregaron: <b>{0}</b> Empleados correctamente. <br>Se Omitieron: <b>{1}</b> Empleados ya que ya se encontraban registrados.", ContadorAgregados, Contador), TipoMensaje.MsgInformacion)
|
||||||
ObjRH.Commit()
|
ObjRH.Commit()
|
||||||
TxtExcel.Text = ""
|
TxtExcel.Text = ""
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
|
|||||||
@@ -34,10 +34,9 @@
|
|||||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCamion,Placa,Especificacion,ConfigCartaPorte,Anio,CveTipoPermisoSCT,NumPermisoSCT,NombreAseguradora,NumPolizaSeguro"
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCamion,Placa,Especificacion,ConfigCartaPorte,Anio,CveTipoPermisoSCT,NumPermisoSCT,NombreAseguradora,NumPolizaSeguro,NombreAseguradoraMedioAmbiente,NumPolizaSeguroMedioAmbiente,NombreAseguradoraCarga,NumPolizaSeguroCarga"
|
||||||
EmptyDataText="No se Encontraron Unidades" ToolTip="Listado de Unidades" CssClass="table table-striped table-advance table-hover mysmallbtn" Style="margin-top: -10px; width: 100%" GridLines="None">
|
EmptyDataText="No se Encontraron Unidades" ToolTip="Listado de Unidades" CssClass="table table-striped table-advance table-hover mysmallbtn" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
|
|
||||||
<asp:BoundField HeaderText="Placa" DataField="Placa" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="Placa" DataField="Placa" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField HeaderText="Especificación" DataField="Especificacion" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="Especificación" DataField="Especificacion" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:BoundField HeaderText="Config Carta Porte" DataField="ConfigCartaPorte" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField HeaderText="Config Carta Porte" DataField="ConfigCartaPorte" ItemStyle-HorizontalAlign="Left" />
|
||||||
@@ -144,21 +143,66 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="form-group form-md-line-input input-iconright col-md-6">
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtNombreAseguradora" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
<asp:TextBox ID="TxtNombreAseguradora" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||||
<label for="<%= TxtNombreAseguradora.ClientID.ToString()%>">Nombre Aseguradora:</label>
|
<label for="<%= TxtNombreAseguradora.ClientID.ToString()%>">Aseguradora Responsabilidad Civil:</label>
|
||||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtNombreAseguradora" ControlToValidate="TxtNombreAseguradora" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre Aseguradora''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator runat="server" ID="RfvTxtNombreAseguradora" ControlToValidate="TxtNombreAseguradora" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Aseguradora Responsabilidad Civil''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright col-md-6">
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtNumPolizaSeguro" CssClass="form-control" runat="server" MaxLength="25"></asp:TextBox>
|
<asp:TextBox ID="TxtNumPolizaSeguro" CssClass="form-control" runat="server" MaxLength="25"></asp:TextBox>
|
||||||
<label for="<%= TxtNumPolizaSeguro.ClientID.ToString()%>">Numero Póliza Seguro:</label>
|
<label for="<%= TxtNumPolizaSeguro.ClientID.ToString()%>">Número Póliza Seguro:</label>
|
||||||
<asp:RequiredFieldValidator runat="server" ID="RfvTxtNumPolizaSeguro" ControlToValidate="TxtNumPolizaSeguro" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Numero Póliza Seguro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator runat="server" ID="RfvTxtNumPolizaSeguro" ControlToValidate="TxtNumPolizaSeguro" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Póliza Responsabilidad Civil''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright" >
|
||||||
|
<asp:TextBox ID="TxtNombreAseguradoraMedioAmbiente" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||||
|
<label for="<%= TxtNombreAseguradoraMedioAmbiente.ClientID.ToString()%>">Aseguradora Medio Ambiente:</label>
|
||||||
|
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="TxtNombreAseguradoraMedioAmbiente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Aseguradora Medio Ambiente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtNumPolizaSeguroMedioAmbiente" CssClass="form-control" runat="server" MaxLength="25"></asp:TextBox>
|
||||||
|
<label for="<%= TxtNumPolizaSeguroMedioAmbiente.ClientID.ToString()%>">Número Póliza Medio Ambiente:</label>
|
||||||
|
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="TxtNumPolizaSeguroMedioAmbiente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Numero Póliza Medio Ambiente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="TxtNombreAseguradoraCarga" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||||
|
<label for="<%= TxtNombreAseguradoraCarga.ClientID.ToString()%>">Aseguradora Carga:</label>
|
||||||
|
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="TxtNombreAseguradoraCarga" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Aseguradora Carga''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright" >
|
||||||
|
<asp:TextBox ID="TxtNumPolizaSeguroCarga" CssClass="form-control" runat="server" MaxLength="25"></asp:TextBox>
|
||||||
|
<label for="<%= TxtNumPolizaSeguroCarga.ClientID.ToString()%>">Número Póliza Seguro:</label>
|
||||||
|
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator4" ControlToValidate="TxtNumPolizaSeguroCarga" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Póliza Seguro Carga''</b> es necesario, por favor ingréselo." ValidationGroup="GrpUnidad"></asp:RequiredFieldValidator>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ Partial Class Inventarios_CatUnidades
|
|||||||
TxtNumermisoSCT.Text = ""
|
TxtNumermisoSCT.Text = ""
|
||||||
TxtNombreAseguradora.Text = ""
|
TxtNombreAseguradora.Text = ""
|
||||||
TxtNumPolizaSeguro.Text = ""
|
TxtNumPolizaSeguro.Text = ""
|
||||||
|
TxtNombreAseguradoraMedioAmbiente.Text = ""
|
||||||
|
TxtNumPolizaSeguroMedioAmbiente.Text = ""
|
||||||
|
TxtNombreAseguradoraCarga.Text = ""
|
||||||
|
TxtNumPolizaSeguroCarga.Text = ""
|
||||||
|
|
||||||
LtlTituloModal.Text = "Agregar Unidad"
|
LtlTituloModal.Text = "Agregar Unidad"
|
||||||
|
|
||||||
@@ -103,6 +107,11 @@ Partial Class Inventarios_CatUnidades
|
|||||||
TxtNombreAseguradora.Text = GvRow.DataKey("NombreAseguradora")
|
TxtNombreAseguradora.Text = GvRow.DataKey("NombreAseguradora")
|
||||||
TxtNumPolizaSeguro.Text = GvRow.DataKey("NumPolizaSeguro")
|
TxtNumPolizaSeguro.Text = GvRow.DataKey("NumPolizaSeguro")
|
||||||
|
|
||||||
|
TxtNombreAseguradoraMedioAmbiente.Text = GvRow.DataKey("NombreAseguradoraMedioAmbiente")
|
||||||
|
TxtNumPolizaSeguroMedioAmbiente.Text = GvRow.DataKey("NumPolizaSeguroMedioAmbiente")
|
||||||
|
TxtNombreAseguradoraCarga.Text = GvRow.DataKey("NombreAseguradoraCarga")
|
||||||
|
TxtNumPolizaSeguroCarga.Text = GvRow.DataKey("NumPolizaSeguroCarga")
|
||||||
|
|
||||||
LtlTituloModal.Text = "Actualizar Unidad"
|
LtlTituloModal.Text = "Actualizar Unidad"
|
||||||
|
|
||||||
UpModalUnidades.Update()
|
UpModalUnidades.Update()
|
||||||
@@ -144,13 +153,15 @@ Partial Class Inventarios_CatUnidades
|
|||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
|
|
||||||
If CveCamion <= 0 Then
|
If CveCamion <= 0 Then
|
||||||
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario) Then
|
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario,
|
||||||
|
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text) Then
|
||||||
Alert("Unidad agregada correctamente")
|
Alert("Unidad agregada correctamente")
|
||||||
Else
|
Else
|
||||||
ErrorPrceso = True
|
ErrorPrceso = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||||
|
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text) Then
|
||||||
Alert("Unidad actualizada correctamente")
|
Alert("Unidad actualizada correctamente")
|
||||||
Else
|
Else
|
||||||
ErrorPrceso = True
|
ErrorPrceso = True
|
||||||
|
|||||||
@@ -20,6 +20,15 @@
|
|||||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
|
|
||||||
|
|
||||||
|
<asp:UpdatePanel runat="server">
|
||||||
|
<ContentTemplate>
|
||||||
|
<li style="text-align: left!important">
|
||||||
|
<asp:LinkButton runat="server" ID="LnkAgregarRecoleccion" OnClick="LnkAgregarRecoleccion_Click" CssClass="" data-toggle="tooltip" data-placement="left" title="Agregar Recoleción" Text="<i class='fa fa-plus'></i>Agregar Recolección"></asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
@@ -80,7 +89,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<asp:UpdatePanel runat="server" ID="UpDatosEntrga">
|
<asp:UpdatePanel runat="server" ID="UpDatosEntrega" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<div class="row" >
|
<div class="row" >
|
||||||
@@ -146,6 +155,10 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%" OnActiveTabChanged="Tab_ActiveTabChanged" AutoPostBack="true">
|
||||||
|
|
||||||
|
<ajax:TabPanel ID="TabEntrega" runat="server" HeaderText="Entrega">
|
||||||
|
<ContentTemplate>
|
||||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:Panel runat="server" ID="portletTarea" class="portlet light smmallpadding bordered">
|
<asp:Panel runat="server" ID="portletTarea" class="portlet light smmallpadding bordered">
|
||||||
@@ -161,7 +174,7 @@
|
|||||||
<div class="portlet-body rowpadding">
|
<div class="portlet-body rowpadding">
|
||||||
|
|
||||||
|
|
||||||
<div class="row" runat="server" id="DVGvPaqueteriasGuias" >
|
<div class="row" runat="server" id="DVGvPaqueteriasGuias">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
|
||||||
@@ -239,7 +252,7 @@
|
|||||||
|
|
||||||
<asp:TemplateField HeaderText="Cons" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25px">
|
<asp:TemplateField HeaderText="Cons" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25px">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LblNum" runat="server" Text='<%# Eval("Num") %>' CssClass="RowOrdenamiento" ></asp:Label>
|
<asp:Label ID="LblNum" runat="server" Text='<%# Eval("Num") %>' CssClass="RowOrdenamiento"></asp:Label>
|
||||||
<input type="hidden" name="OrdenMovimientos" value='<%# Eval("CveMovimiento") %>' />
|
<input type="hidden" name="OrdenMovimientos" value='<%# Eval("CveMovimiento") %>' />
|
||||||
|
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
@@ -288,6 +301,228 @@
|
|||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
</ContentTemplate>
|
||||||
|
</ajax:TabPanel>
|
||||||
|
|
||||||
|
|
||||||
|
<ajax:TabPanel ID="TabRecoleccion" runat="server" HeaderText="Recolección">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpDatosRecoleccion" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
|
||||||
|
<asp:GridView ID="GvDatosRecoleccion" runat="server" AutoGenerateColumns="False"
|
||||||
|
DataKeyNames="CveEntregaAlmacen,FechaIng,Nombre,NombreComercial,TipoDocto,Orden,CveDireccionOrigen,CveSubProyectoOrigen"
|
||||||
|
EmptyDataText="No se encontraron registros" ToolTip="Listado de recolecciones"
|
||||||
|
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||||
|
data-sort="true"
|
||||||
|
data-freezerows="1"
|
||||||
|
GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<%--<asp:BoundField HeaderText="SerieFolio" DataField="Serie Folio" HeaderStyle-Width="150px" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />--%>
|
||||||
|
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LblFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:dd/MM/yyyy}") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Cliente" HeaderStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LblNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Contacto" HeaderStyle-HorizontalAlign="Left">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LblContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:BoundField HeaderText="Dirección" DataField="Direccion" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Opciones">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkGvDatosRecoleccionEditar" runat="server" OnClick="LnkGvDatosRecoleccionEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-xs blue" Text="<i class='fa fa-pencil'></i>" />
|
||||||
|
<asp:LinkButton ID="LnkGvDatosRecoleccionEliminar" runat="server" CssClass="btn btn-circle btn-xs red" OnClick="LnkGvDatosRecoleccionEliminar_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar la recolección?" data-btn-ok-label="si"></asp:LinkButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
</Columns>
|
||||||
|
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</ajax:TabPanel>
|
||||||
|
|
||||||
|
|
||||||
|
</ajax:TabContainer>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="DivModalRecoleccion" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<asp:UpdatePanel ID="UpModalRecoleccion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title" id="H3" runat="server"> <asp:Literal runat="server" ID="LtlModalRecoleccionTitulo">Agregar Recolección</asp:Literal> </h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class=" col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlModalRecoleccionCliente" Width="100%" runat="server" DataTextField="Nombre" DataValueField="CveCliente" AutoPostBack="true" OnSelectedIndexChanged="DdlModalRecoleccionCliente_SelectedIndexChanged"
|
||||||
|
Class="form-control select2me">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<label for="<%= DdlModalRecoleccionCliente.ClientID.ToString()%>">Cliente:</label>
|
||||||
|
<i></i>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlModalRecoleccionCliente" runat="server" ControlToValidate="DdlModalRecoleccionCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente1''</b> es necesario." InitialValue="-1" ValidationGroup="GrpModalRecoleccionGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VceRfvDdlModalRecoleccionCliente" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModalRecoleccionCliente" Width="250px" PopupPosition="BottomLeft"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class=" col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlmodalRecoleccionDirecion" Width="100%" runat="server" DataTextField="EnvioDireccion" DataValueField="CveDireccionEnvio"
|
||||||
|
Class="form-control select2me">
|
||||||
|
</asp:DropDownList>
|
||||||
|
<label for="<%= DdlmodalRecoleccionDirecion.ClientID.ToString()%>">Dirección:</label>
|
||||||
|
<i></i>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlmodalRecoleccionDirecion" runat="server" ControlToValidate="DdlmodalRecoleccionDirecion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente1''</b> es necesario." InitialValue="-1" ValidationGroup="GrpModalRecoleccionGuardar"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VceRfvDdlmodalRecoleccionDirecion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlmodalRecoleccionDirecion" Width="250px" PopupPosition="BottomLeft"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<div class="row">
|
||||||
|
<div class=" col-md-2">
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright" style="max-width:85px">
|
||||||
|
<asp:TextBox ID="TxtModalRecoleccionCantidad" Width="50px" MaxLength="7" runat="server" TabIndex="1" CssClass="form-control"></asp:TextBox>
|
||||||
|
<label for="<%= TxtModalRecoleccionCantidad.ClientID.ToString()%>">Cantidad:</label>
|
||||||
|
<ajax:FilteredTextBoxExtender ID="FETxtModalRecoleccionCantidad" runat="server" TargetControlID="TxtModalRecoleccionCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
|
<asp:RequiredFieldValidator runat="server" ID="RfvTxtModalRecoleccionCantidad" ControlToValidate="TxtModalRecoleccionCantidad" ValidationGroup="GrpModalRecoleccionGuardaPS" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario por favor introdúzcalo." Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="CevRfvTxtModalRecoleccionCantidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtModalRecoleccionCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<asp:RangeValidator ID="RVTxtModalRecoleccionCantidad" runat="server" ControlToValidate="TxtModalRecoleccionCantidad" Display="None" Type="Double" MinimumValue="0.001" MaximumValue="2147483647" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor introdúzcalo." ValidationGroup="GrpModalRecoleccionGuardaPS"></asp:RangeValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCECantidad" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtModalRecoleccionCantidad" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class=" col-md-4">
|
||||||
|
<div class="form-group form-md-line-input input-iconright" >
|
||||||
|
<asp:DropDownList ID="DdlModalRecoleccionUnidad" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me" Style="width: 85px !important;"></asp:DropDownList>
|
||||||
|
<label for="<%= TxtModalRecoleccionCantidad.ClientID.ToString()%>">Unidad de Medida:</label>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvDdlModalRecoleccionUnidad" runat="server" ControlToValidate="DdlModalRecoleccionUnidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpModalRecoleccionGuardaPS"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VceRfvDdlModalRecoleccionUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModalRecoleccionUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class=" col-md-4">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<div class="psagregar">
|
||||||
|
<div class="comboxes">
|
||||||
|
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificaión/Producto:</label>
|
||||||
|
<asp:DropDownList ID="DdlClasificacion" runat="server" Width="100%" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me">
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlProducto_ValueChanged" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2" style="text-align:right!important">
|
||||||
|
<asp:LinkButton ID="LnkModalAgregarPS" runat="server" CssClass="Texto" ValidationGroup="GrpModalRecoleccionGuardaPS" Text="Agregar" OnClick="LnkModalAgregarPS_Click" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<asp:GridView ID="GvModalPSRecoleccion" DataKeyNames="CveEntregaAlmacenDetalle,CodigoPS,CvePS,CveUnidadMedida,Cantidad" runat="server"
|
||||||
|
ShowHeader="true" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
|
||||||
|
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-Width="86px" HeaderStyle-HorizontalAlign="Right" />
|
||||||
|
<asp:BoundField HeaderText="Unidad" DataField="Abreviatura" ItemStyle-Width="86px" />
|
||||||
|
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="500px" />
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkModalGvModalPSRecoleccionEliminar" runat="server" CssClass="btn btn-circle btn-xs red" OnClick="LnkModalGvModalPSRecoleccionEliminar_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el producto?" data-btn-ok-label="si"></asp:LinkButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:UpdatePanel runat="server">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:Button ID="BtnModalRecoleccionGuardar" runat="server" OnClick="BtnModalRecoleccionGuardar_Click" CssClass="btn btn-primary" Text="Agregar Recolección" ValidationGroup="GrpModalRecoleccionGuardar" />
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,27 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DataTable DTRecoleccion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ViewState["DTRecoleccion"] == null)
|
||||||
|
{
|
||||||
|
ViewState["DTRecoleccion"] = InitDTRecoleccion();
|
||||||
|
}
|
||||||
|
return (DataTable)ViewState["DTRecoleccion"];
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["DTRecoleccion"] = (DataTable)value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool SelecionEntrega
|
bool SelecionEntrega
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -64,18 +85,45 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int CveEntregaAlmacen
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
|
||||||
|
if (ViewState["CveEntregaAlmacen"] == null)
|
||||||
|
{
|
||||||
|
ViewState["CveEntregaAlmacen"] = -1;
|
||||||
|
}
|
||||||
|
return (int)ViewState["CveEntregaAlmacen"];
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["CveEntregaAlmacen"] = (int)value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SelecionEntrega = true;
|
SelecionEntrega = true;
|
||||||
|
|
||||||
CargaCombos();
|
CargaCombos();
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region RECOLEECION
|
||||||
|
CargaDatosRecoleccion();
|
||||||
|
CargaModalClasificaiones();
|
||||||
|
CargaModalDdlPS();
|
||||||
|
|
||||||
|
ModalRecoleccionCargaClientes();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,8 +131,6 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(DdlChofer.SelectedValue.ToEntero() <= 0)
|
if(DdlChofer.SelectedValue.ToEntero() <= 0)
|
||||||
{
|
{
|
||||||
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
@@ -132,7 +178,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
TieneError = true;
|
TieneError = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), row.DataKey("CveMovimiento").ToEntero(), CveDireccionOrigen, CveDireccionDestino, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "E",Orden);
|
int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), row.DataKey("CveMovimiento").ToEntero(), CveDireccionOrigen, CveDireccionDestino, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "E",Orden,0);
|
||||||
CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero();
|
CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero();
|
||||||
|
|
||||||
if (CveEntregaAlmacen > 0)
|
if (CveEntregaAlmacen > 0)
|
||||||
@@ -256,6 +302,33 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void CargaModalClasificaiones()
|
||||||
|
{
|
||||||
|
|
||||||
|
DdlClasificacion.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby: "Clasificacion");
|
||||||
|
DdlClasificacion.DataBind();
|
||||||
|
|
||||||
|
|
||||||
|
UpModalRecoleccion.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CargaModalDdlPS()
|
||||||
|
{
|
||||||
|
bool EsWS = UsuarioActual.Empresa.Funcionalidad(105) == "1" | UsuarioActual.Empresa.Funcionalidad(141) == "1" ? true : false;
|
||||||
|
DdlProducto2.setEsWebService(EsWS);
|
||||||
|
if (DdlProducto2.UsaWebService)
|
||||||
|
{
|
||||||
|
DdlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue);
|
||||||
|
}
|
||||||
|
else if (!DdlProducto2.UsaWebService && (DataTable)DdlProducto2.DataSource == null)
|
||||||
|
{
|
||||||
|
DdlProducto2.DataSource = get_GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion: DdlClasificacion.SelectedValue.ToEntero()).FiltraParametros("CveTipoPS = 2");
|
||||||
|
DdlProducto2.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void LnkGenerarDocumentos_Click(object sender, EventArgs e)
|
protected void LnkGenerarDocumentos_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SeleccioanrGenrar();
|
SeleccioanrGenrar();
|
||||||
@@ -307,20 +380,11 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
LnkGenerarDocumentos.Text = "Regresar a Preselección";
|
LnkGenerarDocumentos.Text = "Regresar a Preselección";
|
||||||
LnkGenerarDocumentos.CssClass = "btn btn-default";
|
LnkGenerarDocumentos.CssClass = "btn btn-default";
|
||||||
|
|
||||||
DVDatosEntrega1.Visible = true;
|
|
||||||
DVDatosEntrega2.Visible = true;
|
|
||||||
DVDatosEntrega3.Visible = true;
|
|
||||||
DVDatosEntrega4.Visible = true;
|
|
||||||
DVDatosEntrega5.Visible = true;
|
|
||||||
DVDatosEntrega6.Visible = true;
|
|
||||||
|
|
||||||
DVDatosEntrega7.Attributes.Add("class", "col-md-1");
|
|
||||||
|
|
||||||
if (UsuarioActual.Empresa.Funcionalidad(161).ToEntero() == 1)
|
|
||||||
{
|
OcultarmostarDatosEntrega(true);
|
||||||
DvCartaPorte1.Visible = true;
|
|
||||||
DvCartaPorte2.Visible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BtnConsultar.Visible = false;
|
BtnConsultar.Visible = false;
|
||||||
@@ -353,20 +417,9 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
SelecionEntrega = true;
|
SelecionEntrega = true;
|
||||||
LnkGenerarDocumentos.Text = "Preselección de Entregas";
|
LnkGenerarDocumentos.Text = "Preselección de Entregas";
|
||||||
LnkGenerarDocumentos.CssClass = "btn btn-primary";
|
LnkGenerarDocumentos.CssClass = "btn btn-primary";
|
||||||
DVDatosEntrega7.Attributes.Add("class", "col-md-9");
|
|
||||||
|
|
||||||
DVDatosEntrega1.Visible = false;
|
|
||||||
DVDatosEntrega2.Visible = false;
|
|
||||||
DVDatosEntrega3.Visible = false;
|
|
||||||
DVDatosEntrega4.Visible = false;
|
|
||||||
DVDatosEntrega5.Visible = false;
|
|
||||||
DVDatosEntrega6.Visible = false;
|
|
||||||
|
|
||||||
if (UsuarioActual.Empresa.Funcionalidad(161).ToEntero() == 1)
|
OcultarmostarDatosEntrega(false);
|
||||||
{
|
|
||||||
DvCartaPorte1.Visible = false;
|
|
||||||
DvCartaPorte2.Visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
BtnAsignar.Visible = false;
|
BtnAsignar.Visible = false;
|
||||||
DVGvGenerarDocumentos.Visible = false;
|
DVGvGenerarDocumentos.Visible = false;
|
||||||
@@ -379,6 +432,32 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void OcultarmostarDatosEntrega(bool mostrar )
|
||||||
|
{
|
||||||
|
DVDatosEntrega1.Visible = mostrar;
|
||||||
|
DVDatosEntrega2.Visible = mostrar;
|
||||||
|
DVDatosEntrega3.Visible = mostrar;
|
||||||
|
DVDatosEntrega4.Visible = mostrar;
|
||||||
|
DVDatosEntrega5.Visible = mostrar;
|
||||||
|
DVDatosEntrega6.Visible = mostrar;
|
||||||
|
|
||||||
|
if (mostrar)
|
||||||
|
{
|
||||||
|
DVDatosEntrega7.Attributes.Add("class", "col-md-1");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DVDatosEntrega7.Attributes.Add("class", "col-md-9");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (UsuarioActual.Empresa.Funcionalidad(161).ToEntero() == 1)
|
||||||
|
{
|
||||||
|
DvCartaPorte1.Visible = mostrar;
|
||||||
|
DvCartaPorte2.Visible = mostrar;
|
||||||
|
}
|
||||||
|
UpDatosEntrega.Update();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ActualizaOrdenDTGenrarDocumentos()
|
private void ActualizaOrdenDTGenrarDocumentos()
|
||||||
@@ -414,7 +493,410 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(Tab.ActiveTabIndex == 0)
|
||||||
{
|
{
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CargaDatosRecoleccion();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region RECOLECCION
|
||||||
|
|
||||||
|
|
||||||
|
private DataTable InitDTRecoleccion()
|
||||||
|
{
|
||||||
|
DataTable DT = new DataTable();
|
||||||
|
|
||||||
|
DT.Columns.Add("CveEntregaAlmacenDetalle", System.Type.GetType("System.Int32"));
|
||||||
|
DT.Columns.Add("CveEntregaAlmacen", System.Type.GetType("System.Int32"));
|
||||||
|
DT.Columns.Add("CvePS", System.Type.GetType("System.Int32"));
|
||||||
|
DT.Columns.Add("Cantidad", System.Type.GetType("System.Double"));
|
||||||
|
DT.Columns.Add("CveUnidadMedida", System.Type.GetType("System.Int32"));
|
||||||
|
DT.Columns.Add("CveUsuario",System.Type.GetType("System.Int32"));
|
||||||
|
DT.Columns.Add("FechaIng",System.Type.GetType("System.DateTime"));
|
||||||
|
DT.Columns.Add("CodigoPS", System.Type.GetType("System.String"));
|
||||||
|
DT.Columns.Add("Abreviatura", System.Type.GetType("System.String"));
|
||||||
|
|
||||||
|
return DT;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CargaDatosRecoleccion()
|
||||||
|
{
|
||||||
|
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||||
|
if (ObjGeneral.GetInvEntregaAlmacenRuta(DdlSubProyecto.SelectedValue.ToEntero(), TxtFechaI.Text.ToDate(), TxtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa, 2, 0))
|
||||||
|
{
|
||||||
|
GvDatosRecoleccion.DataSource = ObjGeneral.DtResultados;
|
||||||
|
}
|
||||||
|
ObjGeneral.Dispose();
|
||||||
|
GvDatosRecoleccion.DataBind();
|
||||||
|
UpDatosRecoleccion.Update();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void CargaDatosRecoleccionDetallePS()
|
||||||
|
{
|
||||||
|
if (CveEntregaAlmacen > 0)
|
||||||
|
{
|
||||||
|
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||||
|
|
||||||
|
if (ObjGenerales.GetEntregaAlmacenRutaDetalle(CveEntregaAlmacen))
|
||||||
|
{
|
||||||
|
GvModalPSRecoleccion.DataSource = ObjGenerales.DtResultados;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
GvModalPSRecoleccion.DataSource = null;
|
||||||
|
}
|
||||||
|
ObjGenerales.Dispose();
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
GvModalPSRecoleccion.DataSource = DTRecoleccion;
|
||||||
|
}
|
||||||
|
GvModalPSRecoleccion.DataBind();
|
||||||
|
UpModalRecoleccion.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ModalRecoleccionCargaClientes()
|
||||||
|
{
|
||||||
|
ClsClientes ObjCliente = new ClsClientes();
|
||||||
|
if (ObjCliente.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, 1))
|
||||||
|
{
|
||||||
|
DdlModalRecoleccionCliente.DataSource = ObjCliente.DtResultados;
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjCliente.Dispose();
|
||||||
|
DdlModalRecoleccionCliente.DataBind();
|
||||||
|
DdlModalRecoleccionCliente.Items.Insert(0, new ListItem("Seleccione uno", "-1"));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void DdlModalRecoleccionCliente_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ModalRecoleccionCargaDirecciones();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ModalRecoleccionCargaDirecciones()
|
||||||
|
{
|
||||||
|
if(DdlModalRecoleccionCliente.SelectedValue.ToEntero() > 0)
|
||||||
|
{
|
||||||
|
ClsClientes ObjClientes = new ClsClientes();
|
||||||
|
if (ObjClientes.DireccionEnvioGet(-1, DdlModalRecoleccionCliente.SelectedValue.ToEntero(), -1))
|
||||||
|
{
|
||||||
|
DdlmodalRecoleccionDirecion.DataSource = ObjClientes.DtResultados;
|
||||||
|
}
|
||||||
|
ObjClientes.Dispose();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DdlmodalRecoleccionDirecion.DataSource = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
DdlmodalRecoleccionDirecion.DataBind();
|
||||||
|
DdlmodalRecoleccionDirecion.Items.Insert(0, new ListItem("Seleccione una", "-1"));
|
||||||
|
|
||||||
|
UpModalRecoleccion.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void LnkAgregarRecoleccion_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (DdlChofer.SelectedValue.ToEntero() <= 0)
|
||||||
|
{
|
||||||
|
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
|
||||||
|
{
|
||||||
|
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LtlModalRecoleccionTitulo.Text = "Agregar Recoleccion";
|
||||||
|
BtnModalRecoleccionGuardar.Text = "Agregar";
|
||||||
|
|
||||||
|
LimpiarModalRecoleccion();
|
||||||
|
RegistraScript("$('#DivModalRecoleccion').modal('show');");
|
||||||
|
CveEntregaAlmacen = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkGvDatosRecoleccionEditar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LinkButton LnkEliminar = (LinkButton)sender;
|
||||||
|
GridViewRow GvRow = (GridViewRow)LnkEliminar.NamingContainer;
|
||||||
|
|
||||||
|
CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
|
||||||
|
int CveDireccionOrigen = GvRow.DataKey("CveDireccionOrigen").ToEntero();
|
||||||
|
int CveClienteEnvio = -1;
|
||||||
|
ClsClientes ObjClientes = new ClsClientes();
|
||||||
|
DataTable DtTempDirecciones = new DataTable();
|
||||||
|
|
||||||
|
if (ObjClientes.DireccionEnvioGet(CveDireccionOrigen, -1, -1))
|
||||||
|
{
|
||||||
|
CveClienteEnvio = ObjClientes.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero();
|
||||||
|
|
||||||
|
if (ObjClientes.DireccionEnvioGet(-1, CveClienteEnvio, -1))
|
||||||
|
{
|
||||||
|
DdlmodalRecoleccionDirecion.DataSource = ObjClientes.DtResultados;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ObjClientes.Dispose();
|
||||||
|
|
||||||
|
DdlmodalRecoleccionDirecion.DataBind();
|
||||||
|
DdlmodalRecoleccionDirecion.Items.Add(new ListItem("Seleccione una", "-1"));
|
||||||
|
DdlmodalRecoleccionDirecion.SelectedValueExist(CveDireccionOrigen);
|
||||||
|
|
||||||
|
DdlModalRecoleccionCliente.SelectedValueExist(CveClienteEnvio);
|
||||||
|
|
||||||
|
|
||||||
|
CargaDatosRecoleccionDetallePS();
|
||||||
|
|
||||||
|
|
||||||
|
LtlModalRecoleccionTitulo.Text = "Actualizar Recolección";
|
||||||
|
BtnModalRecoleccionGuardar.Text = "Actualizar";
|
||||||
|
UpModalRecoleccion.Update();
|
||||||
|
|
||||||
|
RegistraScript("$('#DivModalRecoleccion').modal('show');");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LimpiarModalRecoleccion()
|
||||||
|
{
|
||||||
|
|
||||||
|
DdlModalRecoleccionCliente.SelectedValueExist(-1);
|
||||||
|
DdlmodalRecoleccionDirecion.SelectedValueExist(-1);
|
||||||
|
TxtModalRecoleccionCantidad.Text = "";
|
||||||
|
DdlModalRecoleccionUnidad.Items.Clear();
|
||||||
|
DdlModalRecoleccionUnidad.Items.Add(new ListItem("Seleccione una","-1"));
|
||||||
|
DdlProducto2.txtValue.Value = "";
|
||||||
|
DdlProducto2.txtText.Value = "";
|
||||||
|
|
||||||
|
DTRecoleccion.Rows.Clear();
|
||||||
|
GvModalPSRecoleccion.DataSource = DTRecoleccion;
|
||||||
|
GvModalPSRecoleccion.DataBind();
|
||||||
|
|
||||||
|
|
||||||
|
UpModalRecoleccion.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void DdlProducto_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ElProductoChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ElProductoChange()
|
||||||
|
{
|
||||||
|
DdlModalRecoleccionUnidad.Items.Clear();
|
||||||
|
DdlModalRecoleccionUnidad.DataSource = get_GlobalDTProductosServiciosEquivalencias(DdlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa);
|
||||||
|
DdlModalRecoleccionUnidad.DataBind();
|
||||||
|
UpModalRecoleccion.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void BtnModalRecoleccionGuardar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (DdlChofer.SelectedValue.ToEntero() <= 0)
|
||||||
|
{
|
||||||
|
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
|
||||||
|
{
|
||||||
|
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int CveTimbrenuevo = -1;
|
||||||
|
bool ProcesoOK = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int CveSubProyectoCliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1, DdlModalRecoleccionCliente.SelectedValue.ToEntero()).FiltroPrimeroValor("CveSubProyecto").ToEntero();
|
||||||
|
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||||
|
ObjGenerales.IniciaTransacSQL();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if( CveEntregaAlmacen == -1)
|
||||||
|
{
|
||||||
|
CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(CveSubProyectoCliente, -1, DdlmodalRecoleccionDirecion.SelectedValue.ToEntero(), -1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "R", 1,0);
|
||||||
|
if (CveEntregaAlmacen > 0)
|
||||||
|
{
|
||||||
|
CveTimbrenuevo = ObjGenerales.AddGralTimbre("Tra", "-1", -1, "-1", new DateTime(1900, 01, 01), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, CveSubProyectoCliente);
|
||||||
|
|
||||||
|
if (CveTimbrenuevo > 0)
|
||||||
|
{
|
||||||
|
foreach (DataRow dRow in DTRecoleccion.Rows)
|
||||||
|
{
|
||||||
|
if(ObjGenerales.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen,dRow["CvePS"].ToString().ToEntero(), dRow["Cantidad"].ToString().ToDecimal(),dRow["CveUnidadMedida"].ToString().ToEntero(), UsuarioActual.CveUsuario))
|
||||||
|
{
|
||||||
|
ProcesoOK = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
ProcesoOK = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
if(ObjGenerales.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen,DdlmodalRecoleccionDirecion.SelectedValue.ToEntero(),-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(),TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
ProcesoOK = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ProcesoOK = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (ProcesoOK)
|
||||||
|
{
|
||||||
|
ObjGenerales.Commit();
|
||||||
|
Alert("Recolección Guardada correctamente.");
|
||||||
|
RegistraScript("$('#DivModalRecoleccion').modal('hide');");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ObjGenerales.RollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjGenerales.Dispose();
|
||||||
|
CargaDatosRecoleccion();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkGvDatosRecoleccionEliminar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LinkButton LnkEliminar = (LinkButton)sender;
|
||||||
|
GridViewRow GvRow = (GridViewRow)LnkEliminar.NamingContainer;
|
||||||
|
|
||||||
|
int CveEntregaAlmacenEliminar = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
|
||||||
|
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||||
|
if (ObjGenerales.RemoveInvEntregaAlmacenRuta(CveEntregaAlmacenEliminar, UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
Alert("Producto Eliminado correctamente.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjGenerales.Dispose();
|
||||||
|
CargaDatosRecoleccion();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
protected void LnkModalGvModalPSRecoleccionEliminar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LinkButton LnkEliminar = (LinkButton)sender;
|
||||||
|
GridViewRow GvRow = (GridViewRow)LnkEliminar.NamingContainer;
|
||||||
|
|
||||||
|
if (CveEntregaAlmacen > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
int CveEntregaAlmacenDetalleEliminar = GvRow.DataKey("CveEntregaAlmacenDetalle").ToEntero();
|
||||||
|
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||||
|
|
||||||
|
if (ObjGenerales.RemoveEntregaAlmacenRutaDetalle(CveEntregaAlmacenDetalleEliminar))
|
||||||
|
{
|
||||||
|
Alert("Recolección Eliminada correctamente.");
|
||||||
|
}
|
||||||
|
ObjGenerales.Dispose();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int DTIndex = GvRow.RowIndex;
|
||||||
|
DTRecoleccion.Rows[DTIndex].Delete();
|
||||||
|
DTRecoleccion.AcceptChanges();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CargaDatosRecoleccionDetallePS();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LnkModalAgregarPS_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(CveEntregaAlmacen > 0)
|
||||||
|
{
|
||||||
|
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||||
|
|
||||||
|
if(ObjGenerales.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen,DdlProducto2.SelectedValue.ToEntero(), TxtModalRecoleccionCantidad.Text.ToEntero(), DdlModalRecoleccionUnidad.SelectedValue.ToEntero(), UsuarioActual.CveUsuario))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
ObjGenerales.Dispose();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataRow dRow = DTRecoleccion.NewRow() ;
|
||||||
|
|
||||||
|
dRow["CveEntregaAlmacenDetalle"] = -1;
|
||||||
|
dRow["CveEntregaAlmacen"] = CveEntregaAlmacen;
|
||||||
|
dRow["CvePS"] = DdlProducto2.SelectedValue.ToEntero();
|
||||||
|
dRow["Cantidad"] =TxtModalRecoleccionCantidad.Text.ToEntero();
|
||||||
|
dRow["CveUnidadMedida"] = DdlModalRecoleccionUnidad.SelectedValue.ToEntero();
|
||||||
|
dRow["CveUsuario"] =UsuarioActual.CveUsuario;
|
||||||
|
dRow["FechaIng"] = DateTime.Now;
|
||||||
|
dRow["CodigoPS"] = DdlProducto2.txtText.Value;
|
||||||
|
dRow["Abreviatura"] =DdlModalRecoleccionUnidad.SelectedItem.Text;
|
||||||
|
|
||||||
|
DTRecoleccion.Rows.Add(dRow);
|
||||||
|
//GvModalPSRecoleccion.DataSource = DTRecoleccion;
|
||||||
|
}
|
||||||
|
|
||||||
|
LimpiarControlesPS();
|
||||||
|
CargaDatosRecoleccionDetallePS();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void LimpiarControlesPS()
|
||||||
|
{
|
||||||
|
TxtModalRecoleccionCantidad.Text = "";
|
||||||
|
DdlModalRecoleccionUnidad.Items.Clear();
|
||||||
|
DdlProducto2.txtText.Value = "";
|
||||||
|
DdlProducto2.txtValue.Value = "";
|
||||||
|
UpModalRecoleccion.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void Tab_ActiveTabChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(Tab.ActiveTabIndex == 0)
|
||||||
|
{
|
||||||
|
SelecionEntrega = false;
|
||||||
|
SeleccioanrGenrar();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OcultarmostarDatosEntrega(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -141,16 +141,48 @@
|
|||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 325px;" runat="server" visible="False">
|
<div id="DivMedRin" style="overflow-y: auto; width: 765px; height: 325px;" runat="server" visible="False">
|
||||||
<asp:GridView ID="GvMedRin" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos encontrados." CssClass="table table-striped table-hover" GridLines="None">
|
<asp:GridView ID="GvMedRin" Width="100%" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" CssClass="table table-striped table-hover" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />
|
<asp:BoundField DataField="Almacen" HeaderText="Almacén" />
|
||||||
<asp:BoundField DataField="UnidadMedida" HeaderText="Unidad de Medida" />
|
<%--<asp:BoundField DataField="UnidadMedida" HeaderText="Unidad" />--%>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<HeaderTemplate>
|
||||||
|
<asp:Label ID="LblUMH" runat="server" ToolTip="Unidad de Medida" Text="U.M"></asp:Label>
|
||||||
|
</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LblUM" runat="server" Text='<%# Eval("UnidadMedida") %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:BoundField DataField="Existencia" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia" DataFormatString="{0:#,###.######}" />
|
<asp:BoundField DataField="Existencia" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia" DataFormatString="{0:#,###.######}" />
|
||||||
<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Surtir" DataFormatString="{0:#,###.######}" />
|
<%--<asp:BoundField DataField="PendientePorSurtir" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Surtir" DataFormatString="{0:#,###.######}" /> --%>
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||||
|
<HeaderTemplate>
|
||||||
|
<asp:Label ID="LblPPPH" runat="server" ToolTip="Pendiente Por Surtir" Text="Pendiente <br/> Por Surtir"></asp:Label>
|
||||||
|
</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LblPP" runat="server" Text='<%# String.Format("{0:#,###.######}", Eval("PendientePorSurtir")) %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" />
|
<asp:BoundField DataField="ExistenciaFinal" ItemStyle-HorizontalAlign="Right" HeaderText="Existencia Real" DataFormatString="{0:#,###.######}" />
|
||||||
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Neto" DataFormatString="{0:N2}"/>
|
<asp:BoundField DataField="Importe" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Neto" DataFormatString="{0:N2}"/>
|
||||||
<asp:BoundField DataField="ImportePromocion" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Promoción" DataFormatString="{0:N2}"/>
|
<%--<asp:BoundField DataField="ImportePromocion" ItemStyle-HorizontalAlign="Right" HeaderText="Precio Promoción" DataFormatString="{0:N2}"/>--%>
|
||||||
<asp:BoundField DataField="CantidadMinimaPromo" ItemStyle-HorizontalAlign="Right" HeaderText="Cant. Min. Promo" DataFormatString="{0:N0}"/>
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||||
|
<HeaderTemplate>
|
||||||
|
<asp:Label ID="LblPH" runat="server" ToolTip="Precio Promoción" Text="Precio <br/> Promoción"></asp:Label>
|
||||||
|
</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LblP" runat="server" Text='<%# String.Format("{0:N2}", Eval("ImportePromocion")) %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<%--<asp:BoundField DataField="CantidadMinimaPromo" ItemStyle-HorizontalAlign="Right" HeaderText="Cant. Min. Promo" DataFormatString="{0:N0}"/>--%>
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
|
||||||
|
<HeaderTemplate>
|
||||||
|
<asp:Label ID="LblCMPH" runat="server" ToolTip="Cantidad Mínima Promoción" Text="Cant. Min. <br/> Promoción"></asp:Label>
|
||||||
|
</HeaderTemplate>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label ID="LblCMP" runat="server" Text='<%# String.Format("{0:N0}", Eval("CantidadMinimaPromo")) %>'></asp:Label>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Recibir" DataFormatString="{0:#,###.######}" Visible="false"/>
|
<asp:BoundField DataField="CantidadDisponibleInv" ItemStyle-HorizontalAlign="Right" HeaderText="Pendiente Por Recibir" DataFormatString="{0:#,###.######}" Visible="false"/>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
|||||||
@@ -497,7 +497,8 @@ Partial Class Inventarios_RepAnomalias
|
|||||||
|
|
||||||
|
|
||||||
Private Sub LnkDescarExcelGrupos_Click(sender As Object, e As EventArgs) Handles LnkDescarExcelGrupos.Click
|
Private Sub LnkDescarExcelGrupos_Click(sender As Object, e As EventArgs) Handles LnkDescarExcelGrupos.Click
|
||||||
GvGrupos.ExportToExcelGembox("Reporte de Inventario Fisico" & Now.ToShortDateString, UsuarioActual, "", "", "Inventario:" & lbTitulo.Text, "", 1)
|
Dim Filtros As String = "Almacenes:aASDSAF|Clasificaciones:sdfasf|Fecha:12/12/2323"
|
||||||
|
GvGrupos.ExportToExcelGembox("Reporte de Inventario Fisico" & Now.ToShortDateString, UsuarioActual, "Inventario:" & lbTitulo.Text, "", DatosFiltros:=Filtros)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Alert("Error en la aceptación: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
Alert("Error en la aceptación: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
||||||
|
this.GuardaLog(resp.Descripcion);
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
@@ -118,7 +119,8 @@ public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Alert(ex.ToString(), ModExtensiones.TipoMensaje.MsgError);
|
this.OnError("Ocurrió un error al aceptar la cancelación", ex);
|
||||||
|
//Alert(ex.ToString(), ModExtensiones.TipoMensaje.MsgError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected void btnRechazar_Click(object sender, EventArgs e)
|
protected void btnRechazar_Click(object sender, EventArgs e)
|
||||||
@@ -152,12 +154,14 @@ public partial class Ventas_RepCancelacionesPorAtender : ClsPaginas
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Alert("Error en la aceptación: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
Alert("Error en la aceptación: " + resp.Descripcion, ModExtensiones.TipoMensaje.MsgError);
|
||||||
|
this.GuardaLog(resp.Descripcion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Alert(ex.ToString(), ModExtensiones.TipoMensaje.MsgError);
|
//Alert(ex.ToString(), ModExtensiones.TipoMensaje.MsgError);
|
||||||
|
this.OnError("Ocurrió un error al rechazar la cancelación", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string DecodeBase64(string strXMLCodificado)
|
private string DecodeBase64(string strXMLCodificado)
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
var resp = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total);
|
var resp = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total);
|
||||||
if (resp.EnviarAcuse)
|
if (resp.EnviarAcuse)
|
||||||
{
|
{
|
||||||
Alert(resp.Mensaje,TipoMensaje.MsgConfirmacion,"BtnEnviarMailCancelacion();");
|
Alert(resp.Mensaje,TipoMensaje.MsgConfirmacion,"BtnEnviarMailCancelacion();",TextoConfirmacion:"Enviar",TextoSegundoBoton:"Cancelar");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
padding: 0px 5px;
|
padding: 0px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nolineheight {line-height: 1;
|
.nolineheight { line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.claseesconder {
|
.claseesconder {
|
||||||
@@ -1048,7 +1048,6 @@
|
|||||||
<asp:Literal Text="" runat="server" ID="LtlClienteMsg"></asp:Literal>
|
<asp:Literal Text="" runat="server" ID="LtlClienteMsg"></asp:Literal>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</th>
|
</th>
|
||||||
<%--<th style="text-align: center;">
|
<%--<th style="text-align: center;">
|
||||||
<asp:LinkButton ID="LbVerInventario" ClientIDMode="Static" runat="server" CssClass="btn btn-circle btn-sm purple" Text="<i class='icon-magnifier'></i>"></asp:LinkButton>
|
<asp:LinkButton ID="LbVerInventario" ClientIDMode="Static" runat="server" CssClass="btn btn-circle btn-sm purple" Text="<i class='icon-magnifier'></i>"></asp:LinkButton>
|
||||||
@@ -6438,9 +6437,6 @@
|
|||||||
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
|
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>
|
|
||||||
<asp:CheckBox ID="ChkAllCxC" CssClass="gvcxcAllChe" onclick="chkSeleccionarNC();" runat="server" />
|
|
||||||
</HeaderTemplate>
|
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:CheckBox ID="ChkCxC" CssClass="gvcxcChe" runat="server" />
|
<asp:CheckBox ID="ChkCxC" CssClass="gvcxcChe" runat="server" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
@@ -7658,12 +7654,6 @@
|
|||||||
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
//$('body').on('click', '.gvcxcAllChe input', function () { });
|
|
||||||
|
|
||||||
function chkSeleccionarNC() {
|
|
||||||
$(".gvcxcChe input").not(this).click();
|
|
||||||
}
|
|
||||||
|
|
||||||
//FUNCIONES PARA COMERCIO EXTERIOR
|
//FUNCIONES PARA COMERCIO EXTERIOR
|
||||||
function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) {
|
function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) {
|
||||||
TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2);
|
TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2);
|
||||||
@@ -8315,17 +8305,6 @@
|
|||||||
Entro = 1;
|
Entro = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
<%-- if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
|
|
||||||
let ImporteRestante = ToDouble($get('TxtImportesRemisionesNC').value) - ToDouble($get('TxtNCImporte').value)
|
|
||||||
if (ImporteRestante > 0) {
|
|
||||||
if (ImporteRestante < ImporteNuevo) {
|
|
||||||
ImporteNuevo = ImporteRestante;
|
|
||||||
}
|
|
||||||
Entro = 1;
|
|
||||||
}else {
|
|
||||||
ImporteNuevo = 0;
|
|
||||||
}
|
|
||||||
}--%>
|
|
||||||
|
|
||||||
if (ImporteNuevo > Saldo) {
|
if (ImporteNuevo > Saldo) {
|
||||||
ImporteNuevo = Saldo;
|
ImporteNuevo = Saldo;
|
||||||
|
|||||||
@@ -2471,15 +2471,15 @@ Partial Class Ventas
|
|||||||
LnkImprimirFormatoTelcel.Visible = True
|
LnkImprimirFormatoTelcel.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
||||||
' Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
' If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
' If ObjInventario.DtResultados.Rows.Count > 0 Then
|
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||||
' DivDevAlm.Visible = True
|
DivDevAlm.Visible = True
|
||||||
' End If
|
End If
|
||||||
' End If
|
End If
|
||||||
' ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
'End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -2806,7 +2806,7 @@ Partial Class Ventas
|
|||||||
CargaFormatoSucursal()
|
CargaFormatoSucursal()
|
||||||
|
|
||||||
InicializaDevolucionAlmacen()
|
InicializaDevolucionAlmacen()
|
||||||
'CargaOtrosConceptos()
|
CargaOtrosConceptos()
|
||||||
CargaFacturaOC()
|
CargaFacturaOC()
|
||||||
|
|
||||||
'SELECCIONA SUCURSAL DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE
|
'SELECCIONA SUCURSAL DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE
|
||||||
@@ -5652,6 +5652,7 @@ Partial Class Ventas
|
|||||||
EnviarCorreoCliente = ObjCliente.EnviarFactura
|
EnviarCorreoCliente = ObjCliente.EnviarFactura
|
||||||
EstatusCliente = ObjCliente.Estatus
|
EstatusCliente = ObjCliente.Estatus
|
||||||
|
|
||||||
|
Me.PermiteCredito = ObjCliente.PermiteCredito
|
||||||
LnkAgregarCliente.Visible = False
|
LnkAgregarCliente.Visible = False
|
||||||
|
|
||||||
ClienteEsDistribuidor = Boolean.Parse(ObjCliente.DtResultados.Rows(0)("EsDistribuidor").ToString())
|
ClienteEsDistribuidor = Boolean.Parse(ObjCliente.DtResultados.Rows(0)("EsDistribuidor").ToString())
|
||||||
@@ -5744,17 +5745,10 @@ Partial Class Ventas
|
|||||||
ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal
|
ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal
|
||||||
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
||||||
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
|
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
|
||||||
ViewState("ClienteNODesglosaIVA") = ObjCliente.NoDesglosaIVA
|
|
||||||
|
|
||||||
If Not ClienteDesglosaIEPS Then
|
If Not ClienteDesglosaIEPS Then
|
||||||
DivClienteMsg.Visible = True
|
DivClienteMsg.Visible = True
|
||||||
LtlClienteMsg.Text = "Cálculo sin desglose de IEPS"
|
LtlClienteMsg.Text = "Cálculo sin desglose de IEPS"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ClienteNODesglosaIVA Then
|
|
||||||
DivClienteMsg.Visible = True
|
|
||||||
LtlClienteMsg.Text += "Cálculo NO desglosa IVA"
|
|
||||||
End If
|
|
||||||
ViewState("CargoUsado") = ObjCliente.CargoUsados
|
ViewState("CargoUsado") = ObjCliente.CargoUsados
|
||||||
|
|
||||||
Dim dr As DataRow = Nothing
|
Dim dr As DataRow = Nothing
|
||||||
@@ -5772,7 +5766,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'HABILITA LA OPCION DE DIRECCION DE ENVIO
|
'HABILITA LA OPCION DE DIRECCION DE ENVIO
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 119, 140) Then
|
If UsuarioActual.CveEmpresa.Contiene(1, 72, 119) Then
|
||||||
trDireccionEnvio.Visible = True
|
trDireccionEnvio.Visible = True
|
||||||
CargaDireccionesEnvio()
|
CargaDireccionesEnvio()
|
||||||
End If
|
End If
|
||||||
@@ -6006,7 +6000,7 @@ Partial Class Ventas
|
|||||||
TrAtencionA.Visible = True
|
TrAtencionA.Visible = True
|
||||||
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
|
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
|
||||||
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
|
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
|
||||||
Me.PermiteCredito = ObjCliente.PermiteCredito
|
|
||||||
|
|
||||||
LbAgregar.Enabled = True
|
LbAgregar.Enabled = True
|
||||||
LnkAgregarPyME.Enabled = True
|
LnkAgregarPyME.Enabled = True
|
||||||
@@ -6086,6 +6080,8 @@ Partial Class Ventas
|
|||||||
UpModalRemisionesNC.Update()
|
UpModalRemisionesNC.Update()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
CargaFacturasARelacionar()
|
||||||
|
|
||||||
If RequiereOC Then
|
If RequiereOC Then
|
||||||
Dim Documentacion As String = ""
|
Dim Documentacion As String = ""
|
||||||
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
|
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
|
||||||
@@ -6352,7 +6348,9 @@ Partial Class Ventas
|
|||||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
|
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
|
||||||
End If
|
End If
|
||||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
|
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
|
||||||
If Opcion = 1 Then
|
|
||||||
|
'SI ES AUTORIZACION DEBE PERMITIR GENERARLA
|
||||||
|
If Opcion = 1 AndAlso (Not DdlTipoComprobante.SelectedValue.Contiene("PA")) Then
|
||||||
BtnEmitirImprimir.Visible = False
|
BtnEmitirImprimir.Visible = False
|
||||||
BtnsFacturar.Visible = False
|
BtnsFacturar.Visible = False
|
||||||
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
|
||||||
@@ -6361,6 +6359,7 @@ Partial Class Ventas
|
|||||||
LnkCotizaciones.Visible = False
|
LnkCotizaciones.Visible = False
|
||||||
LnkOCs.Visible = False
|
LnkOCs.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
' el cliente tiene crédito disponible, no tiene bloqueo
|
' el cliente tiene crédito disponible, no tiene bloqueo
|
||||||
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
|
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
|
||||||
@@ -6511,13 +6510,14 @@ Partial Class Ventas
|
|||||||
Vta.Dispose()
|
Vta.Dispose()
|
||||||
If Opcion > 0 Then
|
If Opcion > 0 Then
|
||||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
|
||||||
BtnsFacturar.Visible = False
|
BtnsFacturar.Visible = False
|
||||||
BtnGenerarRemision.Visible = False
|
BtnGenerarRemision.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
UPPCreditoDisponible.Update()
|
UPPCreditoDisponible.Update()
|
||||||
|
|
||||||
'Puede hacer pedido
|
'Puede hacer pedido
|
||||||
@@ -6868,7 +6868,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim CveSATNC = "84111506"
|
Dim CveSATNC = "84111506"
|
||||||
Dim dtt As New DataTable
|
Dim dtt As New DataTable
|
||||||
dtt = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CodigoSATPS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
|
dtt = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
|
||||||
|
|
||||||
If dtt IsNot Nothing Then
|
If dtt IsNot Nothing Then
|
||||||
DdlNCPS.DataSource = dtt
|
DdlNCPS.DataSource = dtt
|
||||||
@@ -12577,7 +12577,7 @@ Partial Class Ventas
|
|||||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||||
|
|
||||||
If importeMovimiento <> 0 Then
|
If importeMovimiento <> 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
Exit For
|
Exit For
|
||||||
Else
|
Else
|
||||||
@@ -12601,7 +12601,7 @@ Partial Class Ventas
|
|||||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||||
|
|
||||||
If importeMovimiento <> 0 Then
|
If importeMovimiento <> 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
Exit For
|
Exit For
|
||||||
Else
|
Else
|
||||||
@@ -13612,7 +13612,7 @@ Partial Class Ventas
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140, 141}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119,140}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString().ToEntero() < 1 Then
|
||||||
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||||
If Existencia < Cantidad Then
|
If Existencia < Cantidad Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
@@ -16875,7 +16875,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
|
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
|
||||||
'VALIDA EXISTENCIA
|
'VALIDA EXISTENCIA
|
||||||
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140, 153}) Then
|
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153,140}) Then
|
||||||
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
|
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
|
||||||
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
||||||
Return False
|
Return False
|
||||||
@@ -21621,19 +21621,17 @@ Partial Class Ventas
|
|||||||
If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||||
CargaGVInv(ObjInv.DtResultados)
|
CargaGVInv(ObjInv.DtResultados)
|
||||||
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
|
|
||||||
|
|
||||||
DivDevAlm.Visible = True
|
|
||||||
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjInv.Dispose()
|
ObjInv.Dispose()
|
||||||
|
|
||||||
'si es la empresa 119, Candado, no permiter refacturar, si no se ha surtido, para que cancele la factura mejor.
|
'si es la empresa 119, Candado, no permite refacturar, si no se ha surtido y que no sea refacturación, para que cancele la factura mejor.
|
||||||
If UsuarioActual.CveEmpresa = 119 AndAlso LkRefacturacion.Visible AndAlso VentaSaldoAlmacen = 0 Then
|
If UsuarioActual.CveEmpresa = 119 AndAlso LkRefacturacion.Visible AndAlso VentaSaldoAlmacen = 0 And CveVentaPadre <= 0 Then
|
||||||
LkRefacturacion.Visible = False
|
LkRefacturacion.Visible = False
|
||||||
End If
|
End If
|
||||||
|
If UsuarioActual.CveEmpresa = 119 AndAlso CveVenta = 620098 Then
|
||||||
|
LkRefacturacion.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaGVInv(DtTemporal As DataTable)
|
Private Sub CargaGVInv(DtTemporal As DataTable)
|
||||||
@@ -21781,7 +21779,7 @@ Partial Class Ventas
|
|||||||
DdlDireccionEnvio.Items.Clear()
|
DdlDireccionEnvio.Items.Clear()
|
||||||
If ObjClientes.DireccionEnvioGet(-1, CveCliente, CveClienteSucursal) Then
|
If ObjClientes.DireccionEnvioGet(-1, CveCliente, CveClienteSucursal) Then
|
||||||
DdlDireccionEnvio.DataSource = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1"))
|
DdlDireccionEnvio.DataSource = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1"))
|
||||||
|
DdlDireccionEnvio.DataBind()
|
||||||
'DdlDireccionEnvio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
'DdlDireccionEnvio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
TmpDTEnvioDireccion = ObjClientes.DtResultados
|
TmpDTEnvioDireccion = ObjClientes.DtResultados
|
||||||
Else
|
Else
|
||||||
@@ -21793,7 +21791,6 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ObjClientes.Dispose()
|
ObjClientes.Dispose()
|
||||||
DdlDireccionEnvio.DataBind()
|
|
||||||
UpCliente.Update()
|
UpCliente.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -23559,15 +23556,13 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
DdlMarca.Items.Clear()
|
DdlMarca.Items.Clear()
|
||||||
DdlMarcaPSDes.Items.Clear()
|
DdlMarcaPSDes.Items.Clear()
|
||||||
|
Dim ObjMarcas As New ClsProductosServicios
|
||||||
Dim dt As DataTable = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
|
||||||
|
DdlMarca.DataSource = ObjMarcas.DtResultados
|
||||||
DdlMarca.DataSource = dt
|
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
|
||||||
DdlMarcaPSDes.DataSource = dt
|
ObjMarcas.Dispose()
|
||||||
|
|
||||||
DdlMarca.DataBind()
|
DdlMarca.DataBind()
|
||||||
DdlMarcaPSDes.DataBind()
|
DdlMarcaPSDes.DataBind()
|
||||||
dt.Dispose()
|
|
||||||
End If
|
End If
|
||||||
DdlMarca.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlMarca.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
DdlMarcaPSDes.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlMarcaPSDes.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
|||||||
Reference in New Issue
Block a user