This commit is contained in:
rakcsle
2022-04-06 11:27:20 -07:00
25 changed files with 2676 additions and 1262 deletions

View File

@@ -3684,7 +3684,7 @@ Public Class ClsGenerales
Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0,
Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False) As Integer
Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False, Optional CveVenta As Integer = -1) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Gral_TimbreAdd")
@@ -3701,6 +3701,7 @@ Public Class ClsGenerales
.Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
.Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -3722,7 +3723,7 @@ Public Class ClsGenerales
Return Retorno
End Function
Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer) As Boolean
Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer, Optional CveVenta As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreGet")
@@ -3734,7 +3735,7 @@ Public Class ClsGenerales
.Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With
Try

View File

@@ -3547,6 +3547,24 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetSaldoVentaDetalleAlmacen(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleSaldoAlmacen")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener datos de almacen por detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetMovimientosDevoluciones(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleAlmacenDevolucion")

View File

@@ -529,7 +529,7 @@ Public Class ClsVentas
Optional TipoDocto As String = "Cot", Optional Vigencia As Date = MinFecha, Optional CondicionesPago As Integer = -1,
Optional AtencionA As String = "-1", Optional PedidoContrato As String = "-1", Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1,
Optional CveCliente As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional OrdenCompra As String = "-1", Optional RetIVA As Double = -1,
Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False) As Boolean
Optional RetISR As Double = -1, Optional Kilometraje As Double = 0, Optional CveUsoCFDi As Integer = -1, Optional ServicioDomicilio As Boolean = False, Optional CveVendedor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUpdate")
@@ -562,6 +562,7 @@ Public Class ClsVentas
.Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje
.Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi
.Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
End With
Try
@@ -1014,13 +1015,14 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function ObtenerClienteLimitesVenta(CveCliente As Integer, CveEmpresa As Integer) As Integer
Public Function ObtenerClienteLimitesVenta(CveCliente As Integer, CveEmpresa As Integer, Optional TipoVerificacion As Integer = -1) As Integer
Dim Retorno As Integer = 0
DataAdapter("PA_Vta_ClientesLimitesVentaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@TipoVerificacion", SqlDbType.Int).Value = TipoVerificacion
.Add("@Opcion", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@OpcionMsg", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output
End With
@@ -5334,7 +5336,7 @@ Public Class ClsVentas
#End Region
Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0) As Boolean
Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0, Optional Motivo As String = "") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesAdd")
With SqlAdapter.SelectCommand.Parameters
@@ -5347,6 +5349,7 @@ Public Class ClsVentas
.Add("@TipoAutorizacion", SqlDbType.Int).Value = TipoAutorizacion
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
.Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos
.Add("@Motivo", SqlDbType.VarChar).Value = Motivo
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -400,8 +400,8 @@ Namespace Modelos
Me.VentaDesglosaIEPS = True
End If
SetTotales(ObjVentas.DtResultados, ObjVentas)
End If
End If
End If
If ObjVentas.GetVentaDetalle(CveVenta) Then
Me.DtDetalle = ObjVentas.DtResultados.Copy()
End If
@@ -2208,12 +2208,11 @@ Namespace Modelos
If DtMovimientosEntrada IsNot Nothing Then
For Each Dr As DataRow In DtMovimientosEntrada.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, Observaciones:=Dr("Observaciones").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
CveMovimiento = -1
Exit For
End If
Next
DtMovimientosEntrada.Dispose()
DtMovimientosEntrada = Nothing
End If
@@ -5389,9 +5388,9 @@ Namespace Modelos
If DtVirtuales IsNot Nothing Then
For Each RowVirtual As DataRow In DtVirtuales.Rows
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL
If Not ErrorCancelar AndAlso Not GeneraMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then
If Not ErrorCancelar AndAlso Not CancelarMovimientosVirtuales(CveVenta, CveMovimientoDevolucion, RowVirtual("CveMovimiento").ToString().ToEntero(), ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
MensajeError = "Ocurrió un error al realizar la devolución del virtual. Por favor vuelva a intentar."
End If
Next
End If
@@ -5419,20 +5418,85 @@ Namespace Modelos
'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO)
If Not ErrorCancelar AndAlso DtDevoluciones IsNot Nothing AndAlso DtDevoluciones.Rows.Count > 0 Then
For Each CveRemision As Integer In ListaRemisionesCancelar
Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}")
Dim ObjRemision As New Factura(UsuarioActual, CveRemision, UsuarioActual.CveEmpresa)
Dim DtDevMovs = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"})
If ObjRemision IsNot Nothing AndAlso ObjRemision.SaldoAlmacen <> 0 Then
For Each RowDevolucion As DataRow In DtDevMovs.Rows
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero()
If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
Exit For
Dim SaldoAlmacenExA As Decimal = 0
Dim SaldoAlmacenUsados As Decimal = 0
Dim DtSaldosAlmacenRemision As DataTable = Nothing
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
If Not ErrorCancelar Then
If ObjInventario.GetSaldoVentaDetalleAlmacen(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
DtSaldosAlmacenRemision = ObjInventario.DtResultados.Copy()
Else
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar."
End If
End If
Next
Dim DtDevRemision As DataTable = DtDevoluciones.FiltraParametros($"CveRemision={CveRemision}")
Dim DtDevMovs = DtDevRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveRemision", "CveAlmacen", "CveAlmacenDestino"})
For Each RowDevolucion As DataRow In DtDevMovs.Rows
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero()
CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero()
If CveAlmacen > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
SaldoAlmacenExA = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacen}")
End If
If SaldoAlmacenExA <> 0 Then
If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión."
Exit For
End If
End If
Next
'CANCELAR MOVIMIENTOS DE USADOS SI TIENE
If Not ErrorCancelar AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim CveAlmacenUsado As Integer = 0
Dim CveMovimientoUsado As Integer = 0
If ObjInventario.GetInv_Mov(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
Else
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución de usado. Por favor vuelva a intentar."
End If
If CveAlmacenUsado > 0 AndAlso DtSaldosAlmacenRemision IsNot Nothing Then
SaldoAlmacenUsados = DtSaldosAlmacenRemision.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}")
End If
If Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then
If CancelarInventarioUsado(ObjRemision, CveAlmacenUsado, CveMovimientoUsado, ObjInventario) <= 0 Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar los usados. Por favor vuelva a intentar."
End If
End If
End If
If DtDevRemision IsNot Nothing Then
DtDevRemision.Dispose()
End If
If DtDevMovs IsNot Nothing Then
DtDevMovs.Dispose()
End If
End If
If ObjRemision IsNot Nothing Then
ObjRemision.Dispose()
End If
If ErrorCancelar Then
Exit For
@@ -5444,22 +5508,48 @@ Namespace Modelos
End If
'CANCELACION DE MOVIMIENTOS DE REMISION
If Not ErrorCancelar AndAlso ObjFactura.TipoDocto = "Rem" AndAlso RealizarDevolucionAlmacen Then
If Not ErrorCancelar AndAlso ObjFactura.TipoDocto = "Rem" AndAlso RealizarDevolucionAlmacen AndAlso ObjFactura.SaldoAlmacen <> 0 Then
Dim CveMovimientoUsado As Integer = -1
Dim CveAlmacenUsado As Integer = 0
Dim CveAlmacenGeneral As Integer = 0
Dim CveAlmacenExA As Integer = 0
Dim SaldoAlmacenExA As Decimal = 0
Dim SaldoAlmacenUsados As Decimal = 0
Dim DtMovRemision As DataTable = Nothing
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero()
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToString().ToEntero()
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
CveAlmacenUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
Else
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If
End If
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
If Not ErrorCancelar Then
If ObjInventario.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
If CveAlmacenExA > 0 Then
SaldoAlmacenExA = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenExA}")
End If
If CveAlmacenUsado > 0 Then
SaldoAlmacenUsados = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenUsado}")
End If
Else
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar."
End If
End If
'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO)
If Not ErrorCancelar AndAlso DtMovRemision IsNot Nothing AndAlso DtMovRemision.Rows.Count > 0 Then
If Not ErrorCancelar AndAlso DtMovRemision IsNot Nothing AndAlso DtMovRemision.Rows.Count > 0 AndAlso SaldoAlmacenExA <> 0 Then
Dim DtDevMovs = DtMovRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveAlmacen"})
@@ -5475,6 +5565,14 @@ Namespace Modelos
End If
'CANCELAR MOVIMIENTOS DE USADOS SI TIENE
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not ErrorCancelar AndAlso CveMovimientoUsado > 0 AndAlso SaldoAlmacenUsados <> 0 Then
If CancelarInventarioUsado(ObjFactura, CveAlmacenUsado, CveMovimientoUsado, ObjInventario) <= 0 Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al cancelar los movimientos de usados."
End If
End If
End If
'VERIFICAR MOVIMIENTOS DE APARTADOS
@@ -5739,41 +5837,134 @@ Namespace Modelos
CveAlmacenVirtual = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
End If
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoRelacionado) Then
DtPSVirtual = ObjInventario.DtResultados
End If
Dim SaldoVirtual As Decimal = 0
Dim CveConceptoMovimientoVirtual As Integer = 36
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual")
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
ErrorCancelar = True
Exit For
End If
Next
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
If Not ErrorCancelar Then
If ObjInventario.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
If CveAlmacenVirtual > 0 Then
SaldoVirtual = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenVirtual}")
End If
Else
ErrorCancelar = True
End If
Else
If ValidaVirtual Then
End If
If Not ErrorCancelar AndAlso SaldoVirtual <> 0 Then
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoRelacionado) Then
DtPSVirtual = ObjInventario.DtResultados
End If
Dim CveConceptoMovimientoVirtual As Integer = 36
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual")
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
ErrorCancelar = True
Exit For
End If
Next
Else
ErrorCancelar = True
End If
Else
If ValidaVirtual Then
ErrorCancelar = True
End If
End If
If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then
ErrorCancelar = True
End If
End If
If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then
ErrorCancelar = True
End If
Catch ex As Exception
OnError("Ocurrió un error al realizar la devolución al almacen virtual.", ex)
ErrorCancelar = True
End Try
Return Not ErrorCancelar
End Function
Private Function CancelarMovimientosVirtuales(CveVenta As Integer, CveMovimientoDevolucion As Integer, CveMovimientoVirtualSalida As Integer, ByRef ObjInventario As ClsInventarios) As Boolean
Dim ErrorCancelar As Boolean = False
Try
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveMovimientoVirtual As Integer = -1
Dim ValidaVirtual = True
Dim DtPSVirtual As New DataTable("DtTamanios")
Dim CveAlmacenVirtual As Integer = -1
If ObjInventario.GetMovimientos(CveMovimientoVirtualSalida, -1, -1, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
CveAlmacenVirtual = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
End If
Dim SaldoVirtual As Decimal = 0
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
If Not ErrorCancelar Then
If ObjInventario.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
If CveAlmacenVirtual > 0 Then
SaldoVirtual = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenVirtual}")
End If
Else
ErrorCancelar = True
End If
End If
If Not ErrorCancelar AndAlso SaldoVirtual <> 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtualSalida, UsuarioActual.CveEmpresa) Then
DtPSVirtual = ObjInventario.DtResultados
End If
Dim CveConceptoMovimientoVirtual As Integer = 36
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimientoDevolucion
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual")
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
Dim PU As Decimal = RowUsado("PU").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
Dim CveVentaDetalle As Integer = RowUsado("CveVentaDetalle").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveVentaDetalle:=CveVentaDetalle) Then
ErrorCancelar = True
Exit For
End If
Next
Else
ErrorCancelar = True
End If
Else
If ValidaVirtual Then
ErrorCancelar = True
End If
End If
If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then
ErrorCancelar = True
End If
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al realizar la devolución al almacen virtual.", ex)
@@ -9921,7 +10112,9 @@ Namespace Modelos
Public Property Colonia As String
Public Property Localidad As String
Public Property Municipio As String
Public Property CveEstado As Integer
Public Property Estado As String
Public Property CvePais As Integer
Public Property Pais As String
Public Property CP As String
Public Property IVA As Decimal

View File

@@ -208,7 +208,7 @@ Public Class Timbres
Dim Ubica As New CFDICartaPorteUbicacion
Ubica.TipoEstacion = ""
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString,
.FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01",
.FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01",
.NombreRemitenteDestinatario = drT("RemitenteNombre").ToString,
.Domicilio = DomOrigen}
CartaPorte.Ubicaciones.Add(Ubica)
@@ -355,22 +355,268 @@ Public Class Timbres
End If
Return Timbre
End Function
Public Function Timbrar() As Boolean
Dim Respuesta As Boolean = False
Dim ObjTimbrado As New Timbrado
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
Respuesta = True
Else
Respuesta = False
_MsgError.AppendLine(ObjTimbrado.MensajeErrorCFDI)
End If
Return Respuesta
End Function
End Class
Public Class MMensajeCartaPorte
Public Property TieneError As Boolean
Public Property Mensaje As String
Public Property CveMovimiento As Integer
Public Property FechaSalida As DateTime
Public Property CartaPorte As CFDICartaPorte
End Class
Public Shared Function PreParaCartaPorteFactura(CveTimbre As Integer, Obj As Modelos.Factura, UsuarioActual As Usuario) As MMensajeCartaPorte
Dim Retorno As New MMensajeCartaPorte
Try
Dim CartaPorte As New CFDICartaPorte
Dim _MsgError As New StringBuilder
Dim TieneError As Boolean = False
CartaPorte.TranspInternac = "No"
CartaPorte.EntradaSalidaMercancia = ""
CartaPorte.ViaEntradaSalida = ""
CartaPorte.Mercancias.UnidadPeso = "KGM"
CartaPorte.Mercancias.CargoporTasacion = 0
Dim FI As Date = New Date(1900, 1, 1)
Dim FF As Date = New Date(9999, 1, 1)
Dim FechaLlegada As DateTime
Dim Distancia As Integer = 1
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetGralTimbre(CveTimbre, "Man", FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then
If ObjGrales.DtResultados.Rows.Count = 1 Then
Dim DtMovimientos As DataTable = Nothing
Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
'Timbre.Receptor.RFC = drT("DestinatarioRFC").ToString
'Timbre.Receptor.Nombre = drT("DestinatarioNombre").ToString
Retorno.CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero
Retorno.FechaSalida = drT("FechaEntrega").ToString.ToDateTime
FechaLlegada = drT("FechaLlegada").ToString.ToDateTime
Distancia = drT("Distancia").ToString.ToEntero
'ObjFactura.Folio = drT("Folio").ToString.ToEntero
'ObjFactura.Serie = drT("Serie").ToString
'Timbre.Comprobante.Serie = Obj.Serie
'Timbre.Comprobante.Folio = Obj.Folio.ToString
'If drT("FolioFiscalRelacionado").ToString <> "" Then
' Timbre.CFDIRelacionados.TipoRelacion = "05"
' Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString)
'End If
If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then
DtMovimientos = ObjGrales.DtResultados
Else
TieneError = True
_MsgError.AppendLine("Error al obtener Movimientos")
End If
'ObjFactura.DtDetalle = DtMovimientos
'AplicaCP = Boolean.Parse(drT("AplicaCP").ToString)
'ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero
'ObjFactura.SetSubProyecto()
'ObjFactura.SetSubProyectoMatriz()
CartaPorte.FiguraTransporte.AutoTransporte.PermisoSCT = drT("ClaveTipoPermisoSCT").ToString '"TPAF01"
CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString
CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString
CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente = drT("NumPolizaSeguroMedioAmbiente").ToString
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroCarga = drT("NombreAseguradoraCarga").ToString
CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroCarga = drT("NumPolizaSeguroCarga").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular = drT("ConfigCartaPorte").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
If drT("ClaveTipoRemolque1").ToString <> "" Then
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
End If
If drT("ClaveTipoRemolque2").ToString <> "" Then
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
End If
If drT("ClaveTipoRemolque1").ToString <> "" Then
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
End If
If drT("ClaveTipoRemolque2").ToString <> "" Then
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
End If
Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString,
.Colonia = drT("DirOriClaveSATColonia").ToString,
.CP = drT("DirOriCP").ToString,
.Estado = drT("DirOriClaveSATEstado").ToString,
.Pais = drT("DirOriClaveSATPais").ToString,
.Municipio = drT("DIrOriClaveSATMunicipio").ToString,
.Localidad = drT("DirOriClaveSATLocalidad").ToString}
Dim DomDestino As CFDICartaPorteDomicilio = Nothing
DomDestino = New CFDICartaPorteDomicilio With {.Calle = drT("DirDesCalle").ToString,
.Colonia = drT("DirDesClaveSATColonia").ToString,
.CP = drT("DirDesCP").ToString,
.Estado = drT("DirDesClaveSATEstado").ToString,
.Pais = drT("DirDesClaveSATPais").ToString,
.Municipio = drT("DirDesClaveSATMunicipio").ToString,
.Localidad = drT("DirDesClaveSATLocalidad").ToString}
Dim Ubica As New CFDICartaPorteUbicacion
Ubica.TipoEstacion = ""
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString,
.FechaHoraSalidaLlegada = Retorno.FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01",
.NombreRemitenteDestinatario = drT("RemitenteNombre").ToString,
.Domicilio = DomOrigen}
CartaPorte.Ubicaciones.Add(Ubica)
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString,
.FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"),
.NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString,
.Domicilio = DomDestino,
.DistanciaRecorrida = Distancia}
CartaPorte.Ubicaciones.Add(Ubica)
CartaPorte.FiguraTransporte.ClaveTransporte = "01"
Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString,
.NumeroExterior = drT("FiguraNumeroExterior").ToString,
.NumeroInterior = drT("FiguraNumeroInterior").ToString,
.Colonia = drT("FiguraClaveSATColonia").ToString,
.Municipio = drT("FiguraClaveSATMunicipio").ToString,
.Estado = drT("FiguraClaveSATEstado").ToString,
.CP = drT("FiguraCP").ToString}
CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With {
.RFCFigura = drT("FiguraRFC").ToString,
.NombreFigura = drT("FiguraChofer").ToString,
.NumLicencia = drT("FiguraLicencia").ToString,
.NumRegidTribFigura = drT("FiguraNumRegidTribFigura").ToString,
.ResidenciaFiscalFigura = drT("FiguraResidenciaFiscalFigura").ToString,
.Domicilio = DomicilioOperador})
'concepto único
Dim concepto As New CFDIConceptos With {.Cantidad = 1,
.Descripcion = "Flete",
.ValorUnitario = 0,
.Importe = 0,
.Descuento = 0,
.Unidad = "Servicio",
.ClaveUnidad = "E48",
.ClaveProdServ = "78101802",
.Noidentificacion = "",
.CuentaPredial = ""}
For Each drr As DataRow In DtMovimientos.Rows
Dim tPS As String = ""
If drr("PS").ToString.Length = 1 Then
tPS = drr("Obs").ToString
Else
If drr("PS").ToString.Length = 0 Then
tPS = ""
Else
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
End If
End If
Dim conceptoCarta As New CFDICartaPorteMercancia With {
.BienesTransp = drr("SATClaveProdServ").ToString,
.ClaveSTCC = "", 'para metodo ferroviario
.Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripción = tPS,
.ClaveUnidad = drr("SATClaveUM").ToString,
.Unidad = drr("UM").ToString,
.Dimensiones = drr("Dimensiones").ToString,
.PesoenKg = drr("PesoKg").ToString.ToDecimal,
.MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""),
.ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString,
.Embalaje = drr("ClaveEmbalaje").ToString,
.DescripEmbalaje = drr("Embalaje").ToString,
.ValorMercancia = drr("PU").ToString.ToDecimal,
.Moneda = "MXN", 'temporal
.FraccionArrancelaria = "",
.UUIDComercioExt = ""
}
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
conceptoCarta.DetalleMercancia = DetalleMercancia
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}
conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta)
CartaPorte.Mercancias.Mercancias.Add(conceptoCarta)
Next
Retorno.CartaPorte = CartaPorte
Else
TieneError = True
_MsgError.AppendLine("Consultar datos de timbrado")
End If
ObjGrales.Dispose()
Else
_MsgError.AppendLine("Consultar datos de timbrado")
End If
Retorno.TieneError = If(_MsgError.ToString().Length > 0, True, False)
Retorno.Mensaje = _MsgError.ToString()
Catch ex As Exception
Retorno.TieneError = True
Retorno.Mensaje = ex.ToString()
End Try
Return Retorno
End Function
Public Function Timbrar() As Boolean
Dim Respuesta As Boolean = False
Dim ObjTimbrado As New Timbrado
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
Respuesta = True
Else
Respuesta = False
_MsgError.AppendLine(ObjTimbrado.MensajeErrorCFDI)
End If
Return Respuesta
End Function
End Class

View File

@@ -33,8 +33,9 @@ Partial Class Bancos_CuentasBancarias
Public Sub CargaDatos()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancosCuentas(-1) Then
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Dim dt = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa, "", {"CveCuenta", "TipoCuenta", "Banco", "NumCuenta", "CLABE", "Moneda", "FInicial", "Estatus", "Fecha", "Usuario"})
ViewState("DTBancosCuentas") = dt
DtBan = dt
Else
Me.GvDatos.DataSource = Nothing
End If
@@ -66,14 +67,14 @@ Partial Class Bancos_CuentasBancarias
If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
'If ObjBancos.GetBancosCuentasUsuarios(-1) Then
' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados
'End If
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
'If ObjBancos.GetBancosCuentasUsuarios(-1) Then
' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados
'End If
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If

File diff suppressed because it is too large Load Diff

View File

@@ -4969,6 +4969,7 @@ Partial Class PopUpVerFactura
Dim FolioFiscal = drv("FolioFiscal").ToString()
Dim RFCReceptor = drv("RFCReceptor").ToString()
Dim SelloCancelacion = drv("SelloCancelacion").ToString()
Dim SelloSolicitudCancelacion = drv("SelloSolicitudCancelacion").ToString()
Dim EstadoCancelacion = drv("EstadoCancelacion").ToString()
Dim FechaCancelacion = drv("FechaCancelacion").ToString.ToDateTime
@@ -4994,6 +4995,12 @@ Partial Class PopUpVerFactura
If CveEstatusFactura = 20 Then
Titulo = "Acuse de solicitud de cancelación de CFDI"
EstadoCFDI = "Vigente"
'SI TIENE DATOS EN EL SELLO DE SOLICITUD Y ESTA EN PROCESO, ENVIAR ESTE SELLO
If Not String.IsNullOrEmpty(SelloSolicitudCancelacion) Then
SelloCancelacion = SelloSolicitudCancelacion
End If
If String.IsNullOrEmpty(EstadoCancelacion) Then
EstadoCancelacion = "Cancelable con aceptación"
End If
@@ -5751,6 +5758,7 @@ Partial Class PopUpVerFactura
Dim MarcaAuto As String = RowAjuste("MarcaAuto").ToString
Dim CodigoTD As String = RowAjuste("CodigoTD").ToString
Dim PSAjuste As String = ""
Dim MarcaPS As String = ""
Dim CveMarca As Integer = -1
@@ -5781,7 +5789,15 @@ Partial Class PopUpVerFactura
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePSAjuste, -1, UsuarioActual.CveEmpresa) Then
MarcaPS = ObjPS.DtResultados.FiltroPrimeroValor("Marca", String.Format("CvePS = {0}", CvePSAjuste))
Dim RowPS As DataRow = ObjPS.DtResultados.FiltroPrimero(String.Format("CvePS = {0}", CvePSAjuste))
If RowPS IsNot Nothing Then
PSAjuste = RowPS("PS").ToString()
MarcaPS = RowPS("Marca").ToString()
'SI ES MOTOBATERIAS PONER EL NOMBRE EN EL TIPO
If RowPS("CveClasificacion").ToString() = "20517" Then
BCIAjuste = PSAjuste
End If
End If
End If
ObjPS.Dispose()
@@ -5879,6 +5895,7 @@ Partial Class PopUpVerFactura
Dim MesesUso As String = "0"
Dim PSAjuste As String = ""
Dim MarcaPS As String = ""
Dim CveMarca As Integer = -1
@@ -5909,7 +5926,15 @@ Partial Class PopUpVerFactura
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePSAjuste, -1, UsuarioActual.CveEmpresa) Then
MarcaPS = ObjPS.DtResultados.FiltroPrimeroValor("Marca", String.Format("CvePS = {0}", CvePSAjuste))
Dim RowPS As DataRow = ObjPS.DtResultados.FiltroPrimero(String.Format("CvePS = {0}", CvePSAjuste))
If RowPS IsNot Nothing Then
PSAjuste = RowPS("PS").ToString()
MarcaPS = RowPS("Marca").ToString()
'SI ES MOTOBATERIAS PONER EL NOMBRE EN EL TIPO
If RowPS("CveClasificacion").ToString() = "20517" Then
BCIAjuste = PSAjuste
End If
End If
End If
ObjPS.Dispose()

View File

@@ -990,9 +990,9 @@
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Top>2.155in</Top>
<Left>2.56338in</Left>
<Left>2.76123in</Left>
<Height>0.16389in</Height>
<Width>1.23952in</Width>
<Width>1.04167in</Width>
<ZIndex>22</ZIndex>
<Style>
<Border>
@@ -1040,7 +1040,7 @@
<Top>2.155in</Top>
<Left>1.37238in</Left>
<Height>0.16389in</Height>
<Width>1.19096in</Width>
<Width>1.38885in</Width>
<ZIndex>23</ZIndex>
<Style>
<Border>

View File

@@ -524,7 +524,7 @@ Partial Class Inventarios_EntregaAlmacen
ChkTransitorio.Checked = False
TxtResponsable.Text = ""
DivTransitorio2.Visible = False
DdlAlmacen.Enabled = True
Select Case CType(Boton.NamingContainer, GridViewRow).DataKey("TipoEntrega").ToEntero()
Case 1 ' VENTA
@@ -742,12 +742,17 @@ Partial Class Inventarios_EntregaAlmacen
Dim DtMov As DataTable = DtExistencias.FiltraParametros("CveConcepto = 40", "", {"CveAlmacen"})
If DtMov.Rows.Count > 0 AndAlso CveAlmacen <= 0 Then
Dim CveAlmacenDev As Integer = DtMov.Rows(0)("CveAlmacen").ToString().ToEntero()
Dim AlmacenDev As String = ""
If CveAlmacenDev > 0 Then
AlmacenDev = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenDev).FiltroPrimeroValor("Almacen")
'DdlAlmacen.Items.Clear()
'DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}")
'DdlAlmacen.DataBind()
'DdlAlmacen.Items.Clear()
'DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}")
'DdlAlmacen.DataBind()
DdlAlmacen.SelectedValueExistInsert(CveAlmacenDev, AlmacenDev) ' se va a poder regresar en algun almacen diferente
DdlAlmacen.Enabled = False
End If
DdlAlmacen.SelectedValueExist(CveAlmacenDev) ' se va a poder regresar en algun almacen diferente
EsDevolucionDirecta = True
End If
End If
@@ -2502,7 +2507,7 @@ Partial Class Inventarios_EntregaAlmacen
PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalleRemision").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For
@@ -2515,7 +2520,7 @@ Partial Class Inventarios_EntregaAlmacen
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalleRemision").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For
@@ -2526,7 +2531,7 @@ Partial Class Inventarios_EntregaAlmacen
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalleRemision").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.")
Exit For
@@ -2796,13 +2801,26 @@ Partial Class Inventarios_EntregaAlmacen
FolioVirtual = ObjInventario.Folio
If CveMovimientoVirtual > 0 Then
Dim TmpDTDetalleFactura As DataTable = Nothing
If ObjVentas.GetVentaDetalle(CveVentaSurtir) Then
TmpDTDetalleFactura = ObjVentas.DtResultados.Copy()
End If
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU) Then
Dim CveVentaDetalle As Integer = -1
If TmpDTDetalleFactura IsNot Nothing Then
CveVentaDetalle = TmpDTDetalleFactura.FiltroPrimeroValor("CveVentaDetalle", $"Cantidad = {RowUsado("Cantidad")} AND CvePS = {RowUsado("CvePS")}").ToEntero()
If CveVentaDetalle <= 0 Then
CveVentaDetalle = -1
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, CveVentaDetalle:=CveVentaDetalle) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
@@ -3529,6 +3547,9 @@ Partial Class Inventarios_EntregaAlmacen
LbSurtida.Visible = False
TimmerRefresh.Enabled = True
DdlAlmacen.Enabled = True
UpGenerales.Update()
CargaGvDatos()

View File

@@ -653,11 +653,12 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
string ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, e.Row.DataKey("TimbreTipoDocto"), e.Row.DataKey("SerieFolio"));
//if (File.Exists(ArchivoXML))
//{
// e.Row.Cells[12].Text = "<a CssClass='btn btn-circle btn-sm blue' target= '_blank' href=\"/Compras/PopUpVerFactura.aspx?P=" + Extensiones.ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", -1, "XML", e.Row.DataKey("SerieFolio"), e.Row.DataKey("TimbreTipoDocto"))) + "\" ><i class='fa fa-file-code-o'></i></a>";
//}
if (File.Exists(ArchivoXML))
{
if (e.Row.FCHyperLink("HplXML") != null)
e.Row.FCHyperLink("HplXML").NavigateUrl = "/Compras/PopUpVerFactura.aspx?P=" + Extensiones.ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", -1, "XML", e.Row.DataKey("SerieFolio"), e.Row.DataKey("TimbreTipoDocto")));
}
}
else
{

View File

@@ -4119,7 +4119,7 @@
<span class="caption-subject bold">Agregar</span>
</div>--%>
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green'></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green'></i>Agendar" Visible="false" Style="font-weight: 700 !important; cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox font-green caption-subject bold" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green'></i>Agendar" Visible="false" Style="font-weight: 700 !important; cursor: pointer;" ToolTip="Agendar"></asp:HyperLink><br />
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
</div>

View File

@@ -41,18 +41,19 @@
white-space: nowrap;
}
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(2),
.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) {
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(2)
/*,.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) */
{
background-color: #900;
color: #FFF;
}
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(3),
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(4),
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(5),
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(5)/*,
.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(3),
.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(4),
.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(5) {
.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(5)*/ {
background-color: #3598dc;
color: #FFF;
}
@@ -66,14 +67,14 @@
white-space: nowrap;
}
.reporte2 .GVSolicitudTimbreNominaGral tr th:nth-child(2),
.reporte2 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) {
.reporte2 .GVSolicitudTimbreNominaGral tr th:nth-child(2)/*,
.reporte2 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2)*/ {
background-color: #900;
color: #FFF;
}
.reporte2 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3):not(:nth-child(7)),
.reporte2 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+3):not(:nth-child(7)){
.reporte2 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3):not(:nth-child(7))/*,
.reporte2 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+3):not(:nth-child(7))*/{
background-color: #3598dc;
color: #FFF;
}
@@ -93,17 +94,17 @@
}
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(2),
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(n+20),
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(n+20)/*,
.reporte3 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2),
.reporte3 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+20){
.reporte3 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+20)*/{
background-color: #900;
color: #FFF;
}
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(1),
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3):not(:nth-child(n+20)),
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3):not(:nth-child(n+20))/*,
.reporte3 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(1),
.reporte3 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+3):not(:nth-child(n+20)) {
.reporte3 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+3):not(:nth-child(n+20))*/ {
background-color: #3598dc;
color: #FFF;
}
@@ -115,39 +116,82 @@
white-space: nowrap;
}
.reporte4 .GVSolicitudTimbreNominaGral tr th:nth-child(2),
.reporte4 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) {
.reporte4 .GVSolicitudTimbreNominaGral tr th:nth-child(2)/*,
.reporte4 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2)*/ {
background-color: #900;
color: #FFF;
}
.reporte4 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3),
.reporte4 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+3) {
.reporte4 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3):not(:nth-child(n+6))/*,
.reporte4 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+3)*/ {
background-color: #3598dc;
color: #FFF;
}
.reporte5 .GVSolicitudTimbreNominaGral tr th:nth-child(2)/*,
.reporte5 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2)*/ {
background-color: #900;
color: #FFF;
}
.reporte5 .GVSolicitudTimbreNominaGral tr th:nth-child(3)/*,
.reporte5 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(3)*/ {
background-color: #3598dc;
color: #FFF;
}
.reporte6 .GVSolicitudTimbreNominaGral tr td:nth-child(n) {
white-space: nowrap;
}
.reporte6 .GVSolicitudTimbreNominaGral tr td:nth-child(n+3),
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3) {
.reporte6 .GVSolicitudTimbreNominaGral tr td:nth-child(n+4),
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+4) {
text-align: right !important;
}
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3):not(:nth-child(n+6)) {
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+4):not(:nth-child(n+7)) {
background-color: #900;
color: #FFF;
}
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+6) {
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+7):not(:nth-child(n+10)) {
background-color: #3598dc;
color: #FFF;
}
.reporte7 .GVSolicitudTimbreNominaGral tr td:nth-child(n+3),
.reporte7 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3) {
text-align: right !important;
}
.reporte7 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3):not(:nth-child(n+6)) {
background-color: #900;
color: #FFF;
}
.reporte7 .GVSolicitudTimbreNominaGral tr th:nth-child(n+6):not(:nth-child(n+9)) {
background-color: #3598dc;
color: #FFF;
}
.reporte8 .GVSolicitudTimbreNominaGral tr td:nth-child(n+6),
.reporte8 .GVSolicitudTimbreNominaGral tr th:nth-child(n+6) {
text-align: right !important;
}
.reporte8 .GVSolicitudTimbreNominaGral tr th:nth-child(n+6):not(:nth-child(n+9)) {
background-color: #900;
color: #FFF;
}
.reporte8 .GVSolicitudTimbreNominaGral tr th:nth-child(n+9):not(:nth-child(n+12)) {
background-color: #3598dc;
color: #FFF;
}
.reporte9 .GVSolicitudTimbreNominaGral tr td:nth-child(1),
.reporte9 .GVSolicitudTimbreNominaGral tr td:nth-child(4) {
white-space: nowrap;
@@ -161,7 +205,7 @@
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LnkDownloadExcel" OnClick="LnkDownloadExcel_Click" runat="server"><i class="fa fa-excel"></i>Descargar</asp:LinkButton>
<asp:LinkButton ID="LnkDownloadExcel" OnClick="LnkDownloadExcel_Click" runat="server"><i class="fa fa-download"></i>Descargar</asp:LinkButton>
</li>
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -181,21 +225,22 @@
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1">Reporte: </label>
<label class="col-md-1">Agrupador: </label>
<div class="col-md-2">
<asp:DropDownList ID="DdlReporte" runat="server" Style="width: 100% !important;" CssClass="select2me" DataValueField="CveUsuario" DataTextField="Nombre">
<asp:ListItem Value="1" Text="Conciliacion ISR mensual"></asp:ListItem>
<asp:ListItem Value="2" Text="Conciliacion ISR por concepto"></asp:ListItem>
<asp:ListItem Value="3" Text="Conciliacion ISR por recibo"></asp:ListItem>
<asp:ListItem Value="4" Text="Anual sueldos y salarios resumen general"></asp:ListItem>
<asp:ListItem Value="5" Text="Anual sueldos y salarios global por conceptos"></asp:ListItem>
<asp:ListItem Value="6" Text="Anual sueldos y salarios por clave SAT"></asp:ListItem>
<asp:ListItem Value="7" Text="Anual sueldos y salarios por empleado"></asp:ListItem>
<asp:ListItem Value="8" Text="Anual sueldos y salarios por concepto"></asp:ListItem>
<asp:ListItem Value="4" Text="Anual sueldos y salarios "></asp:ListItem>
<asp:ListItem Value="5" Text="Anual sueldos y salarios resumen general"></asp:ListItem>
<asp:ListItem Value="6" Text="Anual sueldos y salarios global por empleado"></asp:ListItem>
<asp:ListItem Value="7" Text="Anual sueldos y salarios por clave SAT"></asp:ListItem>
<asp:ListItem Value="8" Text="Anual sueldos y salarios por empleado y concepto"></asp:ListItem>
<%--<asp:ListItem Value="8" Text="Anual sueldos y salarios por concepto"></asp:ListItem>--%>
<asp:ListItem Value="9" Text="Anual sueldos y salarios por recibo"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 mediocol">del:</label>
<label class="col-md-1 mediocol">Fecha inicio:</label>
<div class="col-md-1">
<%--<asp:TextBox ID="TxtPeriodoInicio" Text="0" CssClass="form-control" runat="server"></asp:TextBox>--%>
@@ -210,7 +255,7 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaInicio"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 mediocol">al:</label>
<label class="col-md-1 mediocol">Fecha fin:</label>
<div class="col-md-1">
<%--<asp:TextBox ID="TxtPeriodoFin" Text="99" CssClass="form-control" runat="server"></asp:TextBox>--%>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">

View File

@@ -58,8 +58,56 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin);
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
var libro = wb.AddWorksheet(nom.DtResultados , "Nomina");
var libro = wb.AddWorksheet(nom.DtResultados , "Nomina");
libro.ColumnsUsed().AdjustToContents();
libro.Range(1, 1, 1, nom.DtResultados.Columns.Count).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 153, 153));
switch (DdlReporte.SelectedValue.ToString().ToEntero())
{
case 1:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153,0,0));
libro.Range(1, 3, 1, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 2:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 3, 1, 6).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
libro.Range(1, 8, 1, 11).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 3:
libro.Range(1, 1, 1, 10).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
libro.Range(1, 11, 1, nom.DtResultados.Columns.Count).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
break;
case 4:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 3, 1, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 5:
libro.Range(1, 2, 1, 2).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 3, 1, 3).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 6:
libro.Range(1, 4, 1, 6).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 7, 1, 9).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 7:
libro.Range(1, 3, 1, 5).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 6, 1, 8).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 8:
libro.Range(1, 6, 1, 8).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(153, 0, 0));
libro.Range(1, 9, 1, 12).Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(53, 152, 220));
break;
case 9:
break;
default:
break;
}
libro.Row(1).InsertRowsAbove(4);
libro.Range(1, 2, 1, 6).Merge().Value = UsuarioActual.Empresa.Empresa;
libro.Range(2, 2, 2, 6).Merge().Value = $"Reporte de {DdlReporte.SelectedItem.Text }";
libro.Range(3, 2, 3, 6).Merge().Value = $"del {fechaInicio.ToDateTime():dd/MM/yyyy} al {fechaFin.ToDateTime():dd/MM/yyyy}";
libro.Range(2, 7, 2, 9).Merge().Value = $"Fecha:{DateTime.Now:dd/MM/yyyy}";
libro.Range(3, 7, 3, 9).Merge().Value = $"Hora:{DateTime.Now:HH:mm}";
System.IO.Stream fs = new System.IO.MemoryStream();
wb.SaveAs(fs);
fs.Position = 0;
@@ -75,7 +123,7 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
Response.Buffer = true;
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xlsx", "Visor nómina "));
Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xlsx", $"Visor nómina ( Reporte :{DdlReporte.SelectedValue}) "));
Response.BinaryWrite(memoryStream.ToArray());
Response.End();
}

View File

@@ -258,19 +258,19 @@ Partial Class Sistemas_PermisosPorUsuario
''Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol
If HdnCveModuloAcceso.Value <> "" Then
If HdnPermitir.Value = "" OrElse HdnPermitir.Value = "0" Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, Not ChkModuloDenegar.Checked) Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, Not ChkModuloDenegar.Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Alert("Se ha actualizado el acceso al modulo correctamente")
End If
End If
'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas)
If HdnPermitir.Value = "1" Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, Not ChkModuloDenegar.Checked) Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, Not ChkModuloDenegar.Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Alert("Se ha actualizado el acceso al modulo correctamente")
End If
End If
Else
If HdnPermitir.Value = "" OrElse HdnPermitir.Value = "1" Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, ChkModuloPermitir.Checked) Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, ChkModuloPermitir.Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Alert("Se ha actualizado el acceso al modulo correctamente")
End If
End If
@@ -464,19 +464,19 @@ Partial Class Sistemas_PermisosPorUsuario
''Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol
If HdnCveModuloAccesoProceso.Value <> "" Then
If HdnPermitirProceso.Value = "" OrElse HdnPermitirProceso.Value = "0" Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, Not ChkDenegarProceso.Checked) Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, Not ChkDenegarProceso.Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Alert("Se ha actualizado el proceso correctamente")
End If
End If
'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas)
If HdnPermitirProceso.Value = "1" Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, Not ChkDenegarProceso.Checked) Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, Not ChkDenegarProceso.Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Alert("Se ha actualizado el proceso correctamente")
End If
End If
Else
If HdnPermitirProceso.Value = "" OrElse HdnPermitirProceso.Value = "1" Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, ChkPermitirProceso.Checked) Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, ChkPermitirProceso.Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Alert("Se ha actualizado el proceso correctamente")
End If
End If

View File

@@ -120,6 +120,7 @@
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="5%" HeaderText="D.Venc" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" />
<asp:HyperLinkField DataTextField="FacturaAplicada" Target="_blank" HeaderText="Factura" DataNavigateUrlFields="CveVentaAplicada" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Motivo" HeaderText="Motivo" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
@@ -203,6 +204,20 @@
<ajax:ValidatorCalloutExtender ID="VCEDiasVencidos2" runat="server" HighlightCssClass="vco" TargetControlID="RFVDiasVencidos2" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div id="DivMotivo" runat="server" visible="false" class="row">
<div class="col-md-12">
<div class="row">
<label class="col-md-3 truncate" style="color: #888888; font-family: 'Open Sans', sans-serif; direction: ltr; font-size: 12px;">Motivo:</label>
</div>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtMotivo" CssClass="form-control input-sm" runat="server" Rows="2" TextMode="MultiLine" Width="100%" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMotivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMotivo" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />

View File

@@ -4,14 +4,22 @@ Partial Class Ventas_CatAutorizacionLimites
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveAutorizacion() As Integer
Private Property CveAutorizacion() As Integer
Get
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion")))
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion")))
End Get
Set
End Get
Set
ViewState("CveAutorizacion") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Set
End Property
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -29,20 +37,20 @@ Partial Class Ventas_CatAutorizacionLimites
DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True)
#Region "CARGAS"
Private Sub CargaCombos()
txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy")
txtFechaI.Text = Now.ToString("dd/MM/yyyy")
DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True)
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then
' DdlCliente.setEsWebService(True)
' DdlClienteFiltro.setEsWebService(True)
'Else
' DdlCliente.setEsWebService(False)
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
'If EsWS Then
' DdlCliente.setEsWebService(True)
' DdlClienteFiltro.setEsWebService(True)
'Else
' DdlCliente.setEsWebService(False)
' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlCliente.DataBind()
' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
' DdlClienteFiltro.setEsWebService(False)
' DdlClienteFiltro.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlClienteFiltro.DataBind()
' DdlClienteFiltro.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
@@ -64,8 +72,8 @@ Partial Class Ventas_CatAutorizacionLimites
CveCliente = DdlClienteFiltro.SelectedValue.ToEntero()
End If
Private Sub CargaDatos()
Dim CveCliente As Integer = -1
Dim FechaI, FechaF As Date
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim.ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha)
Dim ObjGral As New ClsVentas
@@ -103,8 +111,10 @@ Partial Class Ventas_CatAutorizacionLimites
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
CargaDatos()
ltlMotititulo.Text = "Agregar autorización"
UpModal.Update()
RegistraScript("$('#DModal').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
If DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
@@ -119,8 +129,10 @@ Partial Class Ventas_CatAutorizacionLimites
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivo.Text.Trim
Dim ObjPS As New ClsVentas
Dim DiasVencidos As Integer = 0
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, DdlCliente.SelectedValue.ToEntero(), DdlVendedor.SelectedValue.ToEntero(), TxtPrecio.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocto, DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -132,9 +144,13 @@ Partial Class Ventas_CatAutorizacionLimites
#End Region
#Region "LIMPIAR"
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
Protected Sub LimpiaModal()
Me.CveAutorizacion = -1
TxtPrecio.Text = ""
ObjPS.Dispose()
DdlCliente.SelectedValue = "-1"
DdlVendedor.SelectedValueExist("-1")
End Sub
#End Region
@@ -286,9 +302,11 @@ Partial Class Ventas_CatAutorizacionLimites
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
End If
DivMotivo.Visible = False
Case "Egs"
'QUITAR LA DE VENCIMIENTO
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
DivMotivo.Visible = True
End Select
UpModal.Update()
End Sub

View File

@@ -2834,6 +2834,7 @@
<asp:HiddenField ID="HdnAplicaIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPorcentajeIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCvePS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCveClasificacion" runat="server" Value="-1" ClientIDMode="Static" />
<div class="row" runat="server" visible="false">
<div class="col-md-12">
@@ -2898,10 +2899,6 @@
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UPPDatosUsado" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-4">
<label>Tipo Servicio:</label>
@@ -2922,7 +2919,7 @@
<div class="col-md-4">
<label>Año:</label>
<br />
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control" ></asp:TextBox>
<asp:TextBox ID="TxtAnioVehiculo" type="number" runat="server" Height="100%" Width="100%" CssClass="form-control"></asp:TextBox>
<asp:CustomValidator ID="CVAnio" runat="server" ClientValidationFunction="ValidaAnioVehiculo" ValidateEmptyText="true" ControlToValidate="TxtAnioVehiculo" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Año''</b> esta vacío o no tiene el formato correcto, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:CustomValidator>
</div>
</div>
@@ -2937,7 +2934,7 @@
<label>BCI:</label>
<br />
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%">
</asp:DropDownList>
</asp:DropDownList>
</div>
</div>
<div class="row">
@@ -2964,15 +2961,10 @@
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
@@ -3104,7 +3096,7 @@
<asp:DropDownList ID="DdlBCIAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%" AutoPostBack="true">
</asp:DropDownList>
<label for="<%= DdlBCIAjuste.ClientID.ToString()%>">BCI:</label>
<asp:RequiredFieldValidator ID="RFVBCIAjuste" runat="server" ControlToValidate="DdlBCIAjuste" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''BCI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RFVBCIAjuste" runat="server" ControlToValidate="DdlBCIAjuste" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''BCI''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEBCIAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVBCIAjuste" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
@@ -3138,7 +3130,7 @@
<div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodEnsamble" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<asp:CustomValidator ID="CVCodEnsamble" runat="server" ControlToValidate="TxtCodEnsamble" ValidateEmptyText="true" ClientValidationFunction="ValidarCodigoEnsamble" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cod.Ensamble''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta" />
<label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div>
</div>
@@ -3329,13 +3321,16 @@
}
function ValidaAnioVehiculo(val, args) {
//VALIDA SOLO SI SE SELECCIONO UN USADO
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value);
if (cveUsado > 0) {
var today = new Date();
var anioActual = today.getFullYear();
let CveClasificacion = HdnCveClasificacion.value;
const acumuladores = "20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229";
if (acumuladores.includes(CveClasificacion)) {
var anio = ToDouble(args.Value);
if (anio > 0) {
var valido = true;
if (anio < 1900) {
if (anio <= 1900 || anio > anioActual) {
valido = false;
}
if (anio.toString().length != 4) {
@@ -3356,18 +3351,33 @@
//MARCA OPTIMA
if (CveMarca == "1086") {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
//SI NO ES REQUERIDO, PONER COMO VALIDO
if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
}
return;
//MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$");
arguments.IsValid = regex.test(arguments.Value);
//EN MOTOBATERIAS ES REQUERIDO
if (!arguments.Value) {
arguments.IsValid = false;
} else {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$");
arguments.IsValid = regex.test(arguments.Value);
}
return;
//AUTOMOTRIZ-ACUMULADORES
} else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value);
//SI NO ES REQUERIDO, PONER COMO VALIDO
if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value);
}
return;
}
}
@@ -3533,13 +3543,13 @@
var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0";
Descuento = 0;
alert("No puede exceder el descuento maximo autorizado.");
}
}
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
@@ -3551,7 +3561,7 @@
if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
}
}
else {
$get("LblPrecioFinal").innerText = "0.00";
@@ -3598,10 +3608,10 @@
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""))) ;
var Total = (Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")));
$get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ',');
//SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL
Total = Total + MontoOriginal;
@@ -3745,8 +3755,7 @@
$("#LblSubTotal1").text($("#TxtSubTotal").val());
}
function AbrirModalDescuentoAdicional()
{
function AbrirModalDescuentoAdicional() {
$('#ModalDescuento').modal();
$get('LblTitulo1').style.display = '';
$get('LblTitulo2').style.display = 'none';
@@ -3967,215 +3976,215 @@
var ValorTxt = Obj.value;
var suma = 0;
var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma;
});
var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0;
Obj.value = 0;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
// else {
// if (parseFloat(Obj.value) > parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + (parseFloat($get("HdnAnticipos").value) + parseFloat(ValorTxt));
// else if (parseFloat(Obj.value) < parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - (parseFloat($get("HdnAnticipos").value) - parseFloat(ValorTxt));
// }
// SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
if (isNaN(ValorTxt))
ValorTxt = 0;
if (isNaN(Monto))
Monto = 0;
if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0;
Obj.value = 0;
}
function ValidarCantidad(t, c) {
if (t.value > c) {
t.value = c;
}
if (parseFloat(ValorTxt) > parseFloat(Monto)) {
alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
}
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
// else {
// if (parseFloat(Obj.value) > parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + (parseFloat($get("HdnAnticipos").value) + parseFloat(ValorTxt));
// else if (parseFloat(Obj.value) < parseFloat($get("HdnAnticipos").value))
// $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - (parseFloat($get("HdnAnticipos").value) - parseFloat(ValorTxt));
// }
// SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
}
function ImprimirCotizacion() {
__doPostBack('ctl00$HB$LNKImprimirCotizacion', '');
}
function SetText2(ObjTo, Value) {
ObjTo.innerText = Value;
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
function ValidarCantidad(t, c) {
if (t.value > c) {
function SeriePSBlur(b, txt, hdn) {
debugger;
t.value = c;
}
}
function Comma(Num) { //function to add commas to textboxes
Num += '';
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', '');
x = Num.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
function AddCodigoBarrasSerie(e) {
if (e.keyCode == 13 || e.which == 13) {
$('#BtnCodigoBarrasSerie').click();
}
}
//SERIE PS
function SeriePS(e, b, txt, hdn) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
function SeriePSBlur(b, txt, hdn) {
debugger;
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
//SERIE-LOTE INV
var H1 = "";
var H2 = "";
var T = "";
function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
if (event.which == 13 || event.keyCode == 13) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
function AFBlurEdit(Txt, Hdn1, Hdn2) {
if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
}
}
//Suma Totales
function FnSuma() {
debugger;
function EnterAFEditOK(Cve, Codigo) {
$get(H1.id).value = Cve;
$get(H2.id).value = Codigo;
$get(T.id).value = (Codigo == -1) ? "" : Codigo;
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS').value) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
}
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
totalVenta -= ToDouble($(this).val().toString());
});
//Suma Totales
function FnSuma() {
debugger;
$get('TxtSubTotal2').value = FormatoNumero(ToDouble($get('TxtSubTotal').value) - ToDouble($get('LblDescuentos').innerHTML) - ToDouble($get('LblAmortizacion').innerHTML), 2);
var totalVenta = ToDouble($get('TxtSubTotal2').value) + ToDouble($get('TxtIVA').value) + ToDouble($get('TxtIEPS').value) - ToDouble($get('TxtRetIVA').value) - ToDouble($get('TxtRetISR').value);
$("#<%=GvImpuestosLocales2.ClientID%> input[type='text']").each(function () {
totalVenta -= ToDouble($(this).val().toString());
});
$('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
$('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
}
}
function chkAnt(t, txt, importe) {
debugger;
$get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtTotal').value);
function chkAnt(t, txt, importe) {
debugger;
$get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
var SaldoCompra = parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (t.checked) {
if (t.checked) {
if (SaldoCompra > 0) {
if (SaldoCompra > importe) {
txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra;
} else {
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
if (SaldoCompra > 0) {
if (SaldoCompra > importe) {
txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra;
} else {
t.checked = false;
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
} else {
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
t.checked = false;
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
} else {
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
}
function FnCambiaAnt(chk, txt, saldo) {
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
}
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
function FnCambiaAnt(chk, txt, saldo) {
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
debugger;
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
var Total = ToDouble($get('TxtTotal').value);
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
function FnSumaValoresAnt() {
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
debugger;
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
}
function showDivEC() {
function FnSumaValoresAnt() {
var totalPoints = 0;
var t = '';
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
}
function showDivEC() {
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');

View File

@@ -4031,6 +4031,7 @@ Partial Class PV
HdnTipoInv.Value = drPS("Inv_CveMetodoInventario").ToString
HdnAplicaIEPS.Value = drPS("AplicaIEPS").ToString
HdnPorcentajeIEPS.Value = drPS("IEPSPorcentaje").ToString
HdnCveClasificacion.Value = drPS("CveClasificacion").ToString
'Muestra la tabla de tamaños
If drPS("CveTamaño").ToString().ToEntero() > 0 Then
DivRecepcionUsados.Visible = True
@@ -4736,6 +4737,7 @@ Partial Class PV
HdnCodigoPS.Value = "-1"
HdnTipoPS.Value = "-1"
HdnTipoInv.Value = "-1"
HdnCveClasificacion.Value = "-1"
DdlClasificacion.SelectedIndex = 0
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
@@ -5360,33 +5362,26 @@ Partial Class PV
Exit Sub
End If
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
Alert("El campo año esta vacío.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() <= 1900 Then
Alert("El campo año debe ser mayor a 1900.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtAnioVehiculo.Text.ToDecimal() > Now.Year Then
Alert("El campo año no puede ser mayor al año actual.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
Else
If DrPS IsNot Nothing Then
'SOLO DEBE AGREGAR POLIZA VIRTUAL SI ES ACUMULADOR
If DrPS("CveClasificacion").ToString().ToEntero().Contiene(20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229) Then
If Not String.IsNullOrEmpty(TxtAnioVehiculo.Text.Trim()) Then
If TxtAnioVehiculo.Text.ToDecimal() < 1900 Then
Alert("El año del vehiculo del vehículo no tiene el formato correcto.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
End If
End If
@@ -5448,9 +5443,14 @@ Partial Class PV
PU = ObjDescuento.PU
End If
Dim RowSP As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
Dim CveProyecto As Integer = -1 '
Dim Proyecto As String = ""
Dim CveProyecto As Integer = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveProyecto").ToString.ToEntero
Dim Proyecto As String = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("Proyecto").ToString
If RowSP IsNot Nothing Then
CveProyecto = RowSP("CveProyecto").ToString.ToEntero
Proyecto = RowSP("Proyecto").ToString
End If
Dim Consec = AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.Trim, PU, ObjDescuento.ImporteDescuento,

View File

@@ -191,7 +191,19 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
if (respCancelacion.CveEstatus == 20)
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelación en proceso'.");
}
else if (respCancelacion.CveEstatus == 23)
{
sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.");
}
else
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
}
}
else
{
@@ -312,7 +324,18 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
if (respCancelacion.CveEstatus == 20)
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelación en proceso'.");
}
else if (respCancelacion.CveEstatus == 23)
{
sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.");
}
else
{
sb.Append("El estatus de la factura fue cambiado a 'Cancelada'.");
}
}
else
{
@@ -480,10 +503,14 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
// e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
//}
if (e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23)
{
e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
}
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23 && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
{
e.Row.FCLinkButton("LnkCancelar").Visible = true;
//e.Row.FCLinkButton("LnkValidarRefac").Visible = false;
}
}
}

View File

@@ -7,10 +7,10 @@ Imports Microsoft.Reporting.WebForms
Imports System.IO
Imports System.IO.Compression
Imports System.Net
Imports System.Net.Http
Imports System.Net.Http
Partial Class RepVentaDetalle
Inherits ClsPaginas
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveProyecto As Integer
Get
@@ -54,26 +54,26 @@ Partial Class RepVentaDetalle
Set(value As Integer)
ViewState("CveMoneda") = value
End Set
End Property
End Property
Private Property TipoCliente As Integer
Get
If ViewState("TipoCliente") Is Nothing Then
Return -1
Else
Return ViewState("TipoCliente").ToString.ToEntero
End If
If ViewState("TipoCliente") Is Nothing Then
Return -1
Else
Return ViewState("TipoCliente").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("TipoCliente") = value
End Set
End Property
End Property
Private Property TCEspecifico As Decimal
Get
Return ViewState("TCEspecifico").ToString.ToDecimal
@@ -108,10 +108,10 @@ Partial Class RepVentaDetalle
Set(value As DataTable)
ViewState("DtColor") = value
End Set
End Property
End Property
#End Region
'pRivate ReadOnly Property ColumnasVisibles As
'pRivate ReadOnly Property ColumnasVisibles As
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
@@ -253,16 +253,16 @@ Partial Class RepVentaDetalle
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12) Then
ImgExcelVSH.Visible = True
ImgExcel.Visible = False
End If
End If
If UsuarioActual.CveVendedor > 0 AndAlso Not UsuarioActual.TienePermisoProceso(263) Then
DdlVendedor.SelectedValuesIfExistM(UsuarioActual.CveVendedor.ToString)
DdlVendedor.Attributes.Add("disabled", "")
DdlVendedor.Enabled = False
End If
End Sub
End Sub
#Region "CARGA COMBOS"
Private Sub CargaGrupo()
DdlGrupo.Items.Insert(0, New ListItem("Año", "1"))
@@ -278,7 +278,7 @@ Partial Class RepVentaDetalle
DdlGrupo.Items.Insert(10, New ListItem("Año Ejec.", "11"))
DdlGrupo.Items.Insert(11, New ListItem("Mes Ejec.", "12"))
DdlGrupo.Items.Insert(12, New ListItem("Año/Mes Ejec.", "13"))
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
DdlGrupo.DataBind()
End Sub
@@ -379,7 +379,7 @@ Partial Class RepVentaDetalle
'Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind()
DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Sin Vendedor", "-2"))
'CargaUsuarios
@@ -393,11 +393,11 @@ Partial Class RepVentaDetalle
'Carga Clasificacion Cliente
DdlClienteClasificacion.DataSource = GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa)
DdlClienteClasificacion.DataBind()
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTipoRelacion.DataSource = GlobalDTVtaTiposRelacion
DdlTipoRelacion.DataBind()
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTipoRelacion.DataSource = GlobalDTVtaTiposRelacion
DdlTipoRelacion.DataBind()
DdlTipoRelacion.Items.Insert(0, New ListItem("Todos", "-1"))
CargaGrupo()
@@ -421,9 +421,9 @@ Partial Class RepVentaDetalle
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
End Sub
#End Region
#Region "SELECTED INDEX CHANGE"
Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaEstatus()
@@ -451,18 +451,18 @@ Partial Class RepVentaDetalle
'DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero} OR {DdlClienteClasificacion.SelectedValue.ToEntero} = -1")
'DdlClientes.DataBind()
'DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
End Sub
#End Region
#Region "CONSULTAR"
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
ConfiguraEmpresa()
UPDatos.Update()
End Sub
Private Sub CargaDatos()
Private Sub CargaDatos()
Dim AnioMes = If(Request("AnioMes") IsNot Nothing, Request("AnioMes").ToString, "-1").ToString
Dim Fecha = If(Request("Fecha") IsNot Nothing, Request("Fecha").ToString, "-1").ToString
Dim IVA = If(Request("IVA") IsNot Nothing, Request("IVA").ToString, "-1").ToString
@@ -475,7 +475,7 @@ Partial Class RepVentaDetalle
'PARAMETROS DE LOS LISTBOXS
Dim TipoComprobante As String = If(DdlTipoComprobante.GetSelectedValuesM = "", "-1", DdlTipoComprobante.GetSelectedValuesM)
Dim Sucursales As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
Dim CveCondicionesPago As Integer = If(DdlCondicionesPago.SelectedValue = "", -1, DdlCondicionesPago.SelectedValue.ToEntero)
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
@@ -489,16 +489,16 @@ Partial Class RepVentaDetalle
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
ChkLecturaAdmin.Checked = Not ModalidadContable
Dim ObjVentas As New ClsVentas()
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
ChkLecturaAdmin.Checked = Not ModalidadContable
Dim ObjVentas As New ClsVentas()
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=Not ChkLecturaAdmin.Checked, CveTipoRelacion:=DdlTipoRelacion.SelectedValue.ToEntero()) Then
DtVentas = AddRows(ObjVentas.DtResultados)
ImgImprimir.Enabled = True
@@ -507,19 +507,19 @@ Partial Class RepVentaDetalle
Else
GvDatos.DataSource = Nothing
GvVsh.DataSource = Nothing
End If
End If
ObjVentas.Dispose()
Agrupador = DdlGrupo.SelectedItem.Text
Agrupador = DdlGrupo.SelectedItem.Text
GvDatos.DataBind()
GvVsh.DataBind()
End Sub
End Sub
#End Region
#Region "GRIDVIEW"
Private Function AddRows(ByRef DT As DataTable) As DataTable
Dim i As Integer = 0
Dim Ultima As String = String.Empty
@@ -607,16 +607,16 @@ Partial Class RepVentaDetalle
If e.Row.DBCampo("RetIVA").ToDouble < 0 Then e.Row.Cells(9).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("RetISR").ToDouble < 0 Then e.Row.Cells(10).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(11).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(12).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(13).ForeColor = Drawing.Color.Red
'If e.Row.DBCampo("MAX_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxSubTotal").Text = ""
'If e.Row.DBCampo("AVG_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGSubTotal").Text = ""
'If e.Row.DBCampo("MIN_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMinSubTotal").Text = ""
'If e.Row.DBCampo("MAX_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxTotal").Text = ""
'If e.Row.DBCampo("AVG_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGTotal").Text = ""
'If e.Row.DBCampo("MIN_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMinTotal").Text = ""
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(12).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("Total").ToDouble < 0 Then e.Row.Cells(13).ForeColor = Drawing.Color.Red
'If e.Row.DBCampo("MAX_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxSubTotal").Text = ""
'If e.Row.DBCampo("AVG_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGSubTotal").Text = ""
'If e.Row.DBCampo("MIN_SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlMinSubTotal").Text = ""
'If e.Row.DBCampo("MAX_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMaxTotal").Text = ""
'If e.Row.DBCampo("AVG_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlAVGTotal").Text = ""
'If e.Row.DBCampo("MIN_Total").ToDouble = 0 Then e.Row.FCLiteral("LtlMinTotal").Text = ""
End If
End Sub
Protected Sub GvVsh_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVsh.RowDataBound
@@ -634,11 +634,11 @@ Partial Class RepVentaDetalle
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
End If
End Sub
End Sub
#End Region
#Region "PERSONALIZAR COLUMNAS"
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
If ChkFolio.Checked Then
@@ -822,10 +822,10 @@ Partial Class RepVentaDetalle
ImgExcelPersonalizado.Visible = False
End If
UPDatos.Update()
End Sub
End Sub
#End Region
#Region "IMPRESIONES"
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
'GvDatos.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
@@ -876,8 +876,8 @@ Partial Class RepVentaDetalle
pathPDF = Server.MapPath(String.Format("~/Empresas/{0}/PDF/{1}/{2}.pdf", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
If Not IO.File.Exists(pathPDF) Then
GenerarFacturaVentaDEV(gvr.DataKey("CveVenta").ToEntero, UsuarioActual.CveUsuario)
If Not IO.File.Exists(pathPDF) Then
GenerarFacturaVentaDEV(gvr.DataKey("CveVenta").ToEntero, UsuarioActual.CveUsuario)
'ListaPDF.Add(New MFacturaDescarga() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero, .PDF = GenerarFacturaVentaDEV(gvr.DataKey("CveVenta").ToEntero, 100)})
End If
End If
@@ -886,8 +886,8 @@ Partial Class RepVentaDetalle
'D E S C A R G A I O N I C !
Dim DescargaZIP As Ionic.Zip.ZipFile = New Ionic.Zip.ZipFile()
Using DescargaZIP
DescargaZIP.UseZip64WhenSaving = Ionic.Zip.Zip64Option.AsNecessary
DescargaZIP.UseZip64WhenSaving = Ionic.Zip.Zip64Option.AsNecessary
For Each gvr As GridViewRow In GvDatos.Rows
If gvr.DataKey("CveVenta").ToEntero > 0 Then
Select Case gvr.DataKey("TipoDocumento").ToString
@@ -912,9 +912,9 @@ Partial Class RepVentaDetalle
If IO.File.Exists(pathPDF) Then
'NO AGREGAR ARCHIVOS REPETIDOS
Dim File As New IO.FileInfo(pathPDF)
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathPDF, gvr.DataKey("TipoDocumento").ToString)
End If
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathPDF, gvr.DataKey("TipoDocumento").ToString)
End If
End If
End If
Next
@@ -923,7 +923,7 @@ Partial Class RepVentaDetalle
Response.AddHeader("content-Disposition", "attachment; filename=ReporteVentasPDF.zip")
Response.ContentType = "application/zip"
Response.End()
End Sub
End Sub
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
@@ -978,8 +978,8 @@ Partial Class RepVentaDetalle
If IO.File.Exists(pathXML) Then
'NO AGREGAR ARCHIVOS REPETIDOS
Dim File As New IO.FileInfo(pathXML)
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathXML, gvr.DataKey("TipoDocumento").ToString)
If Not DescargaZIP.Any(Function(x) x.FileName.Contains(File.Name)) Then
DescargaZIP.AddFile(pathXML, gvr.DataKey("TipoDocumento").ToString)
End If
End If
End If
@@ -1014,13 +1014,15 @@ Partial Class RepVentaDetalle
Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b>&nbsp;{DdlVendedor.GetSelectedText}")
CveUsuario = If(DdlUsuario.SelectedValue = "-1", "", $"&emsp;<b>Usuario:</b>&nbsp;{DdlUsuario.SelectedItem.Text}")
CveEstatusFactura = If(DdlEstatus.GetSelectedText = "", "", $"&emsp;<b>Estatus:</b>&nbsp;{DdlEstatus.GetSelectedText}")
CondicionesPago = If(DdlCondicionesPago.selectedValue = "-1", "", String.Format("&emsp;<b>Condiciones Pago</b>: {0}", DdlCondicionesPago.SelectedItem.Text))
CondicionesPago = If(DdlCondicionesPago.selectedValue = "-1", "", String.Format("&emsp;<b>Condiciones Pago</b>: {0}", DdlCondicionesPago.SelectedItem.Text))
Dim RutaFormato = String.Format("{0}Formatos\RepVentaDetalle.rdlc", UsuarioActual.Empresa.Ruta)
Dim Archivo As New System.IO.FileInfo(RutaFormato)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim logouri = String.Format("file://{0}", Imagen.FullName)
Dim dt As DataTable = DtVentas.FiltraParametros("(GPO IS NULL AND Cantidad IS NOT NULL) OR (GPO IS NOT NULL AND Cantidad IS NOT NULL)")
Dim params As New List(Of ReportParameter)
@@ -1050,134 +1052,134 @@ Partial Class RepVentaDetalle
GenerarPDF()
End Sub
Private Function GenerarFacturaVentaDEV(CveVenta As Integer, CveUsuario As Integer) As Byte()
Return DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, CveUsuario)
'Dim ObjVentas As New ClsVentas
'Dim Vta As Modelos.Factura = Nothing
'Dim TmpDTImpuestos = New DataTable
'TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
'TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
'TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' Dim dtVentas As DataTable = ObjVentas.DtResultados
' ' se rellenan los campos de la factura
' Vta = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, Server.MapPath("/"))
' Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
' 'se rellena la sucursal
' Vta.Cliente.Sucursal = New Modelos.ClienteModel(dtVentas(0)("CveCliente").ToString.ToEntero, UsuarioActual.CveEmpresa)
' Vta.Cliente = New Modelos.ClienteModel
' Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
' Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
' Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
' Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
' Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
' Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
' Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
' Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
' Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
' Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
' Vta.AtencionA = dtVentas(0)("AtencionA").ToString
' Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
' Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
' Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
' Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
' Vta.RefDocto = dtVentas(0)("Ref").ToString
' Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
' Vta.ClienteSucursal = New Modelos.SucursalModel
' Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
' Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
' Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
' Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
' Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
' Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
' Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
' Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
' Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
' Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
' Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
' Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
' Vta.EnviarA = New Modelos.EnviarAModel
' Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
' Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
' Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
' Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
' Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
' Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
' Dim DR As DataRow = TmpDTImpuestos.NewRow()
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
' 'solo para eclipse, que muesre un subtotal debajo de IVA
' If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' End If
' If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
' Vta.DtDetalle = ObjVentas.DtResultados
' End If
' If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' Dim dtImpuesto As DataTable = ObjVentas.DtResultados
' If dtImpuesto.Rows.Count > 0 Then
' For Each Row As DataRow In dtImpuesto.Rows
' Dim Orden = 80
' If Row("Importe").ToString.ToDouble <> 0 Then
' DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
' DR("Importe") = Row("Importe").ToString.ToDouble
' DR("Orden") = Orden
' TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' Orden = Orden + 1
' End If
' Next
' End If
' Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
' Else
' Vta.DtDeduccion = ObjVentas.DtResultados
' End If
' End If
' If ObjVentas.GetVentasFirmas(CveVenta) Then
' Vta.DtFirmas = ObjVentas.DtResultados
' End If
'End If
'ObjVentas.Dispose()
'If Not IsNothing(Vta) Then
' PdfFactura(Vta)
' Vta = Nothing
'End If
End Function
Private Function GenerarFacturaVentaDEV(CveVenta As Integer, CveUsuario As Integer) As Byte()
Return DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, CveUsuario)
'Dim ObjVentas As New ClsVentas
'Dim Vta As Modelos.Factura = Nothing
'Dim TmpDTImpuestos = New DataTable
'TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
'TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
'TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' Dim dtVentas As DataTable = ObjVentas.DtResultados
' ' se rellenan los campos de la factura
' Vta = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, Server.MapPath("/"))
' Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
' 'se rellena la sucursal
' Vta.Cliente.Sucursal = New Modelos.ClienteModel(dtVentas(0)("CveCliente").ToString.ToEntero, UsuarioActual.CveEmpresa)
' Vta.Cliente = New Modelos.ClienteModel
' Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
' Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
' Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
' Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
' Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
' Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
' Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
' Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
' Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
' Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
' Vta.AtencionA = dtVentas(0)("AtencionA").ToString
' Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
' Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
' Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
' Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
' Vta.RefDocto = dtVentas(0)("Ref").ToString
' Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
' Vta.ClienteSucursal = New Modelos.SucursalModel
' Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
' Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
' Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
' Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
' Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
' Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
' Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
' Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
' Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
' Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
' Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
' Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
' Vta.EnviarA = New Modelos.EnviarAModel
' Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
' Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
' Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
' Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
' Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
' Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
' Dim DR As DataRow = TmpDTImpuestos.NewRow()
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
' 'solo para eclipse, que muesre un subtotal debajo de IVA
' If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' End If
' If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
' Vta.DtDetalle = ObjVentas.DtResultados
' End If
' If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
' Dim dtImpuesto As DataTable = ObjVentas.DtResultados
' If dtImpuesto.Rows.Count > 0 Then
' For Each Row As DataRow In dtImpuesto.Rows
' Dim Orden = 80
' If Row("Importe").ToString.ToDouble <> 0 Then
' DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
' DR("Importe") = Row("Importe").ToString.ToDouble
' DR("Orden") = Orden
' TmpDTImpuestos.Rows.Add(DR)
' DR = TmpDTImpuestos.NewRow()
' Orden = Orden + 1
' End If
' Next
' End If
' Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
' Else
' Vta.DtDeduccion = ObjVentas.DtResultados
' End If
' End If
' If ObjVentas.GetVentasFirmas(CveVenta) Then
' Vta.DtFirmas = ObjVentas.DtResultados
' End If
'End If
'ObjVentas.Dispose()
'If Not IsNothing(Vta) Then
' PdfFactura(Vta)
' Vta = Nothing
'End If
End Function
#End Region
#Region "GRAFICA"
Private Sub CreaDataTableColor()
DtColor = New DataTable
DtColor.Columns.Add("Color")
@@ -1308,9 +1310,9 @@ Partial Class RepVentaDetalle
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
CambioGrafica()
End Sub
End Sub
#End Region
End Class

View File

@@ -493,7 +493,7 @@
<table>
<asp:CheckBox ID="ChkDireccionEnvio" runat="server" AutoPostBack="true" />
<span style="margin-left: 1px;">
<asp:DropDownList ID="DdlDireccionEnvio" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalClienteVentaDireccion" DataValueField="CveDireccionEnvio" Width="180px" Visible="false">
<asp:DropDownList ID="DdlDireccionEnvio" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalClienteVentaDireccion" DataValueField="CveDireccionEnvio" Width="180px" Visible="false" OnSelectedIndexChanged="DdlDireccionEnvio_SelectedIndexChanged">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</span>
@@ -2219,7 +2219,7 @@
<ContentTemplate>
<asp:UpdatePanel ID="UPComplementosSAT" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" class="TextTab">
<table border="0" cellpadding="0" cellspacing="0" class="TextTab" style="width: 100%">
<tr valign="top">
<td rowspan="2" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
@@ -2445,148 +2445,150 @@
</div>
</td>
<td rowspan="1" colspan="2">
<div class="portlet light xspadding bordered whitoutcol" style="width: 850px;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">COMERCIO EXTERIOR</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding: 10px 20px 10px 30px">
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-body">
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-3 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblTipoOperacion" runat="server"></asp:Label>
<%--<asp:DropDownList ID="DdlTipoOperacion" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATTipoOperacionDescripcion" DataValueField="CveTipoOperacion"></asp:DropDownList>--%>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Clave Pedimento:</label>
<div class="col-md-5 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblClavePedimento" runat="server"></asp:Label>
<%--<asp:TextBox ID="TxtClavePedimento" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>--%>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Incoterm:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm">
</asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Motivo Traslado:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<%-- <label class="col-md-1"></label>
<div class="col-md-1">
</div>--%>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UPPDestina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Nombre:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtDestinatarioNombre" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCalle" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="55px"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="65px"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtPais" AutoPostBack="true" OnSelectedIndexChanged="DdlPais_SelectedIndexChanged" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPaisDescripcion" DataValueField="CvePais"></asp:DropDownList>
<asp:TextBox ID="TxtComExtPais" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtEstado" AutoPostBack="true" OnSelectedIndexChanged="DdlEstado_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATEstadoNombreEstado" DataValueField="CveEstado"></asp:DropDownList>
<asp:TextBox ID="TxtComExtEstado" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATMunicipioDescripcion" DataValueField="CveMunicipio"></asp:DropDownList>
<asp:TextBox ID="TxtComExtMunicipio" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtColonia" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" Visible="false" runat="server" DataTextField="ClaveSATColoniaNombreAsentamiento" DataValueField="CveColonia"></asp:DropDownList>
<asp:TextBox ID="TxtComExtColonia" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row">
<div class="col-md-7">
<div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">COMERCIO EXTERIOR</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="row">
<div class="col-md-12">
Convertir a unidad Aduana
<div class="tools">
<a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding: 10px 20px 10px 30px">
<asp:UpdatePanel ID="UpComercioExterior" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-body">
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Tipo Operación:</label>
<div class="col-md-3 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblTipoOperacion" runat="server"></asp:Label>
<%--<asp:DropDownList ID="DdlTipoOperacion" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATTipoOperacionDescripcion" DataValueField="CveTipoOperacion"></asp:DropDownList>--%>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Clave Pedimento:</label>
<div class="col-md-5 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:Label ID="LblClavePedimento" runat="server"></asp:Label>
<%--<asp:TextBox ID="TxtClavePedimento" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>--%>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Incoterm:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm">
</asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-2 form-group form-md-line-input">Motivo Traslado:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlSATMotivoTraslado" Width="100%" runat="server" CssClass="select2me" DataTextField="ClaveSATMotivoTrasladoDescripcion" DataValueField="CveMotivoTraslado"></asp:DropDownList>
</div>
<label class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;">Num Reg IdTrib:</label>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtNumRegIdTrib" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<%-- <label class="col-md-1"></label>
<div class="col-md-1">
</div>--%>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UPPDestina" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Nombre:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtDestinatarioNombre" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Calle:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCalle" CssClass="form-control input-sm" runat="server" Width="100%"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>Núm.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtNumero" CssClass="form-control input-sm" runat="server" Width="55px"></asp:TextBox>
</div>
<div class="col-md-1 form-group form-md-line-input"><span>CP.</span></div>
<div class="col-md-2 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:TextBox ID="TxtComExtCP" CssClass="form-control input-sm" runat="server" Width="65px"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Pais:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtPais" AutoPostBack="true" OnSelectedIndexChanged="DdlPais_SelectedIndexChanged" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPaisDescripcion" DataValueField="CvePais"></asp:DropDownList>
<asp:TextBox ID="TxtComExtPais" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Estado:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtEstado" AutoPostBack="true" OnSelectedIndexChanged="DdlEstado_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATEstadoNombreEstado" DataValueField="CveEstado"></asp:DropDownList>
<asp:TextBox ID="TxtComExtEstado" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2 form-group form-md-line-input"><span>Municipio:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Visible="false" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATMunicipioDescripcion" DataValueField="CveMunicipio"></asp:DropDownList>
<asp:TextBox ID="TxtComExtMunicipio" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
<div class="col-md-2 form-group form-md-line-input" style="padding-left: 20px;"><span>Colonia:</span></div>
<div class="col-md-4 form-group form-md-line-input" style="margin-top: 0px; padding-top: 0px; display: inline-block;">
<asp:DropDownList ID="DdlComExtColonia" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" Visible="false" runat="server" DataTextField="ClaveSATColoniaNombreAsentamiento" DataValueField="CveColonia"></asp:DropDownList>
<asp:TextBox ID="TxtComExtColonia" CssClass="form-control input-sm" runat="server" Width="100%" Visible="false"></asp:TextBox>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
Convertir a unidad Aduana
<asp:TextBox ID="TxtComExtConvertir" runat="server" Width="60px"></asp:TextBox><asp:Button ID="BtnComExtConvertirUnidad" runat="server" Text="Convertir" />
<asp:GridView ID="GvComercioExterior" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
EmptyDataText="No hay datos disponibles" DataKeyNames="Cantidad,Codigo,ClaveSATFraccionArancelaria,ClaveSATUnidadAduana" OnRowDataBound="GvComercioExterior_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" />
<asp:TemplateField HeaderText="Valor Unitario">
<ItemTemplate>
<asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" />
<asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" />
<%-- <asp:TemplateField HeaderText="Unidad Aduana">
<asp:GridView ID="GvComercioExterior" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true" AutoGenerateColumns="False"
EmptyDataText="No hay datos disponibles" DataKeyNames="Cantidad,Codigo,ClaveSATFraccionArancelaria,ClaveSATUnidadAduana" OnRowDataBound="GvComercioExterior_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" />
<asp:TemplateField HeaderText="Valor Unitario">
<ItemTemplate>
<asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" />
<asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" />
<%-- <asp:TemplateField HeaderText="Unidad Aduana">
<ItemTemplate>
<asp:DropDownList ID="DdlUnidadAduana" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="ClaveSATUnidadAduanaDescripcion" DataValueField="CveUnidadAduana"></asp:DropDownList>
</ItemTemplate>
@@ -2596,22 +2598,143 @@
<ADS:Dropdownlost ID="DdlFraccionArancelaria" runat="server" CssClassDdl="selecthidden" CssStyle="width: 100%;" DataTextField="ClaveSATFraccionArancelariaDescripcion" DataValueField="CveFraccionArancelaria"></ADS:Dropdownlost>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Total USD">
<ItemTemplate>
<asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Marca">
<ItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:TemplateField HeaderText="Total USD">
<ItemTemplate>
<asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Marca">
<ItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-5">
<div id="DivCartaPorte" runat="server" visible="false" class="portlet light xspadding bordered whitoutcol" style="width: 100%">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">CARTA PORTE</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body ">
<div class="rowpadding">
<asp:UpdatePanel ID="UpEmitirTransitorio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row rowpadding">
<label class="col-md-2">Emitir:</label>
<div class="col-md-10">
<asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" CssClass="chksino" Text=" " />
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Origen:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtOrigenCP" runat="server" Enabled="false" Text="" CssClass="form-control input-sm"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Destino:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtDestinoCP" runat="server" Enabled="false" Text="" CssClass="form-control input-sm"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Fecha Llegada:</label>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaLlegadaCP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaSalidaCP" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaSalidaCP" runat="server" TargetControlID="TxtFechaLlegadaCP" Mask="99/99/9999" MaskType="Date" DisplayMoney="Right" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaSalidaCP" TargetControlID="TxtFechaLlegadaCP" PopupButtonID="ImgFechaSalidaCP" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<label class="col-md-2">Fecha Entrega:</label>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaCP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaCP" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaCP" runat="server" TargetControlID="TxtFechaEntregaCP" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFEchaEntregaCP" TargetControlID="TxtFechaEntregaCP" PopupButtonID="ImgFechaEntregaCP" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Distancia:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control input-sm" type="number"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Chofer:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Unidad:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlUnidadCamionActivoFijo_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" 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="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<br />
<div class="row rowpadding" runat="server" id="DvConfiguracionVeiculo" visible="false">
<label class="col-md-2">Configuración:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlConfigAuto" CssClass="form-control input-sm select2me" Width="100%" runat="server" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="DdlConfigAuto_SelectedIndexChanged" CausesValidation="true" DataTextField="ClaveConfigAutoTransporteDescripcion" DataValueField="CveConfigAutoTransporte" Style="padding: 0px">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlConfigAuto" runat="server" Enabled="false" ControlToValidate="DdlConfigAuto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Configuración Carta Porte''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfvDdlConfigAuto" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlConfigAuto" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row rowpadding" runat="server" id="DvRemolque1" visible="false">
<label class="col-md-2">Remolque 1:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlRemolque1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlRemolque1_SelectedIndexChanged"></asp:DropDownList>
</div>
</div>
<div class="row rowpadding" runat="server" id="DvRemolque2" visible="false">
<label class="col-md-2">Remolque 2:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlRemolque2" AutoPostBack="true" Width="100%" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca"></asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</td>
@@ -4362,7 +4485,7 @@
<td colspan="1">&nbsp;</td>
</tr>
</table>
<asp:LinkButton ID="BtnCerrarBloqueo" runat="server" CssClass="btn btn-danger" Text="Cerrar Turno" ValidationGroup="GprBloqueo"/>
<asp:LinkButton ID="BtnCerrarBloqueo" runat="server" CssClass="btn btn-danger" Text="Cerrar Turno" ValidationGroup="GprBloqueo" />
</asp:Panel>
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
@@ -4624,7 +4747,7 @@
</div>
<div class="actions">
<div class="btn-group">
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green'></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important;cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green'></i><span class='caption-subject bold'>Agregar</span>" Style="font-weight: 700 !important; cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Visible="false" Style="cursor: pointer; text-decoration: none;" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-green' style='font-weight: 700 !important;' ></i> <span class="caption-subject bold font-green">Agendar</span></asp:HyperLink><br />
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" />
@@ -6510,7 +6633,7 @@
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
</div>
<div class="col-md-3" id="DivBtnRemNC" runat="server" visible="false" >
<div class="col-md-3" id="DivBtnRemNC" runat="server" visible="false">
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
</div>
</div>
@@ -6570,12 +6693,12 @@
<asp:RangeValidator ID="RVNCPorcentaje" runat="server" Type="Double" MinimumValue="0.01" MaximumValue="100.00" ErrorMessage="El campo <b>''Porcentaje''</b> debe estar entre 1 y el porcentaje máximo de la factura(Saldo)." ControlToValidate="TxtNCPorcentaje" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCENCPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RVNCPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row" style="margin-right: 10px; margin-top: 5px;" align="right">
<input type="text" id="TxtBusqueda10" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
<div class="col-md-12" style="height: 440px; overflow: auto">
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound"
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -7890,6 +8013,20 @@
<ajax:ValidatorCalloutExtender ID="VCEImporteSolicitud" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteSolcitud" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtImporteSolicitud.ClientID.ToString()%>">Importe:</label>
</div>
<div id="DivMotivoAutorizacion" runat="server" visible="false" class="row">
<div class="col-md-12">
<div class="row">
<label class="col-md-3 truncate" style="color: #888888; font-family: 'Open Sans', sans-serif; direction: ltr; font-size: 12px;">Motivo:</label>
</div>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtMotivoAutorizacion" CssClass="form-control input-sm" runat="server" Rows="2" TextMode="MultiLine" Width="100%" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMotivo" runat="server" ControlToValidate="TxtMotivoAutorizacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="VgmGuardarAut"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMotivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVMotivo" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnSolicitarCredito" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardarAut" />

View File

@@ -1356,6 +1356,15 @@ Partial Class Ventas
ViewState("ListaAnticiposAplicados") = value
End Set
End Property
Private Property CveTimbreCartaPorteVenta As Integer
Get
Return If(IsNothing(ViewState("CveTimbreCartaPorteVenta")), -1, ViewState("CveTimbreCartaPorteVenta").ToString().ToEntero())
End Get
Set(value As Integer)
ViewState("CveTimbreCartaPorteVenta") = value
End Set
End Property
#End Region
#Region "Propiedades PuntoVenta"
@@ -2272,6 +2281,9 @@ Partial Class Ventas
UpFacturar.Update()
'CargaTiposDocumentos()
TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 Then
DivCartaPorte.Visible = True
End If
ViewState("EstablecioFolio") = False
'ViewState("SubProyectoPorcentajeIVA") = 0
RefacturacionGeneroNC = False
@@ -2448,7 +2460,7 @@ Partial Class Ventas
CargaCuentasTerminal()
CargaDdlNCPS()
CargarCamiones()
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.Empresa.UsaAC Then
@@ -2643,6 +2655,9 @@ Partial Class Ventas
ObjInventario.Dispose()
End If
If DdlTipoComprobante.SelectedValue = "Ing" Then
CargaVentaCortePorte(Me.CveVenta)
End If
End If
Else
@@ -4888,6 +4903,7 @@ Partial Class Ventas
If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then
ChkDireccionEnvio.Checked = True
DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero())
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
DdlDireccionEnvio.Enabled = False
ChkDireccionEnvio.Enabled = False
DdlDireccionEnvio.Visible = True
@@ -6014,6 +6030,7 @@ Partial Class Ventas
End If
End If
CargaDireccionCP()
ViewState("Vendedor") = ObjCliente.Vendedor
ViewState("CtaContable") = ObjCliente.CuentaContable
@@ -7088,6 +7105,8 @@ Partial Class Ventas
CargaVendedores()
CargaDireccionCP()
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
If CveVenta <= 0 Then
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva()
@@ -7099,6 +7118,7 @@ Partial Class Ventas
UpEstatus.Update()
UPCondicionesPago.Update()
UpCliente.Update()
UpEmitirTransitorio.Update()
End Sub
Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal
Dim Retorno As Decimal = 0
@@ -7594,7 +7614,7 @@ Partial Class Ventas
End If
'VERIFICA SI EL DESCUENTO SUPERA EL SUBTOTAL
If ObjDescuento.ImporteDescuento > (Cantidad * PU) Then
If ObjDescuento.ImporteDescuento.RoundSQL(2) > (Cantidad * PU).RoundSQL(2) Then
Alert("El descuento no puede ser mayor al subtotal", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -8158,6 +8178,17 @@ Partial Class Ventas
End If
End If
If ChkEmitirCartaPorte.Checked Then
If String.IsNullOrEmpty(TxtOrigenCP.Text.Trim()) Then
Alert("La carta porte no tiene un origen definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If String.IsNullOrEmpty(TxtDestinoCP.Text.Trim()) Then
Alert("La carta porte no tiene un destino definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then
DdlTipoComprobante.SelectedValue = "Ing"
@@ -8300,6 +8331,7 @@ Partial Class Ventas
End If
End If
'SI NO TIENE AUTORIZACION VERIFICAR LIMITE DE CREDITO Y CANDADOS DE VENTA
'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada.
If Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then
'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
@@ -8335,6 +8367,20 @@ Partial Class Ventas
Exit Sub
End If
ObjVentas.Dispose()
'VERIFICA SI TIENE BLOQUEO POR DIAS VENCIDOS
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa, TipoVerificacion:=2)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion = 2 Then
Alert(OpcionMsg, TipoMensaje.MsgError)
Exit Sub
End If
End If
End If
'End If
@@ -8778,9 +8824,18 @@ Partial Class Ventas
Dim CveVentaAnterior As Integer = Me.CveVenta
Dim CveTimbreCartaPorte As Integer = -1
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre)
If ErrorList.Count = 0 AndAlso ChkEmitirCartaPorte.Checked AndAlso ObjFactura.TipoDocto = "Ing" Then
CveTimbreCartaPorte = GuardarCartaPorte(ObjFactura, ObjGeneral, ObjClientes)
If CveTimbreCartaPorte <= 0 Then
ErrorList.Add("Ocurrió un error al registrar la carta porte")
End If
End If
'Agregamos las OCs a la tabla
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
Dim CveVentaDetalle As Integer = 0
@@ -9162,14 +9217,27 @@ Partial Class Ventas
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
End If
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, ObjFactura, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
DebeTimbrar = False
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
End If
End If
Dim ObjTimbrado As New Timbrado
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
If DebeTimbrar Then
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
End If
Dim FolioFiscalFactura As String = ObjTimbrado.UUID
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
ObjTimbrado = Nothing
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
If DebeTimbrar AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
Try
For Each NCGenerada In ListaNotasCreditoGeneradas
If NCGenerada.Timbre IsNot Nothing Then
@@ -12040,16 +12108,20 @@ Partial Class Ventas
End If
End If
If ObjFactura.TipoDocto = "Ing" Then
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
End If
ElseIf ObjFactura.TipoDocto = "Dev" Then
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
'SI ES REFACTURACION, NO DEBE AFECTAR LOS USADOS
If Not NuevaFactura.Contiene(1) Then
If ObjFactura.TipoDocto = "Ing" Then
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
End If
ElseIf ObjFactura.TipoDocto = "Dev" Then
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
End If
End If
End If
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
If DtVentasNC Is Nothing Then
InicializaDTVentasNC()
@@ -12372,7 +12444,7 @@ Partial Class Ventas
'INVENTARIOS
If ErrorList.Count = 0 Then
If Not EsNCAmortizacion AndAlso Not NCDescuento Then
If GuardarVentaInventarios(ObjInventario, ObjVentas, ObjConta, factura) Then
If GuardarVentaInventarios(ObjInventario, ObjVentas, ObjConta, factura, TmpDTDetalle) Then
ErrorList.Add("Ocurrio un error al Guardar Inventario")
End If
End If
@@ -14026,7 +14098,7 @@ Partial Class Ventas
End Try
End Function
Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, factura As Modelos.Factura) As Boolean
Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalle As DataTable) As Boolean
Dim OcurrioError As Boolean = False
Try
@@ -14035,7 +14107,7 @@ Partial Class Ventas
If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
For Each CveRemision As Integer In RemisionesLista
'El almacen general es el Primer Almacen de Material en la Sucursal
If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9) Then
If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9, TmpDTDetalle) Then
OcurrioError = True
ErrorList.Add("Ocurrió un error al verificar inventario de remisiones.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For
@@ -16004,6 +16076,14 @@ Partial Class Ventas
Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, ObjFactura, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
Exit Sub
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
End If
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
'MENSAJE PRINCIPAL
@@ -17092,6 +17172,7 @@ Partial Class Ventas
CargaVendedores()
UpDetalle.Update()
UpEmitirTransitorio.Update()
End Sub
Private Sub CambiaSucursal(Optional RecargarPartidas As Boolean = True)
CargaFormatoSucursal()
@@ -17103,6 +17184,8 @@ Partial Class Ventas
RecargaSucursalPartidas()
End If
CargaDireccionSucursalOrigen(GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(""))
DdlPS.Attributes.Remove("data-cvesubproyecto")
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
@@ -19579,7 +19662,7 @@ Partial Class Ventas
gvr.FCDropDownList("DdlUnidadMedida").DataBind()
End Sub
Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjVentas As ClsVentas, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjVentas As ClsVentas, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer, TmpDTDetalle As DataTable) As Boolean
Dim OcurrioError As Boolean = False
Try
Dim DtMovimientos As DataTable
@@ -19715,7 +19798,7 @@ Partial Class Ventas
End If
If Not OcurrioError AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveMovimientoSalidaAlmacen, CveAlmacenParaSalida, ObjInventario, ObjConta:=ObjConta)
OcurrioError = Not GenerarMovimientoAlmacenVirtual(TmpDTDetalle, CveMovimientoSalidaAlmacen, CveAlmacenParaSalida, ObjInventario, ObjConta:=ObjConta)
End If
End If
@@ -20131,7 +20214,7 @@ Partial Class Ventas
Return Not OcurrioError
End Function
Private Function GenerarMovimientoAlmacenVirtual(CveMovimientoSalidaAlmacen As Integer, CveAlmacen As Integer, ByRef ObjInventario As ClsInventarios, Optional ByRef ObjConta As ClsContabilidad = Nothing) As Boolean
Private Function GenerarMovimientoAlmacenVirtual(TmpDTDetalle As DataTable, CveMovimientoSalidaAlmacen As Integer, CveAlmacen As Integer, ByRef ObjInventario As ClsInventarios, Optional ByRef ObjConta As ClsContabilidad = Nothing) As Boolean
Dim OcurrioError As Boolean = False
Try
@@ -20162,7 +20245,13 @@ Partial Class Ventas
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
Dim CveVentaDetalle As Integer = -1
'RELACIONA LA VENTA DETALLA DE LA REMISION
If TmpDTDetalle IsNot Nothing Then
CveVentaDetalle = TmpDTDetalle.FiltroPrimeroValor("CveVentaDetalle", $"Cantidad = {RowUsado("Cantidad")} AND CvePS = {RowUsado("CvePS")}").ToEntero()
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveVentaDetalle:=CveVentaDetalle) Then
OcurrioError = True
Exit For
End If
@@ -21054,6 +21143,10 @@ Partial Class Ventas
TxtCodigo.ReadOnly = False
End If
If CantidadFacturadaRemision = 0 AndAlso UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = True
End If
TxtCantidad.Enabled = True
DdlClasificacion.Enabled = True
DdlPS.Enabled = True
@@ -21067,6 +21160,8 @@ Partial Class Ventas
LblSubTotal1.Text = TxtSubTotal.Text
LblAmort.Text = TxtSubTotal.Text
LimpiaEscondeContado()
UPPVentas.Update()
UpPS.Update()
UpCliente.Update()
UPObservaciones.Update()
@@ -21164,7 +21259,7 @@ Partial Class Ventas
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then
OcurrioError = True
End If
@@ -21616,7 +21711,7 @@ Partial Class Ventas
LimpiaProntoPago()
'NO PERMITE EDITAR FECHA DEL PAGO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(260) Then
TxtFechaPago.Enabled = False
imgCalendario.Visible = False
End If
@@ -22468,11 +22563,6 @@ Partial Class Ventas
#Region " DEVOLUCION ALMACEN "
Private Sub InicializaDevolucionAlmacen()
If CveVenta.Contiene(2035312, 2035310, 2039679) Then
LBAplicaDevolucion.Visible = True
End If
If Not GvInv.Rows.Count > 0 Then
Exit Sub
End If
@@ -22570,9 +22660,15 @@ Partial Class Ventas
If ChkDireccionEnvio.Checked Then
DdlDireccionEnvio.Visible = True
LnkOtraDireccion.Visible = True
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
Else
DdlDireccionEnvio.Visible = False
LnkOtraDireccion.Visible = False
If SucursalDestinoCP IsNot Nothing Then
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
TxtDestinoCP.Text = ""
End If
End If
End Sub
Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click
@@ -22611,6 +22707,7 @@ Partial Class Ventas
TxtEnvioTel.Text = ""
CargaDireccionesEnvio()
DdlDireccionEnvio.SelectedValueExist(CveDireccionEnvio)
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
End If
ObjClientes.Dispose()
@@ -23838,6 +23935,10 @@ Partial Class Ventas
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjFacturaCancelacion.TipoDocto = "Rem" Then
ChkDevAlm.Checked = True
End If
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
End If
@@ -33748,8 +33849,10 @@ Partial Class Ventas
DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If
Dim Motivo As String = TxtMotivoAutorizacion.Text
Dim ObjPS As New ClsVentas
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos) Then
If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then
RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -33780,10 +33883,12 @@ Partial Class Ventas
Case "Ing"
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
DivMotivoAutorizacion.Visible = True
End If
Case "Egs"
'QUITAR LA DE VENCIMIENTO
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
DivMotivoAutorizacion.Visible = True
End Select
UpModalSolicitud.Update()
End Sub
@@ -33840,19 +33945,398 @@ Partial Class Ventas
End Sub
Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs)
#Region "C A R T A - P O R T E"
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
Public Sub CargaDireccionCP()
LblDireccion.Text = "Dirección"
LblColonia.Text = "Colonia"
LblCiudad.Text = "Ciudad"
LblEstado.Text = "Estado"
LblCP.Text = "00000"
End Sub
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
Public Sub CargarCamiones()
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
TxtFechaEntregaCP.Text = Now.ToString("dd/MM/yyyy")
TxtFechaLlegadaCP.Text = Now.ToString("dd/MM/yyyy")
DdlConfigAuto.Items.Clear()
DdlUnidadCamion.Items.Clear()
DdlChofer.Items.Clear()
DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa)
DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then
DdlUnidadCamion.DataSource = ObjInv.DtResultados
End If
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
DdlRemolque1.DataSource = ObjInv.DtResultados
End If
End Using
DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlRemolque1.DataBind()
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
DdlConfigAuto.DataSource = ObjGrales.DtResultados
End If
End Using
DdlConfigAuto.DataBind()
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlUnidadCamionActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs)
ChkEmitirCartaPorte.Checked = True
DvRemolque1.Visible = False
DvRemolque2.Visible = False
DdlRemolque1.SelectedValueExist(-1)
DdlRemolque2.SelectedValueExist(-1)
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then
DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte"))
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
End If
End Using
End If
UpAgregarCliente.Update()
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlConfigAuto_SelectedIndexChanged(sender As Object, e As EventArgs)
ValidaConfiguracionVeiculo()
End Sub
Public Sub CargaVentaCortePorte(CveVenta As Integer)
TxtFechaEntregaCP.Enabled = False
TxtFechaLlegadaCP.Enabled = False
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Man", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
Me.CveTimbreCartaPorteVenta = RowCP("CveTimbre").ToString().ToEntero()
If CveTimbreCartaPorteVenta > 0 Then
ChkEmitirCartaPorte.Checked = True
ChkEmitirCartaPorte.Enabled = False
End If
TxtFechaEntregaCP.Text = RowCP("FechaEntrega").ToString()
TxtFechaLlegadaCP.Text = RowCP("FechaLlegada").ToString()
TxtDistancia.Text = RowCP("Distancia").ToString()
DdlChofer.SelectedValueExist(RowCP("CveChofer").ToString())
DdlUnidadCamion.SelectedValueExist(RowCP("CveCamion").ToString())
End If
End Using
DdlChofer.Enabled = False
DdlUnidadCamion.Enabled = False
End Sub
Private Sub ValidaConfiguracionVeiculo()
DvRemolque1.Visible = False
DvRemolque2.Visible = False
DdlRemolque1.SelectedValueExist(-1)
DdlRemolque2.SelectedValueExist(-1)
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
If Remolque = "1" Then
RequiereRemolque = True
MostrarRemolques = True
End If
If Remolque = "0, 1" Then
RequiereRemolque = False
MostrarRemolques = True
End If
If Remolque = "0" Then
RequiereRemolque = False
MostrarRemolques = False
End If
End If
End Using
Else
RequiereRemolque = False
MostrarRemolques = False
End If
If RequiereRemolque Or MostrarRemolques Then
DvRemolque1.Visible = True
End If
If Not RequiereRemolque Then
DvConfiguracionVeiculo.Visible = False
Else
DvConfiguracionVeiculo.Visible = True
End If
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlRemolque1_SelectedIndexChanged(sender As Object, e As EventArgs)
DdlRemolque2.Items.Clear()
If DdlRemolque1.SelectedValue.ToEntero > 0 Then
DvRemolque2.Visible = True
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
End If
End Using
DdlRemolque2.DataBind()
Else
DvRemolque2.Visible = False
End If
DdlRemolque2.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
UpEmitirTransitorio.Update()
End Sub
Private Function GuardarCartaPorte(ByRef ObjFactura As Modelos.Factura, ByRef ObjGral As ClsGenerales, ByRef ObjClientes As ClsClientes) As Integer
Dim ErrorProceso As Boolean = False
Dim CveTimbre As Integer = -1
Try
Dim CveDireccionOrigen As Integer = -1
Dim CveDireccionDestino As Integer = -1
If SucursalOrigenCP IsNot Nothing Then
CveDireccionOrigen = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If SucursalDestinoCP IsNot Nothing Then
CveDireccionDestino = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then
ErrorProceso = True
Return -1
End If
Dim Fechallegada As DateTime = TxtFechaLlegadaCP.Text.ToDateTime()
Dim FechaEntrega As DateTime = TxtFechaEntregaCP.Text.ToDateTime()
Dim Distancia As Integer = TxtDistancia.Text.ToEntero()
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(DdlSubProyectoDatos.SelectedValue.ToEntero, CveDireccionOrigen, CveDireccionDestino, -1, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, FechaEntrega, Fechallegada, "T", "-1", "-1", Fechallegada, 1, 1, Distancia,
CveConfigAutoTransporte:=DdlConfigAuto.SelectedValue.ToEntero, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero)
If CveEntregaAlmacen > 0 Then
For Each RowPS As DataRow In ObjFactura.DtDetalle.FiltraParametros("CveTipoPS = 2").Rows
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToEntero, RowPS("CveUM").ToString().ToEntero, UsuarioActual.CveUsuario) Then
ErrorProceso = True
Exit For
End If
Next
CveTimbre = ObjGral.AddGralTimbre("Man", DdlSubProyectoDatos.SelectedValue.ToEntero, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=True, CveVenta:=ObjFactura.CveVenta)
If Not CveTimbre > 0 Then
ErrorProceso = True
End If
Else
ErrorProceso = True
End If
Catch ex As Exception
ErrorProceso = True
OnError("Ocurrió un error al guardar los datos de la carta porte", ex)
End Try
If Not ErrorProceso Then
Return CveTimbre
Else
Return -1
End If
End Function
Property RequiereRemolque As Boolean
Get
If ViewState("RequiereRemolque") Is Nothing Then
ViewState("RequiereRemolque") = False
End If
Return Boolean.Parse(ViewState("RequiereRemolque").ToString)
End Get
Set(value As Boolean)
ViewState("RequiereRemolque") = value
End Set
End Property
Property MostrarRemolques As Boolean
Get
If ViewState("MostrarRemolques") Is Nothing Then
ViewState("MostrarRemolques") = False
End If
Return Boolean.Parse(ViewState("MostrarRemolques").ToString)
End Get
Set(value As Boolean)
ViewState("MostrarRemolques") = value
End Set
End Property
Property SucursalOrigenCP As Modelos.SucursalModel
Get
If ViewState("SucursalOrigenCP") Is Nothing Then
Return Nothing
End If
Return DirectCast(ViewState("SucursalOrigenCP"), Modelos.SucursalModel)
End Get
Set(value As Modelos.SucursalModel)
ViewState("SucursalOrigenCP") = value
End Set
End Property
Property SucursalDestinoCP As Modelos.SucursalModel
Get
If ViewState("SucursalDestinoCP") Is Nothing Then
Return Nothing
End If
Return DirectCast(ViewState("SucursalDestinoCP"), Modelos.SucursalModel)
End Get
Set(value As Modelos.SucursalModel)
ViewState("SucursalDestinoCP") = value
End Set
End Property
Private Sub CargaDireccionSucursalOrigen(Row As DataRow)
If SucursalOrigenCP Is Nothing Then
SucursalOrigenCP = New Modelos.SucursalModel
Else
SucursalOrigenCP = Nothing
SucursalOrigenCP = New Modelos.SucursalModel
End If
Dim SBDomicilioSucursal As New StringBuilder()
Try
If Row IsNot Nothing Then
SucursalOrigenCP.Direccion = Row("Calle").ToString()
SucursalOrigenCP.NoExt = Row("NoExt").ToString()
SucursalOrigenCP.NoInt = Row("NoInt").ToString()
SucursalOrigenCP.Colonia = Row("Colonia").ToString()
SucursalOrigenCP.CP = Row("CP").ToString()
SucursalOrigenCP.Municipio = Row("Municipio").ToString()
'SucursalOrigenCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalOrigenCP.Estado = Row("Estado").ToString()
'SucursalOrigenCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalOrigenCP.Pais = Row("Pais").ToString()
SBDomicilioSucursal.AppendFormat("{0}", Row("Calle").ToString())
If Row("NoInt").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", No.Int: {0}", Row("NoInt").ToString())
End If
If Row("Colonia").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", Col: {0}", Row("Colonia").ToString())
End If
If Row("CP").ToString().ToEntero > 0 Then
SBDomicilioSucursal.AppendFormat(", CP: {0}", Row("CP").ToString())
End If
If Row("NoExt").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", Row("NoExt").ToString())
End If
Dim CiudadSucursal As String = String.Format("{0},{1}", Row("Municipio").ToString(), Row("Estado").ToString())
If CiudadSucursal.Length > 0 Then
SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal)
End If
If Row("Pais").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", {0}", Row("Pais").ToString())
End If
If Not String.IsNullOrEmpty(Row("Telefono").ToString()) Then
SucursalOrigenCP.TelefonoSucursal = Row("Telefono").ToString()
End If
End If
Catch ex As Exception
SBDomicilioSucursal.Clear()
GuardaLog(ex.ToString())
End Try
TxtOrigenCP.Text = SBDomicilioSucursal.ToString
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlDireccionEnvio_SelectedIndexChanged(sender As Object, e As EventArgs)
If SucursalDestinoCP Is Nothing Then
SucursalDestinoCP = New Modelos.SucursalModel
Else
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
End If
If TmpDTEnvioDireccion IsNot Nothing AndAlso TmpDTEnvioDireccion.FiltraParametros(String.Format("CveDireccionEnvio = {0}", DdlDireccionEnvio.SelectedValue.ToEntero())).Rows.Count > 0 Then
Dim Row As DataRow = TmpDTEnvioDireccion.FiltroPrimero(String.Format("CveDireccionEnvio = {0}", DdlDireccionEnvio.SelectedValue.ToEntero()))
If Row IsNot Nothing Then
SucursalDestinoCP.Direccion = Row("EnvioDireccion").ToString()
SucursalDestinoCP.Colonia = Row("EnvioColonia").ToString()
SucursalDestinoCP.Municipio = Row("EnvioCiudad").ToString()
'SucursalDestinoCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalDestinoCP.Estado = Row("EnvioEstado").ToString()
'SucursalDestinoCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalDestinoCP.Pais = Row("Pais").ToString()
SucursalDestinoCP.CP = Row("EnvioCP").ToString()
TxtDestinoCP.Text = String.Format("{0} col. {1},CP:{2}, {3},{4},{5}", SucursalDestinoCP.Direccion, SucursalDestinoCP.Colonia, SucursalDestinoCP.CP, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.Pais)
Else
TxtDestinoCP.Text = ""
End If
Else
TxtDestinoCP.Text = ""
End If
UpEmitirTransitorio.Update()
End Sub
#End Region
End Class

View File

@@ -1,4 +1,4 @@
<%@ WebService Language="VB" Class="WSGPSApp" %>
<%@ WebService Language="VB" Class="WSGPSApp" %>
Option Strict On
Imports System.Web
@@ -13,6 +13,7 @@ Imports System.Web.Script.Services
Imports System.Web.Script.Serialization
Imports ADGPSModels
Imports System.IO
Imports System.Net.Http
Public Class AuthHeader
@@ -30,8 +31,8 @@ Public Class WSGPSApp
Inherits System.Web.Services.WebService
Private Const LongValue As Long = &H100000000
Public Property Credentials As AuthHeader
Public Property Credentials As AuthHeader
#Region "G L O B A L S"
Property GlobalDTDispositivos(CveCliente As Integer) As DataTable
Get
@@ -89,7 +90,7 @@ Public Class WSGPSApp
Set(value As DataTable)
Application("GlobalDTDispositivosUsuarios") = value
End Set
End Property
End Property
#End Region
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
@@ -162,11 +163,11 @@ Public Class WSGPSApp
End If
End If
End If
End If
'MARCA PARA EL RASTREO SOLO INICIO
If UsuarioRetorno.CveUsuario = 3612 Then
UsuarioRetorno.RastreoSoloInicio = True
End If
'MARCA PARA EL RASTREO SOLO INICIO
If UsuarioRetorno.CveUsuario = 3612 Then
UsuarioRetorno.RastreoSoloInicio = True
End If
UsuarioRetorno.Clientes = Clientes
@@ -239,11 +240,11 @@ Public Class WSGPSApp
End If
End If
End If
End If
'MARCA PARA EL RASTREO SOLO INICIO
If UsuarioRetorno.CveUsuario = 3612 Then
UsuarioRetorno.RastreoSoloInicio = True
End If
'MARCA PARA EL RASTREO SOLO INICIO
If UsuarioRetorno.CveUsuario = 3612 Then
UsuarioRetorno.RastreoSoloInicio = True
End If
UsuarioRetorno.Clientes = Clientes
@@ -660,7 +661,6 @@ Public Class WSGPSApp
<WebMethod>
Public Function GetHistoricoPosicionesEquipo(params As String) As String
Dim Retorno As String = ""
Dim ObjGPS As New ClsGPS()
Try
Dim Estructura = New With
{
@@ -671,27 +671,140 @@ Public Class WSGPSApp
}
Dim jsonParams As String = Decripta(params)
Dim parametros = JsonConvert.DeserializeAnonymousType(jsonParams, Estructura)
Dim FechaI As DateTime = StartOfDay(parametros.FechaI)
Dim FechaF As DateTime = EndOfDay(parametros.FechaF)
Dim coords As New List(Of MWSGeolocation2)
If ObjGPS.GetPosicionEquipo(parametros.CveDispositivo, parametros.FechaI, parametros.FechaF) Then
If ObjGPS.DtResultados.Rows.Count > 0 Then
For Each Row As DataRow In ObjGPS.DtResultados.Rows
Dim Coord As MWSGeolocation2 = SQLToGmaps(Row("Posicion").ToString, "POINT")
Coord.FechaTrama = Row("FechaTrama").ToString
coords.Add(Coord)
Next
Dim DtRetorno As DataTable = Nothing
Using ObjGPS As New ClsGPS()
If ObjGPS.GetPosicionEquipo(parametros.CveDispositivo, FechaI, FechaF) Then
DtRetorno = ObjGPS.DtResultados.Copy()
End If
End Using
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
Dim Direcciones As JArray = ConsultarDirecciones(DtRetorno)
For Each Dir As JObject In Direcciones
DtRetorno.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
Next
For Each Row As DataRow In DtRetorno.Rows
Dim Coord As MWSGeolocation2 = SQLToGmaps(Row("Posicion").ToString, "POINT")
Coord.Velocidad = Row("Velocidad").ToString().ToDouble().RoundSQL(0)
Coord.FechaTrama = Row("FechaTrama").ToString
Coord.Direccion = Row("Direccion").ToString
Coord.Combustible = Row("Combustible").ToString().ToDouble().RoundSQL(2)
coords.Add(Coord)
Next
End If
If coords.Count > 0 Then
Retorno = JsonConvert.SerializeObject(coords)
End If
Catch ex As Exception
OnError("Ocurrio un error al obtener las posiciones historicas de un dispositivo.", ex)
Finally
ObjGPS.Dispose()
End Try
Return Retorno
End Function
<WebMethod>
Public Function GetHistoricoPosicionesEquipo2(params As String) As String
Dim Retorno As String = ""
Try
Dim Estructura = New With
{
Key .[CveDispositivo] = -1,
Key .[FechaI] = DateTime.Now,
Key .[FechaF] = DateTime.Now,
Key .[Ticks] = ""
}
Dim jsonParams As String = Decripta(params)
Dim parametros = JsonConvert.DeserializeAnonymousType(jsonParams, Estructura)
Dim FechaI As DateTime = parametros.FechaI
Dim FechaF As DateTime = parametros.FechaF
Dim coords As New List(Of MWSGeolocation2)
Dim DtRetorno As DataTable = Nothing
Using ObjGPS As New ClsGPS()
If ObjGPS.GetPosicionEquipo(parametros.CveDispositivo, FechaI, FechaF) Then
DtRetorno = ObjGPS.DtResultados.Copy()
End If
End Using
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
Dim Direcciones As JArray = ConsultarDirecciones(DtRetorno)
For Each Dir As JObject In Direcciones
DtRetorno.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
Next
For Each Row As DataRow In DtRetorno.Rows
Dim Coord As MWSGeolocation2 = SQLToGmaps(Row("Posicion").ToString, "POINT")
Coord.Velocidad = Row("Velocidad").ToString().ToDouble().RoundSQL(0)
Coord.FechaTrama = Row("FechaTrama").ToString
Coord.Direccion = Row("Direccion").ToString
Coord.Combustible = Row("Combustible").ToString().ToDouble().RoundSQL(2)
coords.Add(Coord)
Next
End If
If coords.Count > 0 Then
Retorno = JsonConvert.SerializeObject(coords)
End If
Catch ex As Exception
OnError("Ocurrio un error al obtener las posiciones historicas de un dispositivo.", ex)
End Try
Return Retorno
End Function
Public Function ConsultarDirecciones(Dt As DataTable) As JArray
Dim retorno As JArray = Nothing
Dim posicionesArray = New JArray(From Row As DataRow In Dt
Select New JObject(
New JProperty("indice", Dt.Rows().IndexOf(Row)),
New JProperty("cveTrama", -1),
New JProperty("lat", Row("lat").ToString()),
New JProperty("lon", Row("lon").ToString())
))
Dim Base64array = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(posicionesArray.ToString()))
Using wc As New HttpClient()
Try
wc.Timeout = New TimeSpan(0, 0, 15)
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
Public Function EndOfDay(ByVal fecha As DateTime) As DateTime
Return New DateTime(fecha.Year, fecha.Month, fecha.Day, 23, 59, 59, 999)
End Function
Public Function StartOfDay(ByVal fecha As DateTime) As DateTime
Return New DateTime(fecha.Year, fecha.Month, fecha.Day, 0, 0, 0, 0)
End Function
<WebMethod>
Public Function GetEquipoMasCercano(params As String) As String
Dim json = "[]"
@@ -1035,8 +1148,8 @@ Public Class WSGPSApp
Return Retorno
End Function
End Function
#Region "F U N C I O N E S"
Private Function CargarEventos(CveCliente As Integer, FechaI As DateTime, FechaF As DateTime) As MWSDashboard2
Dim ObjGPS As New ClsGPS
@@ -1145,7 +1258,7 @@ Public Class WSGPSApp
OnError("Acceso no autorizado", New SoapException("Unauthorized", SoapException.ClientFaultCode))
Return False
End If
End Function
End Function
#End Region
End Class
Namespace ADGPSModels
@@ -1193,6 +1306,8 @@ Namespace ADGPSModels
Public Property Longitud As Double
Public Property FechaTrama As String
Public Property Velocidad As Double
Public Property Combustible As Double
Public Property Direccion As String
End Class
<Serializable>
Public Class MPosicion2

View File

@@ -464,6 +464,8 @@