This commit is contained in:
2022-04-08 13:44:39 -07:00
43 changed files with 3096 additions and 1412 deletions

View File

@@ -1690,7 +1690,7 @@ Public Class ClsClientes
.Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33 .Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33
.Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago .Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@CvePrecioLista", SqlDbType.VarChar).Value = RegimenSociedad .Add("@RegimenSociedad", SqlDbType.VarChar).Value = RegimenSociedad
.Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona .Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona
End With End With

View File

@@ -1074,7 +1074,7 @@ Public Class ClsContPAQi
StrSQL.AppendLine(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ") StrSQL.AppendLine(" INNER JOIN Polizas p ON mp.IdPoliza = p.Id ")
StrSQL.AppendLine(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ") StrSQL.AppendLine(" INNER JOIN Cuentas c ON c.Id = mp.IdCuenta ")
StrSQL.AppendLine(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ") StrSQL.AppendLine(" INNER JOIN TiposPolizas t ON mp.TipoPol = t.Codigo ")
StrSQL.AppendLine(" LEFT JOIN SERVIDOR.Ventas.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ") StrSQL.AppendLine(" LEFT JOIN SIG_Resp_2022_04_01.dbo.Usuarios U ON U.CveUsuario = P.IdUsuario ")
StrSQL.AppendLine(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ") StrSQL.AppendLine(" LEFT JOIN SegmentosNegocio s ON mp.IdSegNeg = s.id ")
StrSQL.AppendLine(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ") StrSQL.AppendLine(" WHERE (@IdPoliza = -1 OR mp.IdPoliza = @IdPoliza) ")
StrSQL.AppendLine(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ") StrSQL.AppendLine(" AND (@Eje = -1 OR mp.Ejercicio = @Eje) ")

View File

@@ -4062,6 +4062,29 @@ Public Class ClsContabilidad
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Sis_InconsistenciasGet") DataAdapter("PA_Sis_InconsistenciasGet")
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener inconsistencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetPolizasDescuadre(Optional Ejercicio As Integer = -1, Optional Periodo As Integer = -1, Optional CveEmpresa As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_PolizasConDescuadreGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
.Add("@Periodo", SqlDbType.Int).Value = Periodo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

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, 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 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 Dim Retorno As Integer = -1
DataAdapter("PA_Gral_TimbreAdd") DataAdapter("PA_Gral_TimbreAdd")
@@ -3701,6 +3701,7 @@ Public Class ClsGenerales
.Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP .Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
.Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -3722,7 +3723,7 @@ Public Class ClsGenerales
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreGet") DataAdapter("PA_Gral_TimbreGet")
@@ -3734,7 +3735,7 @@ Public Class ClsGenerales
.Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With End With
Try Try

View File

@@ -3547,6 +3547,24 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function 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 Public Function GetMovimientosDevoluciones(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleAlmacenDevolucion") 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 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 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 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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUpdate") DataAdapter("PA_Vta_VentasUpdate")
@@ -562,6 +562,7 @@ Public Class ClsVentas
.Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje .Add("@Kilometraje", SqlDbType.Float).Value = Kilometraje
.Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi .Add("@CveUsoCFDi", SqlDbType.SmallInt).Value = CveUsoCFDi
.Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio .Add("@ServicioDomicilio", SqlDbType.Bit).Value = ServicioDomicilio
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
End With End With
Try Try
@@ -1014,13 +1015,14 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function 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 Dim Retorno As Integer = 0
DataAdapter("PA_Vta_ClientesLimitesVentaGet") DataAdapter("PA_Vta_ClientesLimitesVentaGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@TipoVerificacion", SqlDbType.Int).Value = TipoVerificacion
.Add("@Opcion", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@Opcion", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@OpcionMsg", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output .Add("@OpcionMsg", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output
End With End With
@@ -5334,7 +5336,7 @@ Public Class ClsVentas
#End Region #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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesAdd") DataAdapter("PA_Vta_AutorizacionLimitesAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -5347,6 +5349,7 @@ Public Class ClsVentas
.Add("@TipoAutorizacion", SqlDbType.Int).Value = TipoAutorizacion .Add("@TipoAutorizacion", SqlDbType.Int).Value = TipoAutorizacion
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento .Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
.Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos .Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos
.Add("@Motivo", SqlDbType.VarChar).Value = Motivo
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -400,8 +400,8 @@ Namespace Modelos
Me.VentaDesglosaIEPS = True Me.VentaDesglosaIEPS = True
End If End If
SetTotales(ObjVentas.DtResultados, ObjVentas) SetTotales(ObjVentas.DtResultados, ObjVentas)
End If
End If End If
End If
If ObjVentas.GetVentaDetalle(CveVenta) Then If ObjVentas.GetVentaDetalle(CveVenta) Then
Me.DtDetalle = ObjVentas.DtResultados.Copy() Me.DtDetalle = ObjVentas.DtResultados.Copy()
End If End If
@@ -2208,12 +2208,11 @@ Namespace Modelos
If DtMovimientosEntrada IsNot Nothing Then If DtMovimientosEntrada IsNot Nothing Then
For Each Dr As DataRow In DtMovimientosEntrada.Rows 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 CveMovimiento = -1
Exit For Exit For
End If End If
Next Next
DtMovimientosEntrada.Dispose() DtMovimientosEntrada.Dispose()
DtMovimientosEntrada = Nothing DtMovimientosEntrada = Nothing
End If End If
@@ -5216,15 +5215,18 @@ Namespace Modelos
Dim CveMovimientoDevolucion As Integer = 0 Dim CveMovimientoDevolucion As Integer = 0
Dim Folio As Integer = 0 Dim Folio As Integer = 0
Dim CveMovimientoSalida As Integer = -1
Select Case RowMovimiento("CveConcepto").ToString().ToEntero() Select Case RowMovimiento("CveConcepto").ToString().ToEntero()
Case 3 Case 3
CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
CveMovimientoSalida = RowMovimiento("CveMovimiento").ToString().ToEntero()
Case 40 Case 40
CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 18 Case 18
CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA CveConceptoMovimiento = 3 'SALIDA DE ALMACEN
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero() CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
''SI TIENE REMISIONES RELACIONADAS ''SI TIENE REMISIONES RELACIONADAS
'If DtRemisionesFacturadas.Rows.Count > 0 Then 'If DtRemisionesFacturadas.Rows.Count > 0 Then
@@ -5249,7 +5251,7 @@ Namespace Modelos
'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION 'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION
If ObjFactura.SaldoAlmacen <> 0 Then If ObjFactura.SaldoAlmacen <> 0 Then
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN) 'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1") CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="Mod/CV1")
Folio = ObjInventario.Folio Folio = ObjInventario.Folio
If CveMovimientoDevolucion > 0 Then If CveMovimientoDevolucion > 0 Then
@@ -5389,9 +5391,9 @@ Namespace Modelos
If DtVirtuales IsNot Nothing Then If DtVirtuales IsNot Nothing Then
For Each RowVirtual As DataRow In DtVirtuales.Rows For Each RowVirtual As DataRow In DtVirtuales.Rows
'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL '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 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 End If
Next Next
End If End If
@@ -5419,20 +5421,85 @@ Namespace Modelos
'DEBE REGRESAR LA EXISTENCIA DE (ENTREGA POR ADELANTADO) AL ALMACEN ORGINAL (GENERAL,SIN COSTO) '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 If Not ErrorCancelar AndAlso DtDevoluciones IsNot Nothing AndAlso DtDevoluciones.Rows.Count > 0 Then
For Each CveRemision As Integer In ListaRemisionesCancelar 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 Dim SaldoAlmacenExA As Decimal = 0
CveAlmacen = RowDevolucion("CveAlmacen").ToString().ToEntero() Dim SaldoAlmacenUsados As Decimal = 0
CveAlmacenDevolucion = RowDevolucion("CveAlmacenDestino").ToString().ToEntero() Dim DtSaldosAlmacenRemision As DataTable = Nothing
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
If Not CancelarMovimientosRemision(CveRemision, CveAlmacen, CveAlmacenDevolucion, DtDevRemision.FiltraParametros($"CveMovimiento={RowDevolucion("CveMovimiento")}"), ObjVentas, ObjInventario) Then If Not ErrorCancelar Then
ErrorCancelar = True If ObjInventario.GetSaldoVentaDetalleAlmacen(ObjRemision.CveVenta, UsuarioActual.CveEmpresa) Then
MensajeError = "Ocurrió un error al cancelar los movimientos de la remisión." DtSaldosAlmacenRemision = ObjInventario.DtResultados.Copy()
Exit For Else
ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los saldos de devolución. Por favor vuelva a intentar."
End If
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 If ErrorCancelar Then
Exit For Exit For
@@ -5444,22 +5511,48 @@ Namespace Modelos
End If End If
'CANCELACION DE MOVIMIENTOS DE REMISION '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 CveAlmacenGeneral As Integer = 0
Dim CveAlmacenExA As Integer = 0
Dim SaldoAlmacenExA As Decimal = 0
Dim SaldoAlmacenUsados As Decimal = 0
Dim DtMovRemision As DataTable = Nothing Dim DtMovRemision As DataTable = Nothing
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO) 'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then If Not ErrorCancelar Then
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10") DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero() 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 Else
ErrorCancelar = True ErrorCancelar = True
MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar."
End If End If
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) '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"}) Dim DtDevMovs = DtMovRemision.FiltraParametros("", DistinctColumns:={"CveMovimiento", "CveAlmacen"})
@@ -5475,6 +5568,14 @@ Namespace Modelos
End If 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 End If
'VERIFICAR MOVIMIENTOS DE APARTADOS 'VERIFICAR MOVIMIENTOS DE APARTADOS
@@ -5739,41 +5840,134 @@ Namespace Modelos
CveAlmacenVirtual = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero() CveAlmacenVirtual = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen").ToEntero()
End If End If
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimiento, UsuarioActual.CveEmpresa, CveMovimientoRelacionado:=CveMovimientoRelacionado) Then Dim SaldoVirtual As Decimal = 0
DtPSVirtual = ObjInventario.DtResultados
End If
Dim CveConceptoMovimientoVirtual As Integer = 36 'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
Dim CveMovimientoRelacionadoVirtual As Integer = CveMovimiento If Not ErrorCancelar Then
If ObjInventario.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then If CveAlmacenVirtual > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, SaldoVirtual = ObjInventario.DtResultados.SUMD("SaldoAlmacen", $"CveAlmacen = {CveAlmacenVirtual}")
Observaciones:="", Guia:="", CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual, Modulo:="Modelos/CancelarVirtual") End If
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 Else
ErrorCancelar = True ErrorCancelar = True
End If End If
Else End If
If ValidaVirtual Then
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 ErrorCancelar = True
End If End If
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 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 End If
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al realizar la devolución al almacen virtual.", ex) OnError("Ocurrió un error al realizar la devolución al almacen virtual.", ex)
@@ -9921,7 +10115,9 @@ Namespace Modelos
Public Property Colonia As String Public Property Colonia As String
Public Property Localidad As String Public Property Localidad As String
Public Property Municipio As String Public Property Municipio As String
Public Property CveEstado As Integer
Public Property Estado As String Public Property Estado As String
Public Property CvePais As Integer
Public Property Pais As String Public Property Pais As String
Public Property CP As String Public Property CP As String
Public Property IVA As Decimal Public Property IVA As Decimal

View File

@@ -208,7 +208,7 @@ Public Class Timbres
Dim Ubica As New CFDICartaPorteUbicacion Dim Ubica As New CFDICartaPorteUbicacion
Ubica.TipoEstacion = "" Ubica.TipoEstacion = ""
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString, 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, .NombreRemitenteDestinatario = drT("RemitenteNombre").ToString,
.Domicilio = DomOrigen} .Domicilio = DomOrigen}
CartaPorte.Ubicaciones.Add(Ubica) CartaPorte.Ubicaciones.Add(Ubica)
@@ -355,22 +355,268 @@ Public Class Timbres
End If End If
Return Timbre Return Timbre
End Function End Function
Public Function Timbrar() As Boolean
Dim Respuesta As Boolean = False Public Class MMensajeCartaPorte
Public Property TieneError As Boolean
Dim ObjTimbrado As New Timbrado Public Property Mensaje As String
Public Property CveMovimiento As Integer
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then Public Property FechaSalida As DateTime
Respuesta = True Public Property CartaPorte As CFDICartaPorte
Else End Class
Respuesta = False
_MsgError.AppendLine(ObjTimbrado.MensajeErrorCFDI) Public Shared Function PreParaCartaPorteFactura(CveTimbre As Integer, Obj As Modelos.Factura, UsuarioActual As Usuario) As MMensajeCartaPorte
End If Dim Retorno As New MMensajeCartaPorte
Return Respuesta Try
Dim CartaPorte As New CFDICartaPorte
End Function
Dim _MsgError As New StringBuilder
Dim TieneError As Boolean = False
End Class
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() Public Sub CargaDatos()
Dim ObjBancos As New ClsBancos Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancosCuentas(-1) Then If ObjBancos.GetBancosCuentas(-1) Then
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) Dim dt = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa, "", {"CveCuenta", "TipoCuenta", "Banco", "NumCuenta", "CLABE", "Moneda", "FInicial", "Estatus", "Fecha", "Usuario"})
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTBancosCuentas") = dt
DtBan = dt
Else Else
Me.GvDatos.DataSource = Nothing Me.GvDatos.DataSource = Nothing
End If End If
@@ -66,14 +67,14 @@ Partial Class Bancos_CuentasBancarias
If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1 GvDatos.EditIndex = -1
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
'If ObjBancos.GetBancosCuentasUsuarios(-1) Then 'If ObjBancos.GetBancosCuentasUsuarios(-1) Then
' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados ' GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjBancos.DtResultados
'End If 'End If
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion) Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If End If

File diff suppressed because it is too large Load Diff

View File

@@ -20229,6 +20229,8 @@ Partial Class Compras_Compras
If FleteImportacionOpcion > 0 Then RblFleteImportacionOpcion.SelectedValue = FleteImportacionOpcion.ToString If FleteImportacionOpcion > 0 Then RblFleteImportacionOpcion.SelectedValue = FleteImportacionOpcion.ToString
RegistraScript("$('#ModalFletesImportaciones').modal()") RegistraScript("$('#ModalFletesImportaciones').modal()")
UpModalFletesImportaciones.Update() UpModalFletesImportaciones.Update()
End Sub End Sub
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs)
CambiaTipo() CambiaTipo()

View File

@@ -4969,6 +4969,7 @@ Partial Class PopUpVerFactura
Dim FolioFiscal = drv("FolioFiscal").ToString() Dim FolioFiscal = drv("FolioFiscal").ToString()
Dim RFCReceptor = drv("RFCReceptor").ToString() Dim RFCReceptor = drv("RFCReceptor").ToString()
Dim SelloCancelacion = drv("SelloCancelacion").ToString() Dim SelloCancelacion = drv("SelloCancelacion").ToString()
Dim SelloSolicitudCancelacion = drv("SelloSolicitudCancelacion").ToString()
Dim EstadoCancelacion = drv("EstadoCancelacion").ToString() Dim EstadoCancelacion = drv("EstadoCancelacion").ToString()
Dim FechaCancelacion = drv("FechaCancelacion").ToString.ToDateTime Dim FechaCancelacion = drv("FechaCancelacion").ToString.ToDateTime
@@ -4994,6 +4995,12 @@ Partial Class PopUpVerFactura
If CveEstatusFactura = 20 Then If CveEstatusFactura = 20 Then
Titulo = "Acuse de solicitud de cancelación de CFDI" Titulo = "Acuse de solicitud de cancelación de CFDI"
EstadoCFDI = "Vigente" 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 If String.IsNullOrEmpty(EstadoCancelacion) Then
EstadoCancelacion = "Cancelable con aceptación" EstadoCancelacion = "Cancelable con aceptación"
End If End If
@@ -5751,6 +5758,7 @@ Partial Class PopUpVerFactura
Dim MarcaAuto As String = RowAjuste("MarcaAuto").ToString Dim MarcaAuto As String = RowAjuste("MarcaAuto").ToString
Dim CodigoTD As String = RowAjuste("CodigoTD").ToString Dim CodigoTD As String = RowAjuste("CodigoTD").ToString
Dim PSAjuste As String = ""
Dim MarcaPS As String = "" Dim MarcaPS As String = ""
Dim CveMarca As Integer = -1 Dim CveMarca As Integer = -1
@@ -5781,7 +5789,15 @@ Partial Class PopUpVerFactura
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePSAjuste, -1, UsuarioActual.CveEmpresa) Then 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 End If
ObjPS.Dispose() ObjPS.Dispose()
@@ -5879,6 +5895,7 @@ Partial Class PopUpVerFactura
Dim MesesUso As String = "0" Dim MesesUso As String = "0"
Dim PSAjuste As String = ""
Dim MarcaPS As String = "" Dim MarcaPS As String = ""
Dim CveMarca As Integer = -1 Dim CveMarca As Integer = -1
@@ -5909,7 +5926,15 @@ Partial Class PopUpVerFactura
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePSAjuste, -1, UsuarioActual.CveEmpresa) Then 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 End If
ObjPS.Dispose() ObjPS.Dispose()

View File

@@ -15,19 +15,44 @@
<div class="portlet solid grey-cascade portlet-filter"> <div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle"> <div class="portlet-title portlet-filterT smalltitle">
<div class="tools"> <div class="tools">
<%--<asp:Button ID="BtnConsultar" Text="Consultar" CssClass="btn btn-default" runat="server" />--%> <asp:Button ID="BtnConsultar" Text="Consultar" CssClass="btn btn-default" OnClick="BtnConsultar_Click" runat="server" Visible="false" />
</div> </div>
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<%--<div class="row">
<label class="col-md-1 " style="width: 80px;">Ejercicio:</label> <div class="row" runat="server" visible ="false" id="DvRowFiltrosContanSig1" >
<div class="col-md-2">
</div> <label class="col-md-1 truncate" style="width: 90px;">Ejercicio:</label>
</div>--%> <div class="col-md-2" style="width: 125px;">
<asp:DropDownList ID="DdlEjercicio" runat="server" CssClass="select2me" DataTextField="Ejercicio" DataValueField="Ejercicio" Width="100px">
</asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="width: 90px;">Periodo:</label>
<div class="col-md-2" style="width: 130px;">
<asp:DropDownList ID="DdlPeriodo" runat="server" Width="100px" CssClass="select2me">
<asp:ListItem Text="Enero" Value="1"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="2"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="3"></asp:ListItem>
<asp:ListItem Text="Abril" Value="4"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="5"></asp:ListItem>
<asp:ListItem Text="Junio" Value="6"></asp:ListItem>
<asp:ListItem Text="Julio" Value="7"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="8"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="9"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" CssClass="table table-advance table-striped table-hover Widthall" runat="server" AutoGenerateColumns="False" GridLines="None" > <asp:GridView ID="GvDatos" CssClass="table table-advance table-striped table-hover Widthall" runat="server" AutoGenerateColumns="False" GridLines="None" >
<Columns> <Columns>
<asp:TemplateField HeaderText="Ejercicio"> <asp:TemplateField HeaderText="Ejercicio">
@@ -57,6 +82,42 @@
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<%-- FechaMovto Mensaje CveIE CveCompra CveVenta CvePrePoliza FolioPoliza--%>
<asp:GridView ID="GvDatosSIG" CssClass="table table-advance table-striped table-hover Widthall" runat="server" AutoGenerateColumns="False" GridLines="None" Visible="false" >
<Columns>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Literal ID="LtEjercicio" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Folio">
<ItemTemplate>
<asp:HyperLink CssClass="Texto" runat="server"
Text='<%# If(Not IsDBNull(Eval("FolioPoliza")), Eval("FolioPoliza"), "ND") %>'
NavigateUrl='<%# String.Concat("~/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza=", Eval("CvePrePoliza")) %>'
target="_blank" >
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Literal ID="LtlMensaje" runat="server" Text='<%# Eval("Concepto")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Content> </asp:Content>

View File

@@ -4,12 +4,21 @@ Option Strict On
Imports System.Data Imports System.Data
Imports System.Linq Imports System.Linq
Imports Extensiones Imports Extensiones
Partial Class Contabilidad_RepPolizasCuadre Partial Class Contabilidad_RepPolizasCuadre
Inherits ClsPaginas Inherits ClsPaginas
Private Sub Contabilidad_RepPolizasCuadre_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub Contabilidad_RepPolizasCuadre_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then If Not IsPostBack Then
CargaGrid()
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
CargaEjercicios()
MuestraControlesContabilidadSIG()
CargaDatosContabilidaSIG()
Else
CargaGrid()
End If
End If End If
End Sub End Sub
@@ -25,6 +34,7 @@ Partial Class Contabilidad_RepPolizasCuadre
UpDatos.Update() UpDatos.Update()
End Sub End Sub
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
Dim Liga1 As String = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", e.Row.DBCampo("IdPoliza")) Dim Liga1 As String = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", e.Row.DBCampo("IdPoliza"))
@@ -32,4 +42,72 @@ Partial Class Contabilidad_RepPolizasCuadre
End If End If
End Sub End Sub
#Region " C O N T A B L I D A D S I G"
Private Sub MuestraControlesContabilidadSIG()
GvDatos.Visible = False
GvDatosSIG.Visible = True
BtnConsultar.Visible = True
DvRowFiltrosContanSig1.Visible = True
End Sub
Private Sub CargaDatosContabilidaSIG()
Dim ObjP As New ClsContabilidad
If ObjP.GetPolizasDescuadre(DdlEjercicio.SelectedValue.ToEntero, DdlPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If ObjP.DtResultados.Rows.Count > 0 Then
GvDatosSIG.DataSource = ObjP.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
Else
GvDatosSIG.DataSource = Nothing
End If
Else
GvDatosSIG.DataSource = Nothing
End If
ObjP.Dispose()
GvDatosSIG.DataBind()
UpDatos.Update()
End Sub
Private Sub CargaEjercicios()
Dim Clsconta As New ClsContabilidad
If Clsconta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = Clsconta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
Clsconta.Dispose()
DdlEjercicio.DataBind()
DdlEjercicio.SelectedValue = Now.Year.ToString
DdlPeriodo.SelectedValue = Now.Month.ToString
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatosContabilidaSIG()
End Sub
#End Region
End Class End Class

View File

@@ -587,18 +587,30 @@ Partial Class AC2_SituacionFinanciera
Private Sub ImprimirReporte(Optional Formato As String = "PDF") Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue)
Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
'nombre del archivo a generar
Dim fileName As String = "EdoSituacionFinanciera" Dim fileName As String = "EdoSituacionFinanciera"
'ubicacion del rdlc
Dim reportpath As String = "Contabilidad2/Reportes/RepSituacionFinanciera.rdlc" Dim reportpath As String = "Contabilidad2/Reportes/RepSituacionFinanciera.rdlc"
'parametros a enviar al reporte
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
Dim ImgLogoInfo As New IO.FileInfo($"{UsuarioActual.Empresa.Ruta}\Logo.png")
If ImgLogoInfo.Exists Then
params.Add(New ReportParameter("pImg", $"file://{ImgLogoInfo.FullName}"))
Else
params.Add(New ReportParameter("pImg", ""))
End If
params.Add(New ReportParameter("pFirma1", If(ChkFirma.Checked, String.Format("{0}", vbCrLf), ""))) params.Add(New ReportParameter("pFirma1", If(ChkFirma.Checked, String.Format("{0}", vbCrLf), "")))
params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("{0}l", vbCrLf), ""))) params.Add(New ReportParameter("pFirma2", If(ChkFirma.Checked, String.Format("{0}l", vbCrLf), "")))
params.Add(New ReportParameter("pFechaFin", FechaF)) params.Add(New ReportParameter("pFechaFin", FechaF))
params.Add(New ReportParameter("periodo", String.Format("de {0} {1}", DdlPeriodo.SelectedItem.ToString, DdlEjercicio.SelectedItem.ToString))) params.Add(New ReportParameter("periodo", String.Format("de {0} {1}", DdlPeriodo.SelectedItem.ToString, DdlEjercicio.SelectedItem.ToString)))
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato) ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
End Sub End Sub

View File

@@ -3048,16 +3048,17 @@
<Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteActual.Value, 0),"DataSet1")</Value> <Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteActual.Value, 0),"DataSet1")</Value>
</Variable> </Variable>
<Variable Name="TotalPatrimonioHActual"> <Variable Name="TotalPatrimonioHActual">
<Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteActual.Value, 0),"DataSet1")</Value> <Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteActual.Value, 0),"DataSet1")</Value>
</Variable> </Variable>
<Variable Name="TotalPatrimonioCAnterior"> <Variable Name="TotalPatrimonioCAnterior">
<Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteAnterior.Value, 0),"DataSet1")</Value> <Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteAnterior.Value, 0),"DataSet1")</Value>
</Variable> </Variable>
<Variable Name="TotalPatrimonioHAnterior"> <Variable Name="TotalPatrimonioHAnterior">
<Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL CONTABLE" , Fields!ImporteActual.Value, 0),"DataSet1")</Value> <Value>=Sum(Microsoft.VisualBasic.Interaction.iif(Fields!Sup.Value = "CAPITAL" , Fields!ImporteActual.Value, 0),"DataSet1")</Value>
</Variable> </Variable>
<Variable Name="TotalpasivoYHaciendaActual"> <Variable Name="TotalpasivoYHaciendaActual">
<Value>=Variables!TotalPasivoActual.Value+Variables!TotalPatrimonioHActual.Value</Value> <Value>=Variables!TotalPasivoActual.Value+Variables!TotalPatrimonioHActual.Value</Value>
<Writable>true</Writable>
</Variable> </Variable>
<Variable Name="TotalpasivoYHaciendaAnterior"> <Variable Name="TotalpasivoYHaciendaAnterior">
<Value>=Variables!TotalPatrimonioHAnterior.Value+ Variables!TotalPasivoAnterior.Value</Value> <Value>=Variables!TotalPatrimonioHAnterior.Value+ Variables!TotalPasivoAnterior.Value</Value>

View File

@@ -105,7 +105,7 @@ Partial Class RepCxC
CargaCombos() CargaCombos()
CargaGvPersonalizarRaqngoColumnas() CargaGvPersonalizarRaqngoColumnas()
CargaDatos() CargaDatos()
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then ChkAnticipos.visible = True If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True
ActivaEnviarEstadoCuenta() ActivaEnviarEstadoCuenta()
If UsuarioActual.CveRol = 1 Or UsuarioActual.TienePermisoProceso(243) Then LnkDescargarSegmentos.Visible = True If UsuarioActual.CveRol = 1 Or UsuarioActual.TienePermisoProceso(243) Then LnkDescargarSegmentos.Visible = True
CreaDataTableColor() CreaDataTableColor()
@@ -380,55 +380,57 @@ Partial Class RepCxC
If e.Row.DBCampo("CveCliente").ToString.ToEntero > 0 Then If e.Row.DBCampo("CveCliente").ToString.ToEntero > 0 Then
e.Row.FCLiteral("LtlGrupo").Text = $"<a href='/Ventas/Clientes.aspx?CveCliente={e.Row.DBCampo("CveCliente")}' target='_blank'>{e.Row.DBCampo("GPO")}</a>" e.Row.FCLiteral("LtlGrupo").Text = $"<a href='/Ventas/Clientes.aspx?CveCliente={e.Row.DBCampo("CveCliente")}' target='_blank'>{e.Row.DBCampo("GPO")}</a>"
End If End If
End If End If
Dim AplicaAnticipos As Integer = If(ChkAnticipos.Checked, 1, 0)
Dim Liga1 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}", Dim Liga1 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga2 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga2 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga3 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga3 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga4 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga4 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga5 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente{26}", Dim Liga5 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente{26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga6 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga6 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga7 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga7 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga8 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga8 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga9 As String = String.Format("/CxC/RepCxCDetalle.aspx.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga9 As String = String.Format("/CxC/RepCxCDetalle.aspx.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga10 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga10 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim Liga11 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim Liga11 As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
Dim LigaTot As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&EstatusCliente={26}", Dim LigaTot As String = String.Format("/CxC/RepCxCDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSubProyecto={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&IVA={10}&FechaI={11}&FechaF={12}&CveResponsable={13}&TipoDocto={14}&TipoCambio={15}&TCEspecifico={16}&FechaVI={17}&FechaVF={18}&CveClienteSucursal={19}&FechaCorte={20}&CveCobranzaEstatus={21}&CveClienteClasificacion={22}&LimiteCredito={23}&TipoCliente={24}&CveMoneda={25}&EstatusCliente={26}&AplicaAnticiposPagados={27}",
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"), DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero) e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), FechaVI, FechaVF, CveClienteSucursal, txtCorteA.Text, CveCobranzaEstatus, CveClienteClasificacion, e.Row.DBCampo("LimiteCredito"), If(DdlGrupo.SelectedValue.ToEntero = 12, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue), e.Row.DBCampo("CveMoneda"), DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticipos)
e.Row.FCHyperLink("HplSaldo").NavigateUrl = LigaTot e.Row.FCHyperLink("HplSaldo").NavigateUrl = LigaTot

View File

@@ -312,6 +312,10 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-2">
<asp:CheckBox ID="ChkAnticipos" runat="server" Text="Incluye Anticipos" TextAlign="Left" Checked="true" Visible="false" />
</div>
</div> </div>
@@ -324,11 +328,11 @@
<asp:UpdatePanel ID="UpCobranza" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpCobranza" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-12" style="text-align:right">
<div class="text-left">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div> </div>
<div class="col-md-offset-8" style="width: 300px;"> <div class="col-md-offset-8" style="width: 300px;">
<div class="portlet light bordered xspadding" id="DivCobranza" runat="server" visible="false"> <div class="portlet light bordered xspadding" id="DivCobranza" runat="server" visible="false">

View File

@@ -348,6 +348,11 @@ Partial Class RepCxCDetalle
DdlSubProyecto.SelectedValueExist(CveSubProyecto) DdlSubProyecto.SelectedValueExist(CveSubProyecto)
If Request("AplicaAnticiposPagados") IsNot Nothing Then
ChkAnticipos.Checked = If(Request("AplicaAnticiposPagados").ToEntero = 1, True, False)
End If
DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion) DdlClienteClasificacion.SelectedValueExist(CveClienteClasificacion)
CargaClientes() CargaClientes()
If CveCliente > 0 Then If CveCliente > 0 Then
@@ -410,7 +415,7 @@ Partial Class RepCxCDetalle
DdlClientesWS.Attributes.Add("style", "!important width: 100%;") DdlClientesWS.Attributes.Add("style", "!important width: 100%;")
End If End If
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True
End Sub End Sub
Private Function CargaDatos() As DataTable Private Function CargaDatos() As DataTable
Dim dt As DataTable = Nothing Dim dt As DataTable = Nothing
@@ -427,6 +432,7 @@ Partial Class RepCxCDetalle
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1") FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1")
FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1") FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1")
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero 'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
Dim CveCliente = If(DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.SelectedValue.ToEntero, -1) Dim CveCliente = If(DdlClientesWS.SelectedValue.ToEntero > 0, DdlClientesWS.SelectedValue.ToEntero, -1)
If ObjMovtos.GetCxCDetalle(FechaI, FechaF, CveCliente, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, If ObjMovtos.GetCxCDetalle(FechaI, FechaF, CveCliente, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero,
@@ -435,7 +441,7 @@ Partial Class RepCxCDetalle
RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM), FechaVI, FechaVF,
FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=DdlCobranzaEstatusFiltro.SelectedValue.ToEntero, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=DdlCobranzaEstatusFiltro.SelectedValue.ToEntero,
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, LimiteCredito:=LimiteCredito, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, LimiteCredito:=LimiteCredito, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero,
CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero) Then CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, AplicaAnticiposPagados:=If(ChkAnticipos.Checked, 1, 0)) Then
GvDatos.DataSource = ObjMovtos.DtResultados GvDatos.DataSource = ObjMovtos.DtResultados
dt = ObjMovtos.DtResultados dt = ObjMovtos.DtResultados

View File

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

View File

@@ -524,7 +524,7 @@ Partial Class Inventarios_EntregaAlmacen
ChkTransitorio.Checked = False ChkTransitorio.Checked = False
TxtResponsable.Text = "" TxtResponsable.Text = ""
DivTransitorio2.Visible = False DivTransitorio2.Visible = False
DdlAlmacen.Enabled = True
Select Case CType(Boton.NamingContainer, GridViewRow).DataKey("TipoEntrega").ToEntero() Select Case CType(Boton.NamingContainer, GridViewRow).DataKey("TipoEntrega").ToEntero()
Case 1 ' VENTA Case 1 ' VENTA
@@ -742,12 +742,17 @@ Partial Class Inventarios_EntregaAlmacen
Dim DtMov As DataTable = DtExistencias.FiltraParametros("CveConcepto = 40", "", {"CveAlmacen"}) Dim DtMov As DataTable = DtExistencias.FiltraParametros("CveConcepto = 40", "", {"CveAlmacen"})
If DtMov.Rows.Count > 0 AndAlso CveAlmacen <= 0 Then If DtMov.Rows.Count > 0 AndAlso CveAlmacen <= 0 Then
Dim CveAlmacenDev As Integer = DtMov.Rows(0)("CveAlmacen").ToString().ToEntero() 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.SelectedValueExistInsert(CveAlmacenDev, AlmacenDev) ' se va a poder regresar en algun almacen diferente
'DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}") DdlAlmacen.Enabled = False
'DdlAlmacen.DataBind() End If
DdlAlmacen.SelectedValueExist(CveAlmacenDev) ' se va a poder regresar en algun almacen diferente
EsDevolucionDirecta = True EsDevolucionDirecta = True
End If End If
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 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 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 ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For 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 PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If 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 ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For 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 PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal
End If 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 ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.")
Exit For Exit For
@@ -2796,13 +2801,26 @@ Partial Class Inventarios_EntregaAlmacen
FolioVirtual = ObjInventario.Folio FolioVirtual = ObjInventario.Folio
If CveMovimientoVirtual > 0 Then 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 For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero() Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal() Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() 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 ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For Exit For
@@ -3529,6 +3547,9 @@ Partial Class Inventarios_EntregaAlmacen
LbSurtida.Visible = False LbSurtida.Visible = False
TimmerRefresh.Enabled = True TimmerRefresh.Enabled = True
DdlAlmacen.Enabled = True
UpGenerales.Update() UpGenerales.Update()
CargaGvDatos() 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")); string ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, e.Row.DataKey("TimbreTipoDocto"), e.Row.DataKey("SerieFolio"));
//if (File.Exists(ArchivoXML)) 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 (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 else
{ {

View File

@@ -890,6 +890,8 @@
<asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" GridLines=" none" BorderColor="Transparent" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" <asp:GridView ID="GvD" runat="server" AutoGenerateColumns="False" GridLines=" none" BorderColor="Transparent" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn"
DataKeyNames="SubProyecto, Cantidad, Importe, Descuento, CveOrdenCompra, CveUnidadMedida, CvePresupuestoEgreso, PS,CveClasificacion, CvePS, CveSubProyecto, CveActivoFijo, CodigoAF, TipoDato, Observacion, CveOrdenCompraDetalle,CveCompra,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje,CantidadNoEditable,CveCultivoCuadroDetalle" data-tableheader=".GVDHeader" ShowHeader="false" data-rows="0"> DataKeyNames="SubProyecto, Cantidad, Importe, Descuento, CveOrdenCompra, CveUnidadMedida, CvePresupuestoEgreso, PS,CveClasificacion, CvePS, CveSubProyecto, CveActivoFijo, CodigoAF, TipoDato, Observacion, CveOrdenCompraDetalle,CveCompra,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje,CantidadNoEditable,CveCultivoCuadroDetalle" data-tableheader=".GVDHeader" ShowHeader="false" data-rows="0">
<Columns> <Columns>
<%-- 0 --%>
<asp:TemplateField> <asp:TemplateField>
<EditItemTemplate> <EditItemTemplate>
<asp:TextBox ID="TxtCantEdit" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Width="45px" Height="24px"></asp:TextBox> <asp:TextBox ID="TxtCantEdit" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Width="45px" Height="24px"></asp:TextBox>
@@ -904,6 +906,7 @@
<asp:Label ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Style="width: 100%"></asp:Label> <asp:Label ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,###.######}")%>' Style="width: 100%"></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 1 --%>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<span style="border-bottom: 1px solid gray;"> <span style="border-bottom: 1px solid gray;">
@@ -924,6 +927,7 @@
<ajax:ValidatorCalloutExtender ID="VCOPSEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVPSEdit" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCOPSEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVPSEdit" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate> </EditItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 2 --%>
<asp:TemplateField> <asp:TemplateField>
<EditItemTemplate> <EditItemTemplate>
<%--DataTextField--%> <%--DataTextField--%>
@@ -935,6 +939,7 @@
<asp:Literal ID="LA" runat="server" Text='<%# Bind("UM") %>'></asp:Literal> <asp:Literal ID="LA" runat="server" Text='<%# Bind("UM") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 3 --%>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlObsPS" runat="server" Text='<%# Eval("Observacion")%>'></asp:Literal> <asp:Literal ID="LtlObsPS" runat="server" Text='<%# Eval("Observacion")%>'></asp:Literal>
@@ -943,6 +948,7 @@
<asp:TextBox ID="TxtObsPS" CssClass="txtobs" runat="server" Rows="2" Text='<%# Eval("Observacion") %>' TextMode="MultiLine" MaxLength="750" Style=""></asp:TextBox> <asp:TextBox ID="TxtObsPS" CssClass="txtobs" runat="server" Rows="2" Text='<%# Eval("Observacion") %>' TextMode="MultiLine" MaxLength="750" Style=""></asp:TextBox>
</EditItemTemplate> </EditItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 4 --%>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
@@ -972,28 +978,22 @@
</EditItemTemplate> </EditItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 5 --%>
<asp:TemplateField> <asp:TemplateField>
<EditItemTemplate> <EditItemTemplate>
<asp:HiddenField ID="HdnCveActivoFijo" Value="-1" runat="server" /> <asp:HiddenField ID="HdnCveActivoFijo" Value="-1" runat="server" />
<asp:HiddenField ID="HdnCodigoAF" Value="-1" runat="server" /> <asp:HiddenField ID="HdnCodigoAF" Value="-1" runat="server" />
<asp:TextBox ID="LblEditCodigo" runat="server" Text='<%# Bind("CodigoAF")%>' Width="40px"></asp:TextBox> <asp:TextBox ID="LblEditCodigo" runat="server" Text='<%# Bind("CodigoAF")%>' Width="40px"></asp:TextBox>
<asp:HyperLink ID="HplMaq" runat="server" ClientIDMode="Static"> <asp:HyperLink ID="HplMaq" runat="server" ClientIDMode="Static">
<%--<img runat="server" id="ImgAF" alt="Activo Fijo" width="20" height="20" src="/Imagenes/Maquinaria.jpg" style="cursor:pointer;"/>--%>
<asp:Image runat="server" ID="ImgAF" AlternateText="Activo Fijo" Width="20" Height="20" ImageUrl="/Imagenes/Maquinaria.jpg" Style="cursor: pointer;" /> <asp:Image runat="server" ID="ImgAF" AlternateText="Activo Fijo" Width="20" Height="20" ImageUrl="/Imagenes/Maquinaria.jpg" Style="cursor: pointer;" />
</asp:HyperLink> </asp:HyperLink>
<%--<asp:HyperLink ID="HplMaq" runat="server" ClientIDMode="Static"><img alt="Maquinaria" width="20px" height="20px" src="/Imagenes/Maquinaria.jpg" style="cursor:pointer;" onclick="$get('divActivosFijos').style.display='';PosicionaObjeto('HplMaq','divActivosFijos');"/></asp:HyperLink>--%>
</EditItemTemplate> </EditItemTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LitMaq" runat="server" Text='<%# Bind("CodigoAF")%>'></asp:Literal> <asp:Literal ID="LitMaq" runat="server" Text='<%# Bind("CodigoAF")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- <asp:TemplateField Visible="False"> <%-- 6 --%>
<ItemTemplate>
<asp:LinkButton ID="CvePOA2" ClientIDMode="Static" runat="server" CssClass="Texto" Text='<%# Bind("CvePresupuestoEgreso")%>' ToolTip="Error al cargar los datos del Programa Operativo"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="45px" />
</asp:TemplateField>--%>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Label ToolTip='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe"), "")%>' ID="LtlImporte" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe", "{0:#,##0.00####}"), "")%>'></asp:Label> <asp:Label ToolTip='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe"), "")%>' ID="LtlImporte" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Importe", "{0:#,##0.00####}"), "")%>'></asp:Label>
@@ -1007,6 +1007,8 @@
</EditItemTemplate> </EditItemTemplate>
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<%-- 7 --%>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento", "{0:N2}")%>'></asp:Literal> <asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento", "{0:N2}")%>'></asp:Literal>
@@ -1020,7 +1022,7 @@
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<%-- 8 --%>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlIva" runat="server" Text='<%# If(Not IsDBNull(Eval("IVA")), If(Eval("IVA").ToString <> "0", String.Concat(Eval("IVA", "{0:#,##0.00####}"), "<br>", Eval("IVAPorcentaje", "{0:0.### %}")), ""), "") %>'></asp:Literal> <asp:Literal ID="LtlIva" runat="server" Text='<%# If(Not IsDBNull(Eval("IVA")), If(Eval("IVA").ToString <> "0", String.Concat(Eval("IVA", "{0:#,##0.00####}"), "<br>", Eval("IVAPorcentaje", "{0:0.### %}")), ""), "") %>'></asp:Literal>
@@ -1028,18 +1030,18 @@
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<%-- 9 --%>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Total", "{0:#,##0.00####}"), "") %>'></asp:Literal> <asp:Literal ID="LtlTotal" runat="server" Text='<%# If(Not IsDBNull(Eval("Importe")) AndAlso CDbl(Eval("Importe").ToString) <> -1, Eval("Total", "{0:#,##0.00####}"), "") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<%-- 10 --%>
<asp:TemplateField> <asp:TemplateField>
<EditItemTemplate> <EditItemTemplate>
<%--<asp:ImageButton ID="ImgUpdate" runat="server" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" Text="Update" />&nbsp;<asp:ImageButton ID="ImgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" Text="Cancel" />--%>
<div> <div>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="false" CommandName="Update" <asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="false" CommandName="Update"
ValidationGroup="grpEditar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" /> ValidationGroup="grpEditar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" />
@@ -1054,27 +1056,30 @@
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" <asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete"
CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" /> CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
</div> </div>
<%-- <asp:ImageButton ID="ImgEdit" runat="server" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" Text="Edit" />
<asp:ImageButton ID="ImgDelete" runat="server" CausesValidation="False" OnClientClick="return confirm('Está seguro que desea eliminar el movimiento?')" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" Text="Edit" />--%>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 11 --%>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<ItemTemplate> <ItemTemplate>
<%--<asp:HyperLink ID="HLLiga" runat="server" Text="" CssClass="Texto" />--%>
<asp:Literal ID="LtlLiga" runat="server"></asp:Literal> <asp:Literal ID="LtlLiga" runat="server"></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 12 --%>
<asp:TemplateField Visible="false"> <asp:TemplateField Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlCompra" runat="server" Visible='<%# Eval("CveCompra").ToString <> "" %>'></asp:Literal> <asp:Literal ID="LtlCompra" runat="server" Visible='<%# Eval("CveCompra").ToString <> "" %>'></asp:Literal>
<asp:LinkButton OnClick="LnkCompra_Click" ID="LnkCompra" Visible="false" runat="server"> Ver</asp:LinkButton> <asp:LinkButton OnClick="LnkCompra_Click" ID="LnkCompra" Visible="false" runat="server"> Ver</asp:LinkButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 13 --%>
<asp:TemplateField HeaderText="Clasificación" Visible="False" ShowHeader="true"> <asp:TemplateField HeaderText="Clasificación" Visible="False" ShowHeader="true">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList runat="server" ID="DdlAC5" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="CodigoClasificacion" DataValueField="CveClasificacion" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlAC5" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="CodigoClasificacion" DataValueField="CveClasificacion" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 14 --%>
<asp:TemplateField HeaderText="Programa Operativo" Visible="False" ShowHeader="true"> <asp:TemplateField HeaderText="Programa Operativo" Visible="False" ShowHeader="true">
<ItemTemplate> <ItemTemplate>
<asp:HiddenField runat="server" ID="HdnCvePresupuestoEgreso" Value="-1" /> <asp:HiddenField runat="server" ID="HdnCvePresupuestoEgreso" Value="-1" />
@@ -1085,27 +1090,29 @@
<asp:DropDownList runat="server" ID="DdlAC1" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="ProgramaOperativo" DataValueField="CveProgramaOperativo" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlAC1" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="ProgramaOperativo" DataValueField="CveProgramaOperativo" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 15 --%>
<asp:TemplateField HeaderText="Unidad Administrativa" Visible="False" ShowHeader="true"> <asp:TemplateField HeaderText="Unidad Administrativa" Visible="False" ShowHeader="true">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList runat="server" ID="DdlAC2" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="UnidadAdministrativa" DataValueField="CveUnidadAdministrativa" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlAC2" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="UnidadAdministrativa" DataValueField="CveUnidadAdministrativa" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 16 --%>
<asp:TemplateField HeaderText="Fuente Financiamiento" Visible="False" ShowHeader="true"> <asp:TemplateField HeaderText="Fuente Financiamiento" Visible="False" ShowHeader="true">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList runat="server" ID="DdlAC3" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="FuenteFinanciamiento" DataValueField="CveFuenteFinanciamiento" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlAC3" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="FuenteFinanciamiento" DataValueField="CveFuenteFinanciamiento" Width="150px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- 17 --%>
<asp:TemplateField HeaderText="Tipo Gasto" Visible="False" ShowHeader="true"> <asp:TemplateField HeaderText="Tipo Gasto" Visible="False" ShowHeader="true">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList runat="server" ID="DdlAC4" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="TipoGasto" DataValueField="CveTipoGasto" Width="100px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlAC4" CssClass="form-control input-sm select2me" AutoPostBack="true" DataTextField="TipoGasto" DataValueField="CveTipoGasto" Width="100px" OnSelectedIndexChanged="CompruebaSaldoAC"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%--<asp:TemplateField></asp:TemplateField>
<asp:TemplateField></asp:TemplateField>--%>
</Columns> </Columns>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle> <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<%--<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView> </asp:GridView>
<asp:UpdatePanel ID="UpIvas" runat="server" class="text-right" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpIvas" runat="server" class="text-right" UpdateMode="Conditional">

View File

@@ -862,7 +862,7 @@ Partial Class OC
If (UsuarioActual.TienePermisoProceso(203)) AndAlso Dr("TipoTermino").ToString.ToEntero = 3 AndAlso Dr("Tipo").ToString = "OC" Then If (UsuarioActual.TienePermisoProceso(203)) AndAlso Dr("TipoTermino").ToString.ToEntero = 3 AndAlso Dr("Tipo").ToString = "OC" Then
CargaClasificaciones() CargaClasificaciones()
If Not UsuarioActual.TienePermisoProceso(131) Then DesHabilitar() If Not UsuarioActual.TienePermisoProceso(131) Then DesHabilitar()
GvD.Columns(9).Visible = True GvD.Columns(10).Visible = True
LbAgregar.Enabled = True LbAgregar.Enabled = True
txtPrecioUnitario.Enabled = True txtPrecioUnitario.Enabled = True
DdlProyecto.Enabled = True DdlProyecto.Enabled = True
@@ -1599,7 +1599,7 @@ Partial Class OC
SubProyectosNoAutorizados.Add(Row("SubProyecto").ToString) SubProyectosNoAutorizados.Add(Row("SubProyecto").ToString)
CboE.BackColor = Drawing.Color.Silver CboE.BackColor = Drawing.Color.Silver
CboE.Enabled = False CboE.Enabled = False
GvD.Columns(9).Visible = False 'No permitir la edicion GvD.Columns(10).Visible = False 'No permitir la edicion
'GvD.Columns(9).Visible = True 'GvD.Columns(9).Visible = True
ChkCotizacion.Enabled = False ChkCotizacion.Enabled = False
TxtDescrip.Enabled = False TxtDescrip.Enabled = False
@@ -1635,7 +1635,7 @@ Partial Class OC
'EDICION 'EDICION
'CUANDO EL LA REGISRO Y TIENE ACCESO A ESE ESTATUS 'CUANDO EL LA REGISRO Y TIENE ACCESO A ESE ESTATUS
If objOC.CveUsuario = UsuarioActual.CveUsuario AndAlso (DtEstatusUsuarios.FiltraParametros(String.Format(" CveEstatus = {0}", CveEstatus)).Rows.Count >= 1 Or CveEstatus = 0) Then If objOC.CveUsuario = UsuarioActual.CveUsuario AndAlso (DtEstatusUsuarios.FiltraParametros(String.Format(" CveEstatus = {0}", CveEstatus)).Rows.Count >= 1 Or CveEstatus = 0) Then
GvD.Columns(9).Visible = True 'No permitir la edicion GvD.Columns(10).Visible = True 'No permitir la edicion
If ChkCotizacion.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(565) = "1" Then If ChkCotizacion.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(565) = "1" Then
ChkCotizacion.Enabled = False ChkCotizacion.Enabled = False
Else Else
@@ -1720,7 +1720,7 @@ Partial Class OC
If EditarOC Then If EditarOC Then
CboE.Enabled = True CboE.Enabled = True
GvD.Columns(9).Visible = True 'Permitir la edicion GvD.Columns(10).Visible = True 'Permitir la edicion
ChkCotizacion.Enabled = True ChkCotizacion.Enabled = True
TxtDescrip.Enabled = True TxtDescrip.Enabled = True
TxtJustificacion.Enabled = True TxtJustificacion.Enabled = True
@@ -3684,11 +3684,11 @@ Partial Class OC
'If DtEstatusUsuarios.FiltraParametros(String.Format("CveSubProyecto = {0}", e.Row.DBCampo("CveSubProyecto"))).Rows.Count = 0 Then e.Row.FCImageButton("ImgEdit").Visible = False : e.Row.FCImageButton("ImgDelete").Visible = False 'If DtEstatusUsuarios.FiltraParametros(String.Format("CveSubProyecto = {0}", e.Row.DBCampo("CveSubProyecto"))).Rows.Count = 0 Then e.Row.FCImageButton("ImgEdit").Visible = False : e.Row.FCImageButton("ImgDelete").Visible = False
If TipoOC = "OC" AndAlso Not IsDBNull(e.Row.DBCampo("CveOrdenCompraPadre")) AndAlso IsNumeric(e.Row.DBCampo("CveOrdenCompraPadre")) Then If TipoOC = "OC" AndAlso Not IsDBNull(e.Row.DBCampo("CveOrdenCompraPadre")) AndAlso IsNumeric(e.Row.DBCampo("CveOrdenCompraPadre")) Then
GvD.Columns(10).Visible = True GvD.Columns(11).Visible = True
lblTipoPadreHijo.Visible = True lblTipoPadreHijo.Visible = True
e.Row.FCLiteral("LtlLiga").Text = String.Format("<a class='Texto' href='/OC/OC.aspx?OC={0}'>{1}</a>", e.Row.DBCampo("CveOrdenCompraPadre"), e.Row.DBCampo("FolioOrdenCompraPadre")) e.Row.FCLiteral("LtlLiga").Text = String.Format("<a class='Texto' href='/OC/OC.aspx?OC={0}'>{1}</a>", e.Row.DBCampo("CveOrdenCompraPadre"), e.Row.DBCampo("FolioOrdenCompraPadre"))
ElseIf TipoOC = "REQ" AndAlso Not IsDBNull(e.Row.DBCampo("CveOrdenCompraHija")) AndAlso IsNumeric(e.Row.DBCampo("CveOrdenCompraHija")) Then ElseIf TipoOC = "REQ" AndAlso Not IsDBNull(e.Row.DBCampo("CveOrdenCompraHija")) AndAlso IsNumeric(e.Row.DBCampo("CveOrdenCompraHija")) Then
GvD.Columns(10).Visible = True GvD.Columns(11).Visible = True
lblTipoPadreHijo.Visible = True lblTipoPadreHijo.Visible = True
e.Row.FCLiteral("LtlLiga").Text = String.Format("<a class='Texto' href='/OC/OC.aspx?OC={0}'>{1}</a>", e.Row.DBCampo("CveOrdenCompraHija"), e.Row.DBCampo("FolioOrdenCompraHija")) e.Row.FCLiteral("LtlLiga").Text = String.Format("<a class='Texto' href='/OC/OC.aspx?OC={0}'>{1}</a>", e.Row.DBCampo("CveOrdenCompraHija"), e.Row.DBCampo("FolioOrdenCompraHija"))
End If End If
@@ -3702,7 +3702,7 @@ Partial Class OC
If ObjOC.DtResultados.Rows.Count = 1 Then If ObjOC.DtResultados.Rows.Count = 1 Then
e.Row.FCLiteral("LtlCompra").Text = String.Format("<a class='Texto' target='_blank' href='../Compras/Compras.aspx?CveCompra={0}'>{1}</a>", ObjOC.DtResultados.FiltroPrimeroValor("CveCompra"), e.Row.DBCampo("FolioCompra")) e.Row.FCLiteral("LtlCompra").Text = String.Format("<a class='Texto' target='_blank' href='../Compras/Compras.aspx?CveCompra={0}'>{1}</a>", ObjOC.DtResultados.FiltroPrimeroValor("CveCompra"), e.Row.DBCampo("FolioCompra"))
LblCompra.Visible = True LblCompra.Visible = True
GvD.Columns(11).Visible = True GvD.Columns(12).Visible = True
ElseIf ObjOC.DtResultados.Rows.Count > 1 Then ElseIf ObjOC.DtResultados.Rows.Count > 1 Then
LblCompra.Visible = True LblCompra.Visible = True
e.Row.FCLiteral("LtlCompra").Visible = False e.Row.FCLiteral("LtlCompra").Visible = False
@@ -3711,7 +3711,7 @@ Partial Class OC
'e.Row.FCLinkButton("LnkCompra").CausesValidation = False 'e.Row.FCLinkButton("LnkCompra").CausesValidation = False
'e.Row.FCLinkButton("LnkCompra").OnClientClick = "return true;" 'return true; 'e.Row.FCLinkButton("LnkCompra").OnClientClick = "return true;" 'return true;
e.Row.FCLinkButton("LnkCompra").CommandArgument = e.Row.DBCampo("CveOrdenCompraDetalle") e.Row.FCLinkButton("LnkCompra").CommandArgument = e.Row.DBCampo("CveOrdenCompraDetalle")
GvD.Columns(11).Visible = True GvD.Columns(12).Visible = True
Else Else
e.Row.FCLiteral("LtlCompra").Text = "" e.Row.FCLiteral("LtlCompra").Text = ""
LblCompra.Visible = True LblCompra.Visible = True
@@ -4134,8 +4134,8 @@ Partial Class OC
DdlProveedorSucursal.Enabled = False DdlProveedorSucursal.Enabled = False
DdlProveedorContacto.Enabled = False DdlProveedorContacto.Enabled = False
GvD.Columns(9).Visible = False GvD.Columns(10).Visible = False
GvD.Columns(10).Visible = True GvD.Columns(11).Visible = True
If Not (BtnCancelarPrevio.Enabled And (CveEstatus <> CveEstatusFinalError OrElse CveEstatus <> CveEstatusFinalOK OrElse UsuarioActual.TienePermisoProceso(148).ToEntero > 0)) Then If Not (BtnCancelarPrevio.Enabled And (CveEstatus <> CveEstatusFinalError OrElse CveEstatus <> CveEstatusFinalOK OrElse UsuarioActual.TienePermisoProceso(148).ToEntero > 0)) Then
BtnCancelarPrevio.Enabled = False BtnCancelarPrevio.Enabled = False
@@ -4299,11 +4299,11 @@ Partial Class OC
'Seccion Grid 'Seccion Grid
If VerificaPresupuesto Then If VerificaPresupuesto Then
GvD.Width = 1750 GvD.Width = 1750
GvD.Columns(12).Visible = True
GvD.Columns(13).Visible = True GvD.Columns(13).Visible = True
GvD.Columns(14).Visible = True GvD.Columns(14).Visible = True
GvD.Columns(15).Visible = True GvD.Columns(15).Visible = True
GvD.Columns(16).Visible = True GvD.Columns(16).Visible = True
GvD.Columns(17).Visible = True
'Panel General 'Panel General
UpPresupuestosAC.Visible = True UpPresupuestosAC.Visible = True
@@ -4330,11 +4330,11 @@ Partial Class OC
Else Else
'GvD.Width = Width.ToEntero 'GvD.Width = Width.ToEntero
GvD.Columns(12).Visible = False
GvD.Columns(13).Visible = False GvD.Columns(13).Visible = False
GvD.Columns(14).Visible = False GvD.Columns(14).Visible = False
GvD.Columns(15).Visible = False GvD.Columns(15).Visible = False
GvD.Columns(16).Visible = False GvD.Columns(16).Visible = False
GvD.Columns(17).Visible = False
UpPresupuestosAC.Visible = False UpPresupuestosAC.Visible = False
End If End If
@@ -6685,11 +6685,11 @@ Partial Class OC
CboE_SelectedIndexChanged(CboE, EventArgs.Empty) CboE_SelectedIndexChanged(CboE, EventArgs.Empty)
GvD.Columns(9).Visible = True 'Permitir la edicion GvD.Columns(10).Visible = True 'Permitir la edicion
lblTipoPadreHijo.Visible = False lblTipoPadreHijo.Visible = False
GvD.Columns(10).Visible = False
LblCompra.Visible = False
GvD.Columns(11).Visible = False GvD.Columns(11).Visible = False
LblCompra.Visible = False
GvD.Columns(12).Visible = False
ChkCotizacion.Visible = True ChkCotizacion.Visible = True
ChkCotizacion.Enabled = True ChkCotizacion.Enabled = True
@@ -6818,7 +6818,7 @@ Partial Class OC
ScriptManager.RegisterStartupScript(Me, GetType(Page), "anioactual", script, True) ScriptManager.RegisterStartupScript(Me, GetType(Page), "anioactual", script, True)
VerificaPresupuesto = False VerificaPresupuesto = False
RVSubProyecto.Enabled = If(RequiereSubProyecto = True, True, False) RVSubProyecto.Enabled = If(RequiereSubProyecto = True, True, False)
GvD.Columns(10).Visible = False GvD.Columns(11).Visible = False
CargaComboCFDI() CargaComboCFDI()
CargaMonedas() CargaMonedas()
'CargaClasificaciones() 'CargaClasificaciones()

View File

@@ -34,7 +34,7 @@
<br /> <br />
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="800px" <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="800px"
DataKeyNames="CveRegistroPatronal,RegistroPatronal,Estatus,CveEmpresa,FechaIng,CveUsuario" EmptyDataText="No se encontraron Registros Patronales" ToolTip="Listado de Registros Patronales" DataKeyNames="CveRegistroPatronal,RegistroPatronal,Estatus,CveEmpresa,FechaIng,CveUsuario" EmptyDataText="No se encontraron Registros Patronales" ToolTip="Listado de Registros Patronales"
CssClass="table table-striped table-advance table-hover" GridLines="None"> CssClass="table table-hover table-striped table-advance table-hover Widthall " GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Registro Patronal" DataField="RegistroPatronal" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Registro Patronal" DataField="RegistroPatronal" ItemStyle-HorizontalAlign="Left" />

View File

@@ -1763,7 +1763,7 @@
<asp:UpdatePanel runat="server" ID="UpFonacotGrid" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpFonacotGrid" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GVNomFonacot" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" <asp:GridView ID="GVNomFonacot" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall"
AutoGenerateColumns="False" ShowHeaderWhenEmpty="true" EmptyDataText="No ahi créditos fonacot registrados." AutoGenerateColumns="False" ShowHeaderWhenEmpty="true" EmptyDataText="No hay créditos FONACOT registrados."
DataKeyNames="CveFonacot,CvePersonal,NumeroCredito,Descripcion,Periodo,CveTipoCalculo,ImporteCredito,ImporteFijo,PagosHechos,MontoAcumulado,Saldo,CveEstatus,Observaciones,CveUsuarioIng"> DataKeyNames="CveFonacot,CvePersonal,NumeroCredito,Descripcion,Periodo,CveTipoCalculo,ImporteCredito,ImporteFijo,PagosHechos,MontoAcumulado,Saldo,CveEstatus,Observaciones,CveUsuarioIng">
<Columns> <Columns>
<asp:TemplateField HeaderText="Numero crédito"> <asp:TemplateField HeaderText="Numero crédito">
@@ -4119,7 +4119,7 @@
<span class="caption-subject bold">Agregar</span> <span class="caption-subject bold">Agregar</span>
</div>--%> </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="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> <asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" /> <UserControl:TareaNueva runat="server" ID="TareaNueva" />
</div> </div>

View File

@@ -1,21 +0,0 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="SAT_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class SAT_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

View File

@@ -41,18 +41,19 @@
white-space: nowrap; white-space: nowrap;
} }
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(2), .reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(2)
.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) { /*,.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) */
{
background-color: #900; background-color: #900;
color: #FFF; color: #FFF;
} }
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(3), .reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(3),
.reporte1 .GVSolicitudTimbreNominaGral tr th:nth-child(4), .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(3),
.reporte1 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(4), .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; background-color: #3598dc;
color: #FFF; color: #FFF;
} }
@@ -66,14 +67,14 @@
white-space: nowrap; white-space: nowrap;
} }
.reporte2 .GVSolicitudTimbreNominaGral tr th:nth-child(2), .reporte2 .GVSolicitudTimbreNominaGral tr th:nth-child(2)/*,
.reporte2 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) { .reporte2 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2)*/ {
background-color: #900; background-color: #900;
color: #FFF; color: #FFF;
} }
.reporte2 .GVSolicitudTimbreNominaGral tr th: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)){ .reporte2 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(n+3):not(:nth-child(7))*/{
background-color: #3598dc; background-color: #3598dc;
color: #FFF; color: #FFF;
} }
@@ -93,17 +94,17 @@
} }
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(2), .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(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; background-color: #900;
color: #FFF; color: #FFF;
} }
.reporte3 .GVSolicitudTimbreNominaGral tr th:nth-child(1), .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(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; background-color: #3598dc;
color: #FFF; color: #FFF;
} }
@@ -115,39 +116,82 @@
white-space: nowrap; white-space: nowrap;
} }
.reporte4 .GVSolicitudTimbreNominaGral tr th:nth-child(2), .reporte4 .GVSolicitudTimbreNominaGral tr th:nth-child(2)/*,
.reporte4 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2) { .reporte4 .ADScroller-body .GVSolicitudTimbreNominaGral tr:nth-child(2) td:nth-child(2)*/ {
background-color: #900; background-color: #900;
color: #FFF; color: #FFF;
} }
.reporte4 .GVSolicitudTimbreNominaGral tr th: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) { .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; background-color: #3598dc;
color: #FFF; color: #FFF;
} }
.reporte6 .GVSolicitudTimbreNominaGral tr td:nth-child(n) { .reporte6 .GVSolicitudTimbreNominaGral tr td:nth-child(n) {
white-space: nowrap; white-space: nowrap;
} }
.reporte6 .GVSolicitudTimbreNominaGral tr td:nth-child(n+3), .reporte6 .GVSolicitudTimbreNominaGral tr td:nth-child(n+4),
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+3) { .reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+4) {
text-align: right !important; 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; background-color: #900;
color: #FFF; color: #FFF;
} }
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+7):not(:nth-child(n+10)) {
.reporte6 .GVSolicitudTimbreNominaGral tr th:nth-child(n+6) {
background-color: #3598dc; background-color: #3598dc;
color: #FFF; 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(1),
.reporte9 .GVSolicitudTimbreNominaGral tr td:nth-child(4) { .reporte9 .GVSolicitudTimbreNominaGral tr td:nth-child(4) {
white-space: nowrap; white-space: nowrap;
@@ -161,7 +205,7 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li> <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> </li>
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
@@ -181,21 +225,22 @@
<div class="portlet-title portlet-filterT smalltitle"> <div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<div class="row"> <div class="row">
<label class="col-md-1">Reporte: </label> <label class="col-md-1">Agrupador: </label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlReporte" runat="server" Style="width: 100% !important;" CssClass="select2me" DataValueField="CveUsuario" DataTextField="Nombre"> <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="1" Text="Conciliacion ISR mensual"></asp:ListItem>
<asp:ListItem Value="2" Text="Conciliacion ISR por concepto"></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="3" Text="Conciliacion ISR por recibo"></asp:ListItem>
<asp:ListItem Value="4" Text="Anual sueldos y salarios resumen general"></asp:ListItem> <asp:ListItem Value="4" Text="Anual sueldos y salarios "></asp:ListItem>
<asp:ListItem Value="5" Text="Anual sueldos y salarios global por conceptos"></asp:ListItem> <asp:ListItem Value="5" Text="Anual sueldos y salarios resumen general"></asp:ListItem>
<asp:ListItem Value="6" Text="Anual sueldos y salarios por clave SAT"></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 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 concepto"></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:ListItem Value="9" Text="Anual sueldos y salarios por recibo"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 mediocol">del:</label> <label class="col-md-1 mediocol">Fecha inicio:</label>
<div class="col-md-1"> <div class="col-md-1">
<%--<asp:TextBox ID="TxtPeriodoInicio" Text="0" CssClass="form-control" runat="server"></asp:TextBox>--%> <%--<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> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="rfvRpdFechaInicio"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<label class="col-md-1 mediocol">al:</label> <label class="col-md-1 mediocol">Fecha fin:</label>
<div class="col-md-1"> <div class="col-md-1">
<%--<asp:TextBox ID="TxtPeriodoFin" Text="99" CssClass="form-control" runat="server"></asp:TextBox>--%> <%--<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;"> <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); nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin);
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook(); 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.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(); System.IO.Stream fs = new System.IO.MemoryStream();
wb.SaveAs(fs); wb.SaveAs(fs);
fs.Position = 0; fs.Position = 0;
@@ -75,7 +123,7 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
Response.Buffer = true; Response.Buffer = true;
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; 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.BinaryWrite(memoryStream.ToArray());
Response.End(); 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 ''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 HdnCveModuloAcceso.Value <> "" Then
If HdnPermitir.Value = "" OrElse HdnPermitir.Value = "0" 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") Alert("Se ha actualizado el acceso al modulo correctamente")
End If End If
End If End If
'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas) 'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas)
If HdnPermitir.Value = "1" Then 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") Alert("Se ha actualizado el acceso al modulo correctamente")
End If End If
End If End If
Else Else
If HdnPermitir.Value = "" OrElse HdnPermitir.Value = "1" Then 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") Alert("Se ha actualizado el acceso al modulo correctamente")
End If End If
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 ''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 HdnCveModuloAccesoProceso.Value <> "" Then
If HdnPermitirProceso.Value = "" OrElse HdnPermitirProceso.Value = "0" 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") Alert("Se ha actualizado el proceso correctamente")
End If End If
End If End If
'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas) 'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas)
If HdnPermitirProceso.Value = "1" Then 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") Alert("Se ha actualizado el proceso correctamente")
End If End If
End If End If
Else Else
If HdnPermitirProceso.Value = "" OrElse HdnPermitirProceso.Value = "1" Then 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") Alert("Se ha actualizado el proceso correctamente")
End If End If
End If End If

View File

@@ -257,6 +257,15 @@
Buscar Acercamientos Buscar Acercamientos
</a> </a>
</li> </li>
<li id="TdBuscaActivoFijo" runat="server" visible="False">
<a onclick="javascript:AbrirVentana('/AF/PopUpBuscarAF.aspx',800,600,'N');">
<i class="fa fa-building"></i>
Buscar Activo Fijo
</a>
</li>
</ul> </ul>
</li> </li>
<li class="dropdown dropdown-user"> <li class="dropdown dropdown-user">

View File

@@ -276,6 +276,9 @@ Partial Class Site
'BUSCAR ACERCAMIENTO CRM' 'BUSCAR ACERCAMIENTO CRM'
If UsuarioActual.TienePermisoProceso(251) Then TdCRMAcercamientos.Visible = True If UsuarioActual.TienePermisoProceso(251) Then TdCRMAcercamientos.Visible = True
'Busca Activo Fijo
If UsuarioActual.TienePermisoPagina(62) Then TdBuscaActivoFijo.Visible = True
End Sub End Sub
Protected Sub CerrarSesion_Click(sender As Object, e As EventArgs) Handles BtnCerrarSesion.ServerClick Protected Sub CerrarSesion_Click(sender As Object, e As EventArgs) Handles BtnCerrarSesion.ServerClick

View File

@@ -120,6 +120,7 @@
<asp:BoundField DataField="DiasVencidos" ItemStyle-Width="5%" HeaderText="D.Venc" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}" /> <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: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="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%"> <asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label> <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> <ajax:ValidatorCalloutExtender ID="VCEDiasVencidos2" runat="server" HighlightCssClass="vco" TargetControlID="RFVDiasVencidos2" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</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>
<div class="modal-footer"> <div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" /> <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 Inherits ClsPaginas
#Region "PROPIEDADES" #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")))
Return If(IsNothing(ViewState("CveAutorizacion")), -1, CInt(ViewState("CveAutorizacion"))) End Get
End Get Set
Set ViewState("CveAutorizacion") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString)) Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Set End Get
End Property Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region #End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -29,20 +37,20 @@ Partial Class Ventas_CatAutorizacionLimites
DdlCliente.setEsWebService(True) DdlCliente.setEsWebService(True)
DdlClienteFiltro.setEsWebService(True) DdlClienteFiltro.setEsWebService(True)
#Region "CARGAS" 'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
Private Sub CargaCombos() 'If EsWS Then
txtFechaI.Text = Now.AddDays(-1).ToString("dd/MM/yyyy") ' DdlCliente.setEsWebService(True)
txtFechaI.Text = Now.ToString("dd/MM/yyyy") ' DdlClienteFiltro.setEsWebService(True)
'Else
DdlCliente.setEsWebService(True) ' DdlCliente.setEsWebService(False)
DdlClienteFiltro.setEsWebService(True) ' DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
' DdlCliente.DataBind()
'Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) ' DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
'If EsWS Then
' DdlCliente.setEsWebService(True) ' DdlClienteFiltro.setEsWebService(False)
' DdlClienteFiltro.setEsWebService(True) ' DdlClienteFiltro.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
'Else ' DdlClienteFiltro.DataBind()
' DdlCliente.setEsWebService(False) ' DdlClienteFiltro.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If 'End If
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
@@ -64,8 +72,8 @@ Partial Class Ventas_CatAutorizacionLimites
CveCliente = DdlClienteFiltro.SelectedValue.ToEntero() CveCliente = DdlClienteFiltro.SelectedValue.ToEntero()
End If End If
Private Sub CargaDatos() Dim FechaI, FechaF As Date
Dim CveCliente As Integer = -1 FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim.ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha)
Dim ObjGral As New ClsVentas Dim ObjGral As New ClsVentas
@@ -103,8 +111,10 @@ Partial Class Ventas_CatAutorizacionLimites
LimpiaModal() LimpiaModal()
Modalidad = "A" Modalidad = "A"
BtnGuardar.Text = "Agregar" BtnGuardar.Text = "Agregar"
ltlMotititulo.Text = "Agregar autorización"
CargaDatos() UpModal.Update()
RegistraScript("$('#DModal').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
If DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then If DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia) Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
@@ -119,8 +129,10 @@ Partial Class Ventas_CatAutorizacionLimites
DiasVencidos = TxtDiasVencidos.Text.ToEntero() DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If End If
Dim Motivo As String = TxtMotivo.Text.Trim
Dim ObjPS As New ClsVentas 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')") RegistraScript("$('#DModal').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion) Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
End If End If
@@ -132,9 +144,13 @@ Partial Class Ventas_CatAutorizacionLimites
#End Region #End Region
#Region "LIMPIAR" #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 #End Region
@@ -286,9 +302,11 @@ Partial Class Ventas_CatAutorizacionLimites
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2")) DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
End If End If
DivMotivo.Visible = False
Case "Egs" Case "Egs"
'QUITAR LA DE VENCIMIENTO 'QUITAR LA DE VENCIMIENTO
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2")) DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
DivMotivo.Visible = True
End Select End Select
UpModal.Update() UpModal.Update()
End Sub End Sub

View File

@@ -2452,10 +2452,7 @@
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;"> <div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
<asp:UpdatePanel ID="UpAgregarCliente" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAgregarCliente" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<fieldset>
<%--<legend><b>Descripción</b></legend>--%>
<table border="0" class="portlet light bordered">
<tr>
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
@@ -2469,10 +2466,8 @@
</div> </div>
</tr>
<tr> <div class="modal-body">
<div class="row" style="padding-left: 16px;"> <div class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-9"> <div class="form-group form-md-line-input input-iconright col-xs-9">
<asp:TextBox ID="TxtRFCCliente" Text="XAXX010101000" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtRFCCliente" Text="XAXX010101000" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox>
@@ -2489,19 +2484,12 @@
<div class="col-md-12"> <div class="col-md-12">
<div runat="server" id="DivTipoPersona" class="form-group form-md-line-input input-iconright"> <div runat="server" id="DivTipoPersona" visible="false" class="form-group form-md-line-input input-iconright">
<%-- <asp:RadioButtonList runat="server" ID="RdTipoPersona" RepeatDirection="Horizontal" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm"> <asp:RadioButtonList runat="server" ID="RdTipoPersona" RepeatDirection="Horizontal" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control">
<asp:ListItem Value="0">Física</asp:ListItem> <asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem> <asp:ListItem Value="1">Moral</asp:ListItem>
</asp:RadioButtonList>--%> </asp:RadioButtonList>
<asp:DropDownList runat="server" ID="RdTipoPersona" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me">
<asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem>
</asp:DropDownList>
<label for="<%= RdTipoPersona.ClientID.ToString()%>">Tipo Persona:</label> <label for="<%= RdTipoPersona.ClientID.ToString()%>">Tipo Persona:</label>
<i></i> <i></i>
@@ -2630,12 +2618,17 @@
</div>
</tr>
</table>
</fieldset>
<div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer"> <div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer">
<asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" /> <asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" />
<button id="BtnCancelarCliente" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button> <button id="BtnCancelarCliente" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
@@ -2841,6 +2834,7 @@
<asp:HiddenField ID="HdnAplicaIEPS" runat="server" Value="-1" /> <asp:HiddenField ID="HdnAplicaIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPorcentajeIEPS" runat="server" Value="-1" /> <asp:HiddenField ID="HdnPorcentajeIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCvePS" 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="row" runat="server" visible="false">
<div class="col-md-12"> <div class="col-md-12">
@@ -2905,10 +2899,6 @@
</div> </div>
</div> </div>
<div class="portlet-body form"> <div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UPPDatosUsado" UpdateMode="Conditional">
<ContentTemplate>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<label>Tipo Servicio:</label> <label>Tipo Servicio:</label>
@@ -2929,7 +2919,7 @@
<div class="col-md-4"> <div class="col-md-4">
<label>Año:</label> <label>Año:</label>
<br /> <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> <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>
</div> </div>
@@ -2944,7 +2934,7 @@
<label>BCI:</label> <label>BCI:</label>
<br /> <br />
<asp:DropDownList ID="DdlBCIUsado" CssClass="form-control input-sm select2me" runat="server" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%"> <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> </div>
<div class="row"> <div class="row">
@@ -2971,15 +2961,10 @@
</div> </div>
</div> </div>
</div> </div>
</ContentTemplate>
</asp:UpdatePanel>
</div> </div>
</div> </div>
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -3111,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 ID="DdlBCIAjuste" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="BCI" DataValueField="CveBCIUsado" Width="100%" AutoPostBack="true">
</asp:DropDownList> </asp:DropDownList>
<label for="<%= DdlBCIAjuste.ClientID.ToString()%>">BCI:</label> <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> <ajax:ValidatorCalloutExtender ID="VCEBCIAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVBCIAjuste" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
@@ -3145,7 +3130,7 @@
<div class="col-md-8"> <div class="col-md-8">
<div id="DivCodEnsamble" runat="server" class="form-group form-md-line-input input-iconright"> <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: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> <label for="<%= TxtCodEnsamble.ClientID.ToString()%>">Cod.Ensamble:</label>
</div> </div>
</div> </div>
@@ -3336,13 +3321,16 @@
} }
function ValidaAnioVehiculo(val, args) { function ValidaAnioVehiculo(val, args) {
//VALIDA SOLO SI SE SELECCIONO UN USADO var today = new Date();
var cveUsado = ToDouble($get("C_DdlRecepcionUsados").value); var anioActual = today.getFullYear();
if (cveUsado > 0) {
let CveClasificacion = HdnCveClasificacion.value;
const acumuladores = "20520, 20522, 20513, 20511, 20521, 20512, 20514, 20229";
if (acumuladores.includes(CveClasificacion)) {
var anio = ToDouble(args.Value); var anio = ToDouble(args.Value);
if (anio > 0) { if (anio > 0) {
var valido = true; var valido = true;
if (anio < 1900) { if (anio <= 1900 || anio > anioActual) {
valido = false; valido = false;
} }
if (anio.toString().length != 4) { if (anio.toString().length != 4) {
@@ -3363,18 +3351,33 @@
//MARCA OPTIMA //MARCA OPTIMA
if (CveMarca == "1086") { if (CveMarca == "1086") {
let regex = new RegExp("^[0-9]+$"); //SI NO ES REQUERIDO, PONER COMO VALIDO
arguments.IsValid = regex.test(arguments.Value); if (!arguments.Value) {
arguments.IsValid = true;
} else {
let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value);
}
return; return;
//MARCA MOTOBATERIAS //MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") { } else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$"); //EN MOTOBATERIAS ES REQUERIDO
arguments.IsValid = regex.test(arguments.Value); 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; return;
//AUTOMOTRIZ-ACUMULADORES //AUTOMOTRIZ-ACUMULADORES
} else { } else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$"); //SI NO ES REQUERIDO, PONER COMO VALIDO
arguments.IsValid = regex.test(arguments.Value); 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; return;
} }
} }
@@ -3540,13 +3543,13 @@
var Descuento = parseFloat($get("TxtPorDescP").value); var Descuento = parseFloat($get("TxtPorDescP").value);
var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value); var PorcentajeDescuentoMaximo = parseFloat($get("HdnPorcentajeDescuentoMaximo").value);
if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) { if (PorcentajeDescuentoMaximo > 0 && Descuento > PorcentajeDescuentoMaximo) {
$get("TxtDescP").value = "0"; $get("TxtDescP").value = "0";
$get("TxtPorDescP").value = "0"; $get("TxtPorDescP").value = "0";
Descuento = 0; Descuento = 0;
alert("No puede exceder el descuento maximo autorizado."); alert("No puede exceder el descuento maximo autorizado.");
} }
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
@@ -3558,7 +3561,7 @@
if (TipoDescuento == 2) { if (TipoDescuento == 2) {
$get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ','); $get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ',');
} }
} }
else { else {
$get("LblPrecioFinal").innerText = "0.00"; $get("LblPrecioFinal").innerText = "0.00";
@@ -3605,10 +3608,10 @@
$get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ',');
$get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 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, '.', ','); $get("LblDescuentoAdicional").innerText = formato_numero(Total, 2, '.', ',');
//SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL //SUMA EL DESCUENTO YA EXISTENTE AL ORIGINAL
Total = Total + MontoOriginal; Total = Total + MontoOriginal;
@@ -3752,8 +3755,7 @@
$("#LblSubTotal1").text($("#TxtSubTotal").val()); $("#LblSubTotal1").text($("#TxtSubTotal").val());
} }
function AbrirModalDescuentoAdicional() function AbrirModalDescuentoAdicional() {
{
$('#ModalDescuento').modal(); $('#ModalDescuento').modal();
$get('LblTitulo1').style.display = ''; $get('LblTitulo1').style.display = '';
$get('LblTitulo2').style.display = 'none'; $get('LblTitulo2').style.display = 'none';
@@ -3974,215 +3976,215 @@
var ValorTxt = Obj.value; var ValorTxt = Obj.value;
var suma = 0; var suma = 0;
var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', '')); var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) { $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val()) var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 } if (isNaN(currentsaldo)) { currentsaldo = 0 }
suma = currentsaldo + suma; suma = currentsaldo + suma;
}); });
var txtvalue = (total - suma) + parseFloat(ValorTxt); var txtvalue = (total - suma) + parseFloat(ValorTxt);
if (txtvalue < 0) { txtvalue = 0; } if (txtvalue < 0) { txtvalue = 0; }
if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); } if (txtvalue < Monto) { Monto = txtvalue.toFixed(2); }
if (isNaN(ValorTxt)) if (isNaN(ValorTxt))
ValorTxt = 0; ValorTxt = 0;
if (isNaN(Monto)) if (isNaN(Monto))
Monto = 0; Monto = 0;
if (parseFloat(ValorTxt) < 0) { if (parseFloat(ValorTxt) < 0) {
ValorTxt = 0; ValorTxt = 0;
Obj.value = 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;
} }
function ValidarCantidad(t, c) { if (parseFloat(ValorTxt) > parseFloat(Monto)) {
if (t.value > c) { alert("El monto de ''Anticipo a Amortizar'' no puede ser mayor al monto del ''Anticipo''");
Obj.value = Monto;
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) { // else {
if (e.keyCode == 13 || e.which == 13) { // if (parseFloat(Obj.value) > parseFloat($get("HdnAnticipos").value))
$('#BtnCodigoBarrasSerie').click(); // $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 ValidarCantidad(t, c) {
function SeriePS(e, b, txt, hdn) { if (t.value > c) {
debugger;
if (e.keyCode == 13 || e.which == 13) {
if (txt.value != "" && txt.value != hdn.value) {
$(b).click();
}
}
}
function SeriePSBlur(b, txt, hdn) { t.value = c;
debugger; }
}
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) { if (txt.value != "" && txt.value != hdn.value) {
$(b).click(); $(b).click();
} }
} }
}
//SERIE-LOTE INV function SeriePSBlur(b, txt, hdn) {
var H1 = ""; debugger;
var H2 = ""; if (txt.value != "" && txt.value != hdn.value) {
var T = ""; $(b).click();
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 AFBlurEdit(Txt, Hdn1, Hdn2) { //SERIE-LOTE INV
if (Txt.value.length > 0 && Txt.value != Hdn2.value) { var H1 = "";
H1 = Hdn1; var H2 = "";
H2 = Hdn2; var T = "";
T = Txt;
$get("HdnCodAFEdit").value = Txt.value; function EnterAFEdit(event, Txt, Hdn1, Hdn2) {
$('#BtnVinculaAFEdit').click(); if (event.which == 13 || event.keyCode == 13) {
} H1 = Hdn1;
H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
} }
}
function EnterAFEditOK(Cve, Codigo) { function AFBlurEdit(Txt, Hdn1, Hdn2) {
$get(H1.id).value = Cve; if (Txt.value.length > 0 && Txt.value != Hdn2.value) {
$get(H2.id).value = Codigo; H1 = Hdn1;
$get(T.id).value = (Codigo == -1) ? "" : Codigo; H2 = Hdn2;
T = Txt;
$get("HdnCodAFEdit").value = Txt.value;
$('#BtnVinculaAFEdit').click();
} }
}
//Suma Totales function EnterAFEditOK(Cve, Codigo) {
function FnSuma() { $get(H1.id).value = Cve;
debugger; $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 () { //Suma Totales
totalVenta -= ToDouble($(this).val().toString()); 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)); $('#TxtTotal').attr('value', FormatoNumero(totalVenta, 2));
$get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2); $get('HdnTotalVenta').value = FormatoNumero(totalVenta, 2);
} }
function chkAnt(t, txt, importe) { function chkAnt(t, txt, importe) {
debugger; debugger;
$get("HdnTipoDescuento").value = "3"; $get("HdnTipoDescuento").value = "3";
var Total = ToDouble($get('TxtTotal').value); 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 > 0) {
if (SaldoCompra > importe) { if (SaldoCompra > importe) {
txt.value = importe.toFixed(2); txt.value = importe.toFixed(2);
SaldoCompra = SaldoCompra - importe; SaldoCompra = SaldoCompra - importe;
$get('HdnVentaSaldo').value = SaldoCompra; $get('HdnVentaSaldo').value = SaldoCompra;
} else {
txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
}
} else { } else {
t.checked = false; txt.value = SaldoCompra.toFixed(2);
SaldoCompra = 0.00;
$get('HdnVentaSaldo').value = SaldoCompra;
} }
} else { } else {
t.checked = false;
$get('HdnVentaSaldo').value = parseFloat(SaldoCompra) + parseFloat(txt.value);
txt.value = "";
} }
$("#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) { function FnCambiaAnt(chk, txt, saldo) {
chk.checked = true;
} else {
chk.checked = false;
}
if (ToDouble(txt.value) > saldo) { var Total = ToDouble($get('TxtTotal').value);
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo"); 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;
debugger; //minimo entre saldocompra y el saldoanticipo
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); if (SaldoCompra < saldo) saldo = SaldoCompra;
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
} }
function FnSumaValoresAnt() { if (ToDouble(txt.value) > saldo) {
var totalPoints = 0; txt.value = saldo;
var t = ''; alert("El Importe no debe de exceder a el saldo");
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
} }
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(''); $('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val(''); $('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val(''); $('#<%= TxtNumIntCliente.ClientID %>').val('');

View File

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

View File

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

View File

@@ -493,7 +493,7 @@
<table> <table>
<asp:CheckBox ID="ChkDireccionEnvio" runat="server" AutoPostBack="true" /> <asp:CheckBox ID="ChkDireccionEnvio" runat="server" AutoPostBack="true" />
<span style="margin-left: 1px;"> <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:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</span> </span>
@@ -2219,7 +2219,7 @@
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UPComplementosSAT" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPComplementosSAT" runat="server" UpdateMode="Conditional">
<ContentTemplate> <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"> <tr valign="top">
<td rowspan="2" colspan="1"> <td rowspan="2" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;"> <div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
@@ -2445,148 +2445,150 @@
</div> </div>
</td> </td>
<td rowspan="1" colspan="2"> <td rowspan="1" colspan="2">
<div class="portlet light xspadding bordered whitoutcol" style="width: 850px;"> <div class="row">
<div class="portlet-title"> <div class="col-md-7">
<div class="caption font-green"> <div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
<i class="icon-pin font-green"></i> <div class="portlet-title">
<span class="caption-subject bold uppercase">COMERCIO EXTERIOR</span> <div class="caption font-green">
</div> <i class="icon-pin font-green"></i>
<div class="actions"> <span class="caption-subject bold uppercase">COMERCIO EXTERIOR</span>
<div class="btn-group"> </div>
</div> <div class="actions">
</div> <div class="btn-group">
<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> </div>
<div class="row">
<div class="col-md-12"> <div class="tools">
Convertir a unidad Aduana <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: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" <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"> EmptyDataText="No hay datos disponibles" DataKeyNames="Cantidad,Codigo,ClaveSATFraccionArancelaria,ClaveSATUnidadAduana" OnRowDataBound="GvComercioExterior_RowDataBound">
<Columns> <Columns>
<asp:TemplateField HeaderText="Cantidad"> <asp:TemplateField HeaderText="Cantidad">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox> <asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:#,##0.##}") %>' Width="50px"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" /> <asp:BoundField DataField="CodigoPS" HeaderText="Producto ó Servicio" />
<asp:TemplateField HeaderText="Valor Unitario"> <asp:TemplateField HeaderText="Valor Unitario">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox> <asp:TextBox ID="TxtValorUnitario" runat="server" Text='<%# Eval("PU", "{0:N2}") %>' Width="60px"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" /> <asp:BoundField DataField="ClaveSATFraccionArancelariaDescripcion" HeaderText="Fracción Arancelaria" />
<asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" /> <asp:BoundField DataField="ClaveSATUnidadAduanaDescripcion" HeaderText="Unidad Aduana" />
<%-- <asp:TemplateField HeaderText="Unidad Aduana"> <%-- <asp:TemplateField HeaderText="Unidad Aduana">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList ID="DdlUnidadAduana" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="ClaveSATUnidadAduanaDescripcion" DataValueField="CveUnidadAduana"></asp:DropDownList> <asp:DropDownList ID="DdlUnidadAduana" runat="server" AppendDataBoundItems="true" CssClass="select2me" DataTextField="ClaveSATUnidadAduanaDescripcion" DataValueField="CveUnidadAduana"></asp:DropDownList>
</ItemTemplate> </ItemTemplate>
@@ -2596,22 +2598,143 @@
<ADS:Dropdownlost ID="DdlFraccionArancelaria" runat="server" CssClassDdl="selecthidden" CssStyle="width: 100%;" DataTextField="ClaveSATFraccionArancelariaDescripcion" DataValueField="CveFraccionArancelaria"></ADS:Dropdownlost> <ADS:Dropdownlost ID="DdlFraccionArancelaria" runat="server" CssClassDdl="selecthidden" CssStyle="width: 100%;" DataTextField="ClaveSATFraccionArancelariaDescripcion" DataValueField="CveFraccionArancelaria"></ADS:Dropdownlost>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField>--%> </asp:TemplateField>--%>
<asp:TemplateField HeaderText="Total USD"> <asp:TemplateField HeaderText="Total USD">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label> <asp:Label ID="LblTotalUSD" Text='<%# (CDbl(Eval("Cantidad").ToString) * CDbl(Eval("PU").ToString)).ToString("N2") %>' runat="server"></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Marca"> <asp:TemplateField HeaderText="Marca">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox> <asp:TextBox ID="TxtMarca" runat="server" Text="" Width="70px"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </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>
</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>
</div> </div>
</td> </td>
@@ -4362,7 +4485,7 @@
<td colspan="1">&nbsp;</td> <td colspan="1">&nbsp;</td>
</tr> </tr>
</table> </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> </asp:Panel>
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog"> <div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
@@ -4624,7 +4747,7 @@
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <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: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> <asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" ID="TareaNueva" /> <UserControl:TareaNueva runat="server" ID="TareaNueva" />
@@ -6510,7 +6633,7 @@
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label> <asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" /> <asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
</div> </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" /> <asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
</div> </div>
</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> <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> <ajax:ValidatorCalloutExtender ID="VCENCPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RVNCPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row" style="margin-right: 10px; margin-top: 5px;" align="right"> <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;" /> <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> <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>
<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"> <div class="col-md-12" style="height: 440px; overflow: auto">
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound" <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"> DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -7274,10 +7397,7 @@
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;"> <div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
<asp:UpdatePanel ID="UpAgregarCliente" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAgregarCliente" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<fieldset>
<%--<legend><b>Descripción</b></legend>--%>
<table border="0" class="portlet light bordered">
<tr>
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="fa fa-users font-green"></i> <i class="fa fa-users font-green"></i>
@@ -7288,8 +7408,16 @@
</div> </div>
</div> </div>
</div> </div>
</tr>
<tr>
<div class="modal-body">
<div class="row" style="padding-left: 16px;"> <div class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-9"> <div class="form-group form-md-line-input input-iconright col-xs-9">
<asp:TextBox ID="TxtRFCCliente" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtRFCCliente" Style="text-transform: uppercase;" placeholder="Ingrese el RFC para su validación" runat="server" CssClass="form-control" MaxLength="13" CausesValidation="true"></asp:TextBox>
@@ -7300,11 +7428,50 @@
<asp:Button ID="BtnValidarRFC" runat="server" CssClass="btn btn-success" Text="Validar" /> <asp:Button ID="BtnValidarRFC" runat="server" CssClass="btn btn-success" Text="Validar" />
</div> </div>
</div> </div>
<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<div class="row">
<div class="col-md-12">
<div runat="server" id="DivTipoPersona" visible="false" class="form-group form-md-line-input input-iconright">
<asp:RadioButtonList runat="server" ID="RdTipoPersona" RepeatDirection="Horizontal" OnSelectedIndexChanged="RdTipoPersona_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control">
<asp:ListItem Value="0">Física</asp:ListItem>
<asp:ListItem Value="1">Moral</asp:ListItem>
</asp:RadioButtonList>
<label for="<%= RdTipoPersona.ClientID.ToString()%>">Tipo Persona:</label>
<i></i>
</div>
</div>
</div>
<%--<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="150" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="150" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label> <label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label>
</div>--%>
<div class="row">
<div class="col-md-12" runat="server" id="DivRazonSocial2">
<div id="DivNombreCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombreCliente" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreCliente" runat="server" ControlToValidate="TxtNombreCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= TxtNombreCliente.ClientID.ToString()%>">Razón Social:</label>
</div>
</div>
<div class="col-md-4" id="DVRegimenSociedad" runat="server" visible="false">
<div runat="server" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRegimenSociedad" CssClass="form-control " runat="server" MaxLength="50" onkeyup="fncTxt()" ClientIDMode="Static"></asp:TextBox>
<label for="<%= TxtRegimenSociedad.ClientID.ToString()%>">Regimen Sociedad:</label>
<i></i>
</div>
</div>
</div> </div>
<div id="DivDireccionCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright"> <div id="DivDireccionCliente" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDireccionCliente" CssClass="form-control " runat="server" MaxLength="90" CausesValidation="true"></asp:TextBox> <asp:TextBox ID="TxtDireccionCliente" CssClass="form-control " runat="server" MaxLength="90" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDireccionC" runat="server" ControlToValidate="TxtDireccionCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVDireccionC" runat="server" ControlToValidate="TxtDireccionCliente" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Direccion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
@@ -7398,12 +7565,13 @@
<label for="<%= DdlFormaCliente.ClientID.ToString()%>">Forma Pago: </label> <label for="<%= DdlFormaCliente.ClientID.ToString()%>">Forma Pago: </label>
<i></i> <i></i>
</div> </div>
</div> </div>
</div>
</tr>
</table>
</fieldset>
<div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer"> <div id="DivBotonesAgregarCliente" runat="server" visible="false" class="modal-footer">
<asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" /> <asp:Button ID="BtnAgregarCliente" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCliente" />
<button id="BtnCancelarCliente" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button> <button id="BtnCancelarCliente" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
@@ -7845,6 +8013,20 @@
<ajax:ValidatorCalloutExtender ID="VCEImporteSolicitud" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteSolcitud" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEImporteSolicitud" runat="server" HighlightCssClass="vco" TargetControlID="CVImporteSolcitud" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtImporteSolicitud.ClientID.ToString()%>">Importe:</label> <label for="<%= TxtImporteSolicitud.ClientID.ToString()%>">Importe:</label>
</div> </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>
<div class="modal-footer"> <div class="modal-footer">
<asp:Button ID="BtnSolicitarCredito" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardarAut" /> <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 ViewState("ListaAnticiposAplicados") = value
End Set End Set
End Property 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 #End Region
#Region "Propiedades PuntoVenta" #Region "Propiedades PuntoVenta"
@@ -2272,6 +2281,9 @@ Partial Class Ventas
UpFacturar.Update() UpFacturar.Update()
'CargaTiposDocumentos() 'CargaTiposDocumentos()
TrEmitir.Visible = False TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 Then
DivCartaPorte.Visible = True
End If
ViewState("EstablecioFolio") = False ViewState("EstablecioFolio") = False
'ViewState("SubProyectoPorcentajeIVA") = 0 'ViewState("SubProyectoPorcentajeIVA") = 0
RefacturacionGeneroNC = False RefacturacionGeneroNC = False
@@ -2448,7 +2460,7 @@ Partial Class Ventas
CargaCuentasTerminal() CargaCuentasTerminal()
CargaDdlNCPS() CargaDdlNCPS()
CargarCamiones()
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante 'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then
@@ -2643,6 +2655,9 @@ Partial Class Ventas
ObjInventario.Dispose() ObjInventario.Dispose()
End If End If
If DdlTipoComprobante.SelectedValue = "Ing" Then
CargaVentaCortePorte(Me.CveVenta)
End If
End If End If
Else Else
@@ -4888,6 +4903,7 @@ Partial Class Ventas
If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then
ChkDireccionEnvio.Checked = True ChkDireccionEnvio.Checked = True
DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero()) DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero())
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
DdlDireccionEnvio.Enabled = False DdlDireccionEnvio.Enabled = False
ChkDireccionEnvio.Enabled = False ChkDireccionEnvio.Enabled = False
DdlDireccionEnvio.Visible = True DdlDireccionEnvio.Visible = True
@@ -6014,6 +6030,7 @@ Partial Class Ventas
End If End If
End If End If
CargaDireccionCP()
ViewState("Vendedor") = ObjCliente.Vendedor ViewState("Vendedor") = ObjCliente.Vendedor
ViewState("CtaContable") = ObjCliente.CuentaContable ViewState("CtaContable") = ObjCliente.CuentaContable
@@ -7088,6 +7105,8 @@ Partial Class Ventas
CargaVendedores() CargaVendedores()
CargaDireccionCP()
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES 'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
If CveVenta <= 0 Then If CveVenta <= 0 Then
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva() 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() UpEstatus.Update()
UPCondicionesPago.Update() UPCondicionesPago.Update()
UpCliente.Update() UpCliente.Update()
UpEmitirTransitorio.Update()
End Sub End Sub
Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal
Dim Retorno As Decimal = 0 Dim Retorno As Decimal = 0
@@ -7594,7 +7614,7 @@ Partial Class Ventas
End If End If
'VERIFICA SI EL DESCUENTO SUPERA EL SUBTOTAL '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) Alert("El descuento no puede ser mayor al subtotal", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -8158,6 +8178,17 @@ Partial Class Ventas
End If End If
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 'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then
DdlTipoComprobante.SelectedValue = "Ing" DdlTipoComprobante.SelectedValue = "Ing"
@@ -8300,6 +8331,7 @@ Partial Class Ventas
End If End If
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. '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 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 'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
@@ -8335,6 +8367,20 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
ObjVentas.Dispose() 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
'End If 'End If
@@ -8778,9 +8824,18 @@ Partial Class Ventas
Dim CveVentaAnterior As Integer = Me.CveVenta Dim CveVentaAnterior As Integer = Me.CveVenta
Dim CveTimbreCartaPorte As Integer = -1
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre) 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 '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 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 Dim CveVentaDetalle As Integer = 0
@@ -9162,14 +9217,27 @@ Partial Class Ventas
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado) PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
End If 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 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 FolioFiscalFactura As String = ObjTimbrado.UUID
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
ObjTimbrado = Nothing ObjTimbrado = Nothing
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION '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 Try
For Each NCGenerada In ListaNotasCreditoGeneradas For Each NCGenerada In ListaNotasCreditoGeneradas
If NCGenerada.Timbre IsNot Nothing Then If NCGenerada.Timbre IsNot Nothing Then
@@ -12040,16 +12108,20 @@ Partial Class Ventas
End If End If
End If End If
If ObjFactura.TipoDocto = "Ing" Then 'SI ES REFACTURACION, NO DEBE AFECTAR LOS USADOS
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then If Not NuevaFactura.Contiene(1) Then
ErrorList.Add("Error al guardar usados") If ObjFactura.TipoDocto = "Ing" Then
End If If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
ElseIf ObjFactura.TipoDocto = "Dev" Then ErrorList.Add("Error al guardar usados")
If Not GuardarUsados(1, ObjVentas.IniciaTransacSQL, factura) Then End If
ErrorList.Add("Error al guardar usados") 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
End If End If
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
If DtVentasNC Is Nothing Then If DtVentasNC Is Nothing Then
InicializaDTVentasNC() InicializaDTVentasNC()
@@ -12372,7 +12444,7 @@ Partial Class Ventas
'INVENTARIOS 'INVENTARIOS
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
If Not EsNCAmortizacion AndAlso Not NCDescuento 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") ErrorList.Add("Ocurrio un error al Guardar Inventario")
End If End If
End If End If
@@ -14026,7 +14098,7 @@ Partial Class Ventas
End Try End Try
End Function 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 Dim OcurrioError As Boolean = False
Try Try
@@ -14035,7 +14107,7 @@ Partial Class Ventas
If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
For Each CveRemision As Integer In RemisionesLista For Each CveRemision As Integer In RemisionesLista
'El almacen general es el Primer Almacen de Material en la Sucursal '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 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") 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 Exit For
@@ -16004,6 +16076,14 @@ Partial Class Ventas
Dim TmpDTComplementosTimbrado As New DataTable Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado) 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 If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
'MENSAJE PRINCIPAL 'MENSAJE PRINCIPAL
@@ -17092,6 +17172,7 @@ Partial Class Ventas
CargaVendedores() CargaVendedores()
UpDetalle.Update() UpDetalle.Update()
UpEmitirTransitorio.Update()
End Sub End Sub
Private Sub CambiaSucursal(Optional RecargarPartidas As Boolean = True) Private Sub CambiaSucursal(Optional RecargarPartidas As Boolean = True)
CargaFormatoSucursal() CargaFormatoSucursal()
@@ -17103,6 +17184,8 @@ Partial Class Ventas
RecargaSucursalPartidas() RecargaSucursalPartidas()
End If End If
CargaDireccionSucursalOrigen(GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(""))
DdlPS.Attributes.Remove("data-cvesubproyecto") DdlPS.Attributes.Remove("data-cvesubproyecto")
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue) DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
@@ -19579,7 +19662,7 @@ Partial Class Ventas
gvr.FCDropDownList("DdlUnidadMedida").DataBind() gvr.FCDropDownList("DdlUnidadMedida").DataBind()
End Sub 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 Dim OcurrioError As Boolean = False
Try Try
Dim DtMovimientos As DataTable Dim DtMovimientos As DataTable
@@ -19715,7 +19798,7 @@ Partial Class Ventas
End If End If
If Not OcurrioError AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" Then 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
End If End If
@@ -20131,7 +20214,7 @@ Partial Class Ventas
Return Not OcurrioError Return Not OcurrioError
End Function 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 Dim OcurrioError As Boolean = False
Try Try
@@ -20162,7 +20245,13 @@ Partial Class Ventas
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() 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 OcurrioError = True
Exit For Exit For
End If End If
@@ -21054,6 +21143,10 @@ Partial Class Ventas
TxtCodigo.ReadOnly = False TxtCodigo.ReadOnly = False
End If End If
If CantidadFacturadaRemision = 0 AndAlso UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = True
End If
TxtCantidad.Enabled = True TxtCantidad.Enabled = True
DdlClasificacion.Enabled = True DdlClasificacion.Enabled = True
DdlPS.Enabled = True DdlPS.Enabled = True
@@ -21067,6 +21160,8 @@ Partial Class Ventas
LblSubTotal1.Text = TxtSubTotal.Text LblSubTotal1.Text = TxtSubTotal.Text
LblAmort.Text = TxtSubTotal.Text LblAmort.Text = TxtSubTotal.Text
LimpiaEscondeContado() LimpiaEscondeContado()
UPPVentas.Update()
UpPS.Update() UpPS.Update()
UpCliente.Update() UpCliente.Update()
UPObservaciones.Update() UPObservaciones.Update()
@@ -21164,7 +21259,7 @@ Partial Class Ventas
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, 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 OcurrioError = True
End If End If
@@ -21616,7 +21711,7 @@ Partial Class Ventas
LimpiaProntoPago() LimpiaProntoPago()
'NO PERMITE EDITAR FECHA DEL PAGO '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 TxtFechaPago.Enabled = False
imgCalendario.Visible = False imgCalendario.Visible = False
End If End If
@@ -22238,7 +22333,9 @@ Partial Class Ventas
Private Sub LnkAgregarCliente_Click(sender As Object, e As EventArgs) Handles LnkAgregarCliente.Click Private Sub LnkAgregarCliente_Click(sender As Object, e As EventArgs) Handles LnkAgregarCliente.Click
DivNombreCliente.Visible = False DivNombreCliente.Visible = False
DivTipoPersona.Visible = False
DivDireccionCliente.Visible = False DivDireccionCliente.Visible = False
DivNumeroCPCliente.Visible = False DivNumeroCPCliente.Visible = False
DivColoniaTelefonoCliente.Visible = False DivColoniaTelefonoCliente.Visible = False
DivCiudadLocalidadCliente.Visible = False DivCiudadLocalidadCliente.Visible = False
@@ -22256,6 +22353,7 @@ Partial Class Ventas
If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then
DivNombreCliente.Visible = True DivNombreCliente.Visible = True
DivTipoPersona.Visible = True
DivDireccionCliente.Visible = True DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True DivNumeroCPCliente.Visible = True
DivColoniaTelefonoCliente.Visible = True DivColoniaTelefonoCliente.Visible = True
@@ -22285,6 +22383,7 @@ Partial Class Ventas
UpCliente.Update() UpCliente.Update()
Else Else
DivNombreCliente.Visible = True DivNombreCliente.Visible = True
DivTipoPersona.Visible = True
DivDireccionCliente.Visible = True DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True DivNumeroCPCliente.Visible = True
DivColoniaTelefonoCliente.Visible = True DivColoniaTelefonoCliente.Visible = True
@@ -22324,10 +22423,14 @@ Partial Class Ventas
Dim ObjCliente As New ClsClientes Dim ObjCliente As New ClsClientes
Dim TipoPersona As Boolean = If(RdTipoPersona.SelectedValue.ToEntero = 1, True, False)
If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim, If ObjCliente.AgregarClienteNoFrecuente(TxtNombreCliente.Text.Trim, TxtDireccionCliente.Text.Trim, TxtNumExtCliente.Text.Trim, TxtNumIntCliente.Text.Trim,
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero, TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero,
TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim, TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista) Then DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista,
RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then If ObjCliente.DtResultados.Rows.Count > 0 Then
RegistraScript("hideDivEC();") RegistraScript("hideDivEC();")
ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString().ToEntero() ViewState("CveCliente") = ObjCliente.DtResultados(0)("CveCliente").ToString().ToEntero()
@@ -22461,11 +22564,6 @@ Partial Class Ventas
#Region " DEVOLUCION ALMACEN " #Region " DEVOLUCION ALMACEN "
Private Sub InicializaDevolucionAlmacen() Private Sub InicializaDevolucionAlmacen()
If CveVenta.Contiene(2035312, 2035310, 2039679) Then
LBAplicaDevolucion.Visible = True
End If
If Not GvInv.Rows.Count > 0 Then If Not GvInv.Rows.Count > 0 Then
Exit Sub Exit Sub
End If End If
@@ -22563,9 +22661,15 @@ Partial Class Ventas
If ChkDireccionEnvio.Checked Then If ChkDireccionEnvio.Checked Then
DdlDireccionEnvio.Visible = True DdlDireccionEnvio.Visible = True
LnkOtraDireccion.Visible = True LnkOtraDireccion.Visible = True
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
Else Else
DdlDireccionEnvio.Visible = False DdlDireccionEnvio.Visible = False
LnkOtraDireccion.Visible = False LnkOtraDireccion.Visible = False
If SucursalDestinoCP IsNot Nothing Then
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
TxtDestinoCP.Text = ""
End If
End If End If
End Sub End Sub
Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click
@@ -22604,6 +22708,7 @@ Partial Class Ventas
TxtEnvioTel.Text = "" TxtEnvioTel.Text = ""
CargaDireccionesEnvio() CargaDireccionesEnvio()
DdlDireccionEnvio.SelectedValueExist(CveDireccionEnvio) DdlDireccionEnvio.SelectedValueExist(CveDireccionEnvio)
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
End If End If
ObjClientes.Dispose() ObjClientes.Dispose()
@@ -23831,6 +23936,10 @@ Partial Class Ventas
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion 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) resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
End If End If
@@ -33741,8 +33850,10 @@ Partial Class Ventas
DiasVencidos = TxtDiasVencidos.Text.ToEntero() DiasVencidos = TxtDiasVencidos.Text.ToEntero()
End If End If
Dim Motivo As String = TxtMotivoAutorizacion.Text
Dim ObjPS As New ClsVentas 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')") RegistraScript("$('#DivModalSolicitarCredito').modal('hide')")
Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion) Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion)
End If End If
@@ -33773,10 +33884,12 @@ Partial Class Ventas
Case "Ing" Case "Ing"
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2")) DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
DivMotivoAutorizacion.Visible = True
End If End If
Case "Egs" Case "Egs"
'QUITAR LA DE VENCIMIENTO 'QUITAR LA DE VENCIMIENTO
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2")) DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
DivMotivoAutorizacion.Visible = True
End Select End Select
UpModalSolicitud.Update() UpModalSolicitud.Update()
End Sub End Sub
@@ -33832,5 +33945,430 @@ Partial Class Ventas
End If End If
End Sub End Sub
Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs)
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
End If
UpAgregarCliente.Update()
End Sub
#Region "C A R T A - P O R T E"
Public Sub CargaDireccionCP()
LblDireccion.Text = "Dirección"
LblColonia.Text = "Colonia"
LblCiudad.Text = "Ciudad"
LblEstado.Text = "Estado"
LblCP.Text = "00000"
End Sub
Public Sub CargarCamiones()
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
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
Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs)
DVRegimenSociedad.Visible = False
DivRazonSocial2.Attributes.Add("class", "col-md-12")
If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
End If
UpAgregarCliente.Update()
End Sub
End Class End Class

View File

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

View File

@@ -460,6 +460,10 @@