This commit is contained in:
HECTOR RODRIGUEZ
2021-04-15 10:16:42 -07:00
18 changed files with 2401 additions and 1125 deletions

View File

@@ -1680,6 +1680,63 @@ Public Class ClsClientes
Return Retorno
End Function
Public Function UpdateClienteNoFrencuente(CveCliente As Integer, Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer,
RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer,
NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ClientesNoFrecuenteUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@Nombre", SqlDbType.VarChar).Value = Nombre
.Add("@Direccion", SqlDbType.VarChar).Value = Direccion
.Add("@NoExt", SqlDbType.VarChar).Value = NoExt
.Add("@NoInt", SqlDbType.VarChar).Value = NoInt
.Add("@Colonia", SqlDbType.VarChar).Value = Colonia
.Add("@Localidad", SqlDbType.VarChar).Value = Localidad
.Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
.Add("@CveEstado", SqlDbType.Int).Value = CveEstado
' .Add("@Pais", SqlDbType.VarChar).Value = Pais
.Add("@RFC", SqlDbType.VarChar).Value = RFC
.Add("@CP", SqlDbType.VarChar).Value = CP
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Mail", SqlDbType.VarChar).Value = Mail
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMetodoPago33", SqlDbType.Int).Value = CveMetodoPago33
.Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33
.Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("El Nuevo Cliente no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("Número: 2601;") Then
If Ex1.Message.Contains("UN_ClientesRFCEmpresa") Then
Alert("Ya existe un cliente registrado con el mismo RFC.", TipoMensaje.MsgAdvertencia)
End If
If Ex1.Message.Contains("IND_Clientes_Codigo") Then
Alert("Ya existe un cliente registrado con el mismo Código.", TipoMensaje.MsgAdvertencia)
End If
Else
Me.OnError("Ocurrió un error al Intentar guardar el Nuevo Cliente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar el cliente", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region "UNIFICAR CLIENTES"
Public Function UnificarClientes(CveClienteAUnificar As Integer, CveClienteOriginal As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -357,7 +357,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -418,7 +418,7 @@ Public Class ClsSisNotificaciones
End If
If Archivos.Count > 0 Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", $"Se adjunta el {Formato} en el Reporte Programado.", "", Archivos) Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", $"Se adjunta el {Formato} en el Reporte Programado.", "", Archivos) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -467,7 +467,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -509,7 +509,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -557,7 +557,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -596,7 +596,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -635,7 +635,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If

View File

@@ -580,6 +580,14 @@ Namespace Modelos
Me.DtRemisionesDocumentosRelacionados = ObjVentas.DtResultados.Copy()
End If
'CARGA LOS IMPUESTOS LOCALES
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DtImpuestosLocales = ObjVentas.DtResultados.Copy()
End If
End If
ObjVentas.Dispose()
If Me.RealizarDevolucionAlmacen Then
@@ -1618,8 +1626,8 @@ Namespace Modelos
End If
'Impuestos Locales
If DtImpuestosLocales IsNot Nothing Then
For Each gvr As DataRow In DtImpuestosLocales.Rows
If factura.DtImpuestosLocales IsNot Nothing Then
For Each gvr As DataRow In factura.DtImpuestosLocales.Rows
If Not ObjVentas.AddVentaImpuestoLocales(factura.CveVenta, gvr("CveImpuestoLocal").ToString.ToEntero(), gvr("Importe").ToString().ToDouble()) Then
ErrorList.Add("Ocurrió un error al Guardar Impuestos Locales")
End If
@@ -1627,8 +1635,8 @@ Namespace Modelos
End If
If DtFirmas IsNot Nothing AndAlso DtFirmas.Rows.Count > 0 Then
For Each Row As DataRow In DtFirmas.Rows
If factura.DtFirmas IsNot Nothing AndAlso factura.DtFirmas.Rows.Count > 0 Then
For Each Row As DataRow In factura.DtFirmas.Rows
If Not ObjVentas.AddVentasFirmas(factura.CveVenta, Row("Titulo").ToString, Row("Nombre").ToString, Row("Puesto").ToString, Row("Lado").ToString.ToEntero) Then
ErrorList.Add("Ocurrio un error al Guardar Firmas")
End If
@@ -4828,8 +4836,10 @@ Namespace Modelos
If Not ErrorCancelar Then
Dim Filtro As String = ""
Select Case ObjFactura.TipoDocto
Case "Ing", "Ped", "Dev"
Case "Ing", "Ped"
Filtro = "CveConcepto IN (3, 40)"
Case "Dev"
Filtro = "CveConcepto = 18"
Case Else
Filtro = "CveConcepto = 9"
End Select
@@ -4860,19 +4870,22 @@ Namespace Modelos
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then
'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES
For Each RowMovimiento As DataRow In DtSalidas.Rows
Dim CveConceptoDevolucion As Integer = -1
Dim CveAlmacenDevolucion As Integer = -1
Dim CveConceptoMovimiento As Integer = -1
Dim CveAlmacenMovimiento As Integer = -1
Dim CveMovimientoDevolucion As Integer = 0
Dim Folio As Integer = 0
Select Case RowMovimiento("CveConcepto").ToString().ToEntero()
Case 3
CveConceptoDevolucion = 18 'DEVOLUCION DEL CLIENTE
CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 40
CveConceptoDevolucion = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 18
CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA
CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
''SI TIENE REMISIONES RELACIONADAS
'If DtRemisionesFacturadas.Rows.Count > 0 Then
' Dim RowRemision As DataRow = DtExistencias.FiltroPrimero($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}")
@@ -4896,12 +4909,20 @@ Namespace Modelos
'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION
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)
CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenDevolucion, CveConceptoDevolucion, 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, Modulo:="Mod/CV1")
Folio = ObjInventario.Folio
If CveMovimientoDevolucion > 0 Then
For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero) Then
Dim FechaCaducidad As Date = MinFecha
If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then
If IsDate(Dr("FechaCaducidad")) Then
FechaCaducidad = Dr("FechaCaducidad").ToString().ToDate()
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
@@ -4920,12 +4941,17 @@ Namespace Modelos
DtCostos = ObjInventario.DtResultados
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero
'Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
If tmpCostos.Rows.Count > 0 Then
Dim Multiplicador As Decimal = -1D
If ObjFactura.TipoDocto = "Dev" Then
Multiplicador = 1D
End If
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = Now
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
@@ -4950,7 +4976,7 @@ Namespace Modelos
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If Not ErrorCancelar Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, -1 * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, Multiplicador * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
ErrorCancelar = True
End If
End If
@@ -4958,7 +4984,7 @@ Namespace Modelos
cont += 1
Next
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * TotalCosto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, Multiplicador * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * TotalCosto) Then
ErrorCancelar = True
End If
@@ -4995,7 +5021,7 @@ Namespace Modelos
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
'SI ES DEVOLUCION DEL CLIENTE DEBE REGRESAR A ENTREGA POR ADELANTADO
If Not ErrorCancelar AndAlso CveConceptoDevolucion = 18 AndAlso RevivirRemisiones Then
If Not ErrorCancelar AndAlso CveConceptoMovimiento = 18 AndAlso RevivirRemisiones Then
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimientoDevolucion, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión"

View File

@@ -115,6 +115,45 @@ Public Class E141 : Implements IHttpHandler
End Get
End Property
Public Property GlobalDTPSSimplificado(Optional CveClasificacion As Integer = -1, Optional Codigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
End If
Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
Codigo = Codigo.ToUpper()
If Codigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!Codigo).ToUpper() = Codigo))
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
Try
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
Catch ex As Exception
GlobalDTPSSimplificado = New DataTable
End Try
Else
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
@@ -632,11 +671,14 @@ Public Class E141 : Implements IHttpHandler
Dim ObjClientes As New ClsClientes()
Dim ObjInventario As New ClsInventarios(ObjClientes.IniciaTransacSQL())
ObjClientes.IniciaTransacSQL()
Try
If Not String.IsNullOrEmpty(JsonRequest("timbrar").ToString) Then
DebeTimbrar = CBool(JsonRequest("timbrar"))
Dim timbrar_request As String = If(JsonRequest("timbrar") Is Nothing, "", JsonRequest("timbrar").ToString())
If Not String.IsNullOrEmpty(timbrar_request) Then
DebeTimbrar = CBool(timbrar_request)
Else
DebeTimbrar = False
End If
ObjFactura = CreaFactura(ObjInventario, ObjClientes, "Ing", Resp, JsonRequest, Usuario)
@@ -646,7 +688,7 @@ Public Class E141 : Implements IHttpHandler
If Resp.CveVenta > 0 Then
Respuesta.status = "success"
Respuesta.data = Resp.CveVenta.ToString()
Respuesta.data = Resp.SerieFolio
Else
TieneError = True
End If
@@ -674,9 +716,11 @@ Public Class E141 : Implements IHttpHandler
If TieneError Then
ObjClientes.RollBack()
ObjClientes.Dispose()
ObjInventario.Dispose()
Else
ObjClientes.Commit()
ObjClientes.Dispose()
ObjInventario.Dispose()
If DebeTimbrar Then
Dim SeTimbro As Boolean = ObjFactura.TimbrarFactura()
@@ -690,6 +734,10 @@ Public Class E141 : Implements IHttpHandler
End If
End If
If ObjFactura IsNot Nothing Then
ObjFactura.Dispose()
End If
Else
TieneError = True
RespuestaError.message = "No hay un usuario disponible"
@@ -708,26 +756,83 @@ Public Class E141 : Implements IHttpHandler
#Region "D E F I N I R - O B J E T O S"
Private Function CrearCliente(ObjClientes As ClsClientes, ByRef Resp As Modelos.Factura.MMensajeFactura, JsonRequest As JObject, UsuarioActual As Usuario) As Integer
Private Function CrearCliente(TipoDocto As String, ObjClientes As ClsClientes, ByRef Resp As Modelos.Factura.MMensajeFactura, JsonRequest As JObject, UsuarioActual As Usuario) As Integer
Dim CveCliente As Integer = -1
Dim CveSubProyecto As Integer = JsonRequest("branch_office_id").ToEntero()
Dim Nombre As String = If(JsonRequest("contact_name") Is Nothing, "", JsonRequest("contact_name").ToString())
Dim Direccion As String = If(JsonRequest("contact_address") Is Nothing, "", JsonRequest("contact_address").ToString())
Dim NumExt As String = If(JsonRequest("contact_ext_number") Is Nothing, "", JsonRequest("contact_ext_number").ToString())
Dim NumInt As String = If(JsonRequest("contact_int_number") Is Nothing, "", JsonRequest("contact_int_number").ToString())
Dim Colonia As String = If(JsonRequest("contact_neighborhood") Is Nothing, "", JsonRequest("contact_neighborhood").ToString())
Dim Localidad As String = If(JsonRequest("contact_city") Is Nothing, "", JsonRequest("contact_city").ToString())
Dim Ciudad As String = Localidad
Dim RFC As String = If(JsonRequest("invoice_rfc") Is Nothing, "XAXX010101000", JsonRequest("invoice_rfc").ToString())
Dim CP As String = If(JsonRequest("contact_zip_code") Is Nothing, "", JsonRequest("contact_zip_code").ToString())
Dim Telefono As String = If(JsonRequest("contact_phone") Is Nothing, "", JsonRequest("contact_phone").ToString())
Dim Correo As String = If(JsonRequest("contact_email") Is Nothing, "", JsonRequest("contact_email").ToString())
Dim Nombre As String = ""
Dim Direccion As String = ""
Dim NumExt As String = ""
Dim NumInt As String = ""
Dim Colonia As String = ""
Dim Localidad As String = ""
Dim Ciudad As String = ""
Dim Estado As String = ""
Dim RFC As String = ""
Dim CP As String = ""
Dim Telefono As String = ""
Dim Correo As String = ""
'DATOS DE CONTACTO
Dim contact_name As String = If(JsonRequest("contact_name") Is Nothing, "", JsonRequest("contact_name").ToString())
Dim contact_address As String = If(JsonRequest("contact_address") Is Nothing, "", JsonRequest("contact_address").ToString())
Dim contact_ext_number As String = If(JsonRequest("contact_ext_number") Is Nothing, "", JsonRequest("contact_ext_number").ToString())
Dim contact_int_number As String = If(JsonRequest("contact_int_number") Is Nothing, "", JsonRequest("contact_int_number").ToString())
Dim contact_neighborhood As String = If(JsonRequest("contact_neighborhood") Is Nothing, "", JsonRequest("contact_neighborhood").ToString())
Dim contact_city As String = If(JsonRequest("contact_city") Is Nothing, "", JsonRequest("contact_city").ToString())
Dim contact_zip_code As String = If(JsonRequest("contact_zip_code") Is Nothing, "", JsonRequest("contact_zip_code").ToString())
Dim contact_phone As String = If(JsonRequest("contact_phone") Is Nothing, "", JsonRequest("contact_phone").ToString())
Dim contact_email As String = If(JsonRequest("contact_email") Is Nothing, "", JsonRequest("contact_email").ToString())
Dim contact_state As String = If(JsonRequest("contact_state") Is Nothing, "", JsonRequest("contact_state").ToString())
'DATOS DE FACTURACION
Dim invoice_rfc As String = If(JsonRequest("invoice_rfc") Is Nothing, "", JsonRequest("invoice_rfc").ToString())
Dim invoice_name As String = If(JsonRequest("invoice_name") Is Nothing, "", JsonRequest("invoice_name").ToString())
Dim invoice_address As String = If(JsonRequest("invoice_address") Is Nothing, "", JsonRequest("invoice_address").ToString())
Dim invoice_city As String = If(JsonRequest("invoice_city") Is Nothing, "", JsonRequest("invoice_city").ToString())
Dim invoice_state As String = If(JsonRequest("invoice_state") Is Nothing, "", JsonRequest("invoice_state").ToString())
Dim invoice_email As String = If(JsonRequest("invoice_email") Is Nothing, "", JsonRequest("invoice_email").ToString())
Dim invoice_phone As String = If(JsonRequest("invoice_phone") Is Nothing, "", JsonRequest("invoice_phone").ToString())
Dim CveEstado As Integer = -1
If Not String.IsNullOrEmpty(JsonRequest("contact_state").ToString()) Then
CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{JsonRequest("contact_state").ToString().Trim}'").ToEntero()
If TipoDocto = "Ing" Then
RFC = If(Not String.IsNullOrEmpty(invoice_rfc), invoice_rfc, "XAXX010101000")
Nombre = If(Not String.IsNullOrEmpty(invoice_name), invoice_name, contact_name)
Direccion = If(Not String.IsNullOrEmpty(invoice_address), invoice_address, contact_address)
'SI LA DIRECCION ES LA MISMA QUE LA DE CONTACTO
If Direccion = contact_address Then
NumExt = If(Not String.IsNullOrEmpty(contact_ext_number), contact_ext_number, "")
NumInt = If(Not String.IsNullOrEmpty(contact_int_number), contact_int_number, "")
Colonia = If(Not String.IsNullOrEmpty(contact_neighborhood), contact_neighborhood, "")
End If
Ciudad = If(Not String.IsNullOrEmpty(invoice_city), invoice_city, contact_city)
Localidad = Ciudad
Estado = If(Not String.IsNullOrEmpty(invoice_state), invoice_state, contact_state)
CP = If(Not String.IsNullOrEmpty(contact_zip_code), contact_zip_code, "")
Correo = If(Not String.IsNullOrEmpty(invoice_email), invoice_email, contact_email)
Telefono = If(Not String.IsNullOrEmpty(invoice_phone), invoice_phone, contact_phone)
Else
Nombre = If(Not String.IsNullOrEmpty(contact_name), contact_name, "")
Direccion = If(Not String.IsNullOrEmpty(contact_address), contact_address, "")
NumExt = If(Not String.IsNullOrEmpty(contact_ext_number), contact_ext_number, "")
NumInt = If(Not String.IsNullOrEmpty(contact_int_number), contact_int_number, "")
Colonia = If(Not String.IsNullOrEmpty(contact_neighborhood), contact_neighborhood, "")
Ciudad = If(Not String.IsNullOrEmpty(contact_city), contact_city, "")
Localidad = Ciudad
Estado = If(Not String.IsNullOrEmpty(contact_state), contact_state, "")
CP = If(Not String.IsNullOrEmpty(contact_zip_code), contact_zip_code, "")
Correo = If(Not String.IsNullOrEmpty(contact_email), contact_email, "")
Telefono = If(Not String.IsNullOrEmpty(contact_phone), contact_phone, "")
End If
If Not String.IsNullOrEmpty(Estado) Then
CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
If CveEstado <= 0 Then
@@ -737,11 +842,18 @@ Public Class E141 : Implements IHttpHandler
CveEstado = 26
End If
'SI NO EXISTE EL RFC UTILIZA EL GENERICO
If String.IsNullOrEmpty(RFC) Then
RFC = "XAXX010101000"
End If
If String.IsNullOrEmpty(Nombre) Then
Resp.TieneError = False
Resp.Mensajes.Add("El cliente no tiene un nombre")
Return -1
End If
'VALIDAR QUE NO EXISTA EL RFC
If RFC <> "XAXX010101000" Then
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, UsuarioActual.CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then
@@ -774,11 +886,19 @@ Public Class E141 : Implements IHttpHandler
Resp.TieneError = False
Dim Serie As String = "-1"
Dim CveMoneda As Integer = 1
Dim CveSubProyecto As Integer = JsonRequest("branch_office_id").ToEntero()
If CveSubProyecto <= 0 Then
Resp.TieneError = False
Resp.Mensajes.Add("La sucursal es requerida")
Return Nothing
End If
Dim CveCliente As Integer = If(JsonRequest("user_id") Is Nothing, 0, JsonRequest("user_id").ToEntero())
If CveCliente <= 0 Then
CveCliente = CrearCliente(ObjClientes, Resp, JsonRequest, UsuarioActual)
CveCliente = CrearCliente(TipoDocto, ObjClientes, Resp, JsonRequest, UsuarioActual)
End If
If CveCliente <= 0 Then
@@ -854,19 +974,6 @@ Public Class E141 : Implements IHttpHandler
ElseIf ObjFactura.TipoDocto = "Ing" Then
If ObjFactura.Cliente IsNot Nothing AndAlso Not String.IsNullOrEmpty(JsonRequest("invoice_name").ToString()) Then
ObjFactura.Cliente.Nombre = JsonRequest("invoice_name").ToString()
ObjFactura.Cliente.NombreComercial = JsonRequest("invoice_name").ToString()
ObjFactura.Cliente.Direccion = JsonRequest("invoice_address").ToString()
ObjFactura.Cliente.Colonia = ""
ObjFactura.Cliente.NoInt = ""
ObjFactura.Cliente.NoExt = ""
ObjFactura.Cliente.Localidad = JsonRequest("invoice_city").ToString()
ObjFactura.Cliente.Estado = JsonRequest("invoice_state").ToString()
ObjFactura.Cliente.Mail = JsonRequest("invoice_email").ToString()
ObjFactura.Cliente.Telefono = JsonRequest("invoice_phone").ToString()
End If
'FORMA DE PAGO
If JsonRequest("invoice_way_to_pay") Is Nothing Then
Resp.TieneError = False
@@ -941,10 +1048,73 @@ Public Class E141 : Implements IHttpHandler
End If
If ObjFactura.Cliente IsNot Nothing AndAlso TipoDocto = "Ing" Then
'DATOS DE CONTACTO
Dim contact_name As String = If(JsonRequest("contact_name") Is Nothing, "", JsonRequest("contact_name").ToString())
Dim contact_address As String = If(JsonRequest("contact_address") Is Nothing, "", JsonRequest("contact_address").ToString())
Dim contact_ext_number As String = If(JsonRequest("contact_ext_number") Is Nothing, "", JsonRequest("contact_ext_number").ToString())
Dim contact_int_number As String = If(JsonRequest("contact_int_number") Is Nothing, "", JsonRequest("contact_int_number").ToString())
Dim contact_neighborhood As String = If(JsonRequest("contact_neighborhood") Is Nothing, "", JsonRequest("contact_neighborhood").ToString())
Dim contact_city As String = If(JsonRequest("contact_city") Is Nothing, "", JsonRequest("contact_city").ToString())
Dim contact_zip_code As String = If(JsonRequest("contact_zip_code") Is Nothing, "", JsonRequest("contact_zip_code").ToString())
Dim contact_phone As String = If(JsonRequest("contact_phone") Is Nothing, "", JsonRequest("contact_phone").ToString())
Dim contact_email As String = If(JsonRequest("contact_email") Is Nothing, "", JsonRequest("contact_email").ToString())
Dim contact_state As String = If(JsonRequest("contact_state") Is Nothing, "", JsonRequest("contact_state").ToString())
'DATOS DE FACTURACION
Dim invoice_rfc As String = If(JsonRequest("invoice_rfc") Is Nothing, "", JsonRequest("invoice_rfc").ToString())
Dim invoice_name As String = If(JsonRequest("invoice_name") Is Nothing, "", JsonRequest("invoice_name").ToString())
Dim invoice_address As String = If(JsonRequest("invoice_address") Is Nothing, "", JsonRequest("invoice_address").ToString())
Dim invoice_city As String = If(JsonRequest("invoice_city") Is Nothing, "", JsonRequest("invoice_city").ToString())
Dim invoice_state As String = If(JsonRequest("invoice_state") Is Nothing, "", JsonRequest("invoice_state").ToString())
Dim invoice_email As String = If(JsonRequest("invoice_email") Is Nothing, "", JsonRequest("invoice_email").ToString())
Dim invoice_phone As String = If(JsonRequest("invoice_phone") Is Nothing, "", JsonRequest("invoice_phone").ToString())
Dim CveEstado As Integer = -1
ObjFactura.Cliente.RFC = If(Not String.IsNullOrEmpty(invoice_rfc), invoice_rfc, ObjFactura.Cliente.RFC)
ObjFactura.Cliente.Nombre = If(Not String.IsNullOrEmpty(invoice_name), invoice_name, contact_name)
ObjFactura.Cliente.NombreComercial = ObjFactura.Cliente.NombreComercial
ObjFactura.Cliente.Direccion = If(Not String.IsNullOrEmpty(invoice_address), invoice_address, contact_address)
ObjFactura.Cliente.Mail = If(Not String.IsNullOrEmpty(invoice_email), invoice_email, contact_email)
ObjFactura.Cliente.Telefono = If(Not String.IsNullOrEmpty(invoice_phone), invoice_phone, contact_phone)
ObjFactura.Cliente.Localidad = If(Not String.IsNullOrEmpty(invoice_city), invoice_city, contact_city)
ObjFactura.Cliente.Ciudad = ObjFactura.Cliente.Localidad
ObjFactura.Cliente.Estado = If(Not String.IsNullOrEmpty(invoice_state), invoice_state, contact_state)
If String.IsNullOrEmpty(ObjFactura.Cliente.RFC) Then
Resp.Mensajes.Add("No se ha ingresado un RFC")
Return Nothing
End If
If String.IsNullOrEmpty(ObjFactura.Cliente.Nombre) Then
Resp.Mensajes.Add("No se ha ingresado un nombre para el cliente")
Return Nothing
End If
If Not String.IsNullOrEmpty(ObjFactura.Cliente.Estado) Then
CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{ObjFactura.Cliente.Estado.Trim}'").ToEntero()
'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
If CveEstado <= 0 Then
CveEstado = 26
End If
Else
CveEstado = 26
End If
Dim Cliente = ObjFactura.Cliente
If Not ObjClientes.UpdateClienteNoFrencuente(CveCliente, Cliente.Nombre, Cliente.Direccion, Cliente.NoExt, Cliente.NoInt, Cliente.Colonia, Cliente.Localidad, Cliente.Ciudad, CveEstado, Cliente.RFC, Cliente.CP, Cliente.Telefono, Cliente.Mail, CveSubProyecto, UsuarioActual.CveUsuario, CveEmpresa, "-1", ObjFactura.CveMetodoPago33, ObjFactura.CveFormaPago33) Then
Resp.TieneError = False
Resp.Mensajes.Add("No se puedo actualizar un cliente")
Return Nothing
End If
End If
ObjFactura.CveAlmacen = GlobalDTAlmacen(CveEmpresa, CveTipoAlmacen:=1).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
'DETALLES
ObjFactura.DtDetalle = CreaDTDetalle(ObjInventario, ObjFactura, Resp, UsuarioActual, JsonRequest)
@@ -958,7 +1128,6 @@ Public Class E141 : Implements IHttpHandler
End If
End If
'INVENTARIO
If TipoDocto = "Ing" Then
ObjFactura.DtInventario = ObjFactura.DtDetalle.Copy.FiltraParametros("CveTipoPS = 2")
@@ -1235,7 +1404,9 @@ Public Class E141 : Implements IHttpHandler
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
Try
Dim ListaPS = JArray.Parse(JsonRequest("details").ToString())
Dim DescuentoTotal As Decimal = JsonRequest("discount").ToString().ToDecimal()
@@ -1245,7 +1416,9 @@ Public Class E141 : Implements IHttpHandler
For Each JsonPS As JObject In ListaPS
Dim Cantidad As Decimal = JsonPS("quantity").ToString.ToDecimal()
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=JsonPS("product_sku").ToString()).FiltroPrimero("")
Dim CvePS As Integer = GlobalDTPSSimplificado(Codigo:=JsonPS("product_sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Retorno.TieneError = True
@@ -1487,7 +1660,7 @@ Public Class E141 : Implements IHttpHandler
If Resp.CveVenta > 0 Then
Respuesta.status = "success"
Respuesta.data = Resp.CveVenta.ToString()
Respuesta.data = Resp.SerieFolio
Else
TieneError = True
End If
@@ -1499,6 +1672,8 @@ Public Class E141 : Implements IHttpHandler
Next
RespuestaError.message = sb.ToString()
End If
ObjFactura.Dispose()
Else
TieneError = True
Dim sb As New StringBuilder()
@@ -2077,7 +2252,8 @@ Public Class E141 : Implements IHttpHandler
New JProperty("age", 0),
New JProperty("gender", 0),
New JProperty("address", ""),
New JProperty("code", "")
New JProperty("code", RowVendedor("CodigoVendedor")),
New JProperty("default_branchoffice", RowVendedor("CveSubProyecto"))
)
ArrayVendedores.Add(vendedor)
@@ -2097,6 +2273,10 @@ Public Class E141 : Implements IHttpHandler
End If
End If
If CountPeticionesExitosas > 0 Then
Retorno = True
End If
Return Retorno
End Function
#End Region

View File

@@ -72,23 +72,25 @@ Partial Class Bancos_RepComplementoPago
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual, FechaTimbrado:=FechaTimbrado) Then
If Banco.Mensaje = "" Then
Banco.Commit()
PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
Str.AppendFormat("Folio: <b>{0}</b> &nbsp;", Banco.ComplementoSerieFolio)
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">XML &nbsp;<i class=""fa fa-file""></i></i></a>&nbsp;&nbsp;", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">PDF &nbsp;<i class=""fa fa-ad-pdf""></i></i></i></a>&nbsp;", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a style='color:#337ab7' target='_blank' href='./IE.aspx?CveIE={0}'>{1}</a> &nbsp; {2}<br>", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente"))
MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo"))
Try
If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual, FechaTimbrado:=FechaTimbrado) Then
If Banco.Mensaje = "" Then
Banco.Commit()
PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
Str.AppendFormat("Folio: <b>{0}</b> &nbsp;", Banco.ComplementoSerieFolio)
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">XML &nbsp;<i class=""fa fa-file""></i></i></a>&nbsp;&nbsp;", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">PDF &nbsp;<i class=""fa fa-ad-pdf""></i></i></i></a>&nbsp;", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a style='color:#337ab7' target='_blank' href='./IE.aspx?CveIE={0}'>{1}</a> &nbsp; {2}<br>", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente"))
MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo"))
End If
Else
Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje)
Banco.RollBack()
End If
Else
Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje)
Catch ex As Exception
OnError("Ocurrió un error al generar el complemento de pago", ex)
Banco.RollBack()
End If
End Try
Banco.Dispose()
End If
Next

View File

@@ -456,7 +456,11 @@ Partial Class PopUpVerFactura
If UrlParametros("EXT").ToString.ToUpper = "PDF" Then
If UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero > 0 Then
PDFReciboDePagos(-1, UrlParametros("CVEIE").ToString.ToEntero, UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero, False) 'genero el documento de no existir
Dim CveIE As Integer = -1
If UrlParametros("CVEIE") IsNot Nothing Then
CveIE = UrlParametros("CVEIE").ToString.ToEntero
End If
PDFReciboDePagos(-1, CveIE, UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero, False) 'genero el documento de no existir
End If
End If

View File

@@ -1578,22 +1578,39 @@ Partial Class GPS_Rastreo
If Opcion = "KM" Then
If GVKm.Rows.Count > 0 Then
RutaReporte = "Empresas/Grales/ReportesProgramados/RPTKmRecorridos.rdlc"
NombreReporte = "ReporteKMRecorridos"
If Format = "PDF" Then
RutaReporte = "Empresas/Grales/ReportesProgramados/RPTKmRecorridos.rdlc"
NombreReporte = "ReporteKMRecorridos"
Try
Dim RptParametro As New List(Of ReportParameter)
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToString))
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString))
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format)
Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
Else
Dim filtros As String = $"Fechas: {FechaI.ToString("dd/MM/yyyy")} a {FechaF.ToString("dd/MM/yyyy")}"
If DtDatos.Rows.Count > 0 AndAlso String.IsNullOrEmpty(DtDatos.Rows(0)("Vehiculo").ToString()) Then
DtDatos.Rows(0)("Vehiculo") = "Total Kilometros Recorridos"
End If
DtDatos.Columns.RemoveAt(0)
DtDatos.Columns("Vehiculo").ColumnName = "Vehículo"
DtDatos.Columns("TiempoOperativo").ColumnName = "Tiempo Operativo"
DtDatos.Columns("Dist").ColumnName = "Kilometros Recorridos"
ImprimirExcelG(DtDatos, "ReporteKMRecorridos.xlsx", "Reporte de Kilometros Recorridos", filtros, NombreHoja:="RepKM")
End If
Try
Dim RptParametro As New List(Of ReportParameter)
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToString))
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString))
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format)
Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
Else
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
End If
@@ -1737,8 +1754,16 @@ Partial Class GPS_Rastreo
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format)
If Opcion = "Idle" AndAlso Format = "EXCEL" Then
Dim filtros As String = $"Fechas: {FechaI.ToString("dd/MM/yyyy")} a {FechaF.ToString("dd/MM/yyyy")}, Tiempo Muerto: {TxtMinutos.Text} minutos"
ImprimirExcelG(DtDatos, "ReporteKMRecorridos.xlsx", "Reporte de KM Recorridos", filtros)
Else
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format)
End If
DtDatos.Clear()
Else
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
@@ -1785,7 +1810,7 @@ Partial Class GPS_Rastreo
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim FileExcel As ExcelFile = New ExcelFile
Dim Dt = DtPosiciones.Copy()
Dt.Columns.Add("Direccion", GetType(String))
Dt.Columns.Add("Dirección", GetType(String))
Dt.Columns.Remove("CveDispositivo")
Dt.Columns.Remove("Evento")
Dt.Columns.Remove("Icono")
@@ -1797,11 +1822,42 @@ Partial Class GPS_Rastreo
Dt.Columns.Remove("Posicion")
For Each Dir As JObject In Direcciones
Dt.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
Dt.Rows(Dir("Indice").ToEntero())("Dirección") = Dir("Direccion").ToString()
Next
Dim item = FileExcel.Worksheets.Add("Última Posición")
item.InsertDataTable(Dt, New InsertDataTableOptions() With
Dt.Columns("Vehiculo").ColumnName = "Vehículo"
Dt.Columns("Velocidad").ColumnName = "Velocidad (KM/H)"
ImprimirExcelG(Dt, FileName, "Última Posición", "", NombreHoja:="UltimaPosicion")
'Dim item = FileExcel.Worksheets.Add("Última Posición")
'item.InsertDataTable(Dt, New InsertDataTableOptions() With
' {
' .ColumnHeaders = True,
' .StartRow = 0,
' .StartColumn = 0
' })
'item.Rows(0).Style.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(75, 119, 190), SpreadsheetColor.FromArgb(255, 255, 255))
'item.Rows(0).Style.Font.Color = SpreadsheetColor.FromArgb(255, 255, 255)
'Dim columnCount = item.CalculateMaxUsedColumns()
'For i = 0 To columnCount
' item.Columns(i).AutoFit(1, item.Rows(i), item.Rows(item.Rows.Count - 1))
'Next
'FileExcel.Save(Me.Response, FileName, SaveOptions.XlsxDefault)
End Sub
Private Sub ImprimirExcelG(DtDatos As DataTable, Archivo As String, Titulo As String, Filtros As String, Optional NombreHoja As String = "Hoja1")
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excel As ExcelFile = New ExcelFile
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
Dim item = excel.Worksheets.Add(NombreHoja)
item.InsertDataTable(DtDatos, New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0,
@@ -1813,9 +1869,127 @@ Partial Class GPS_Rastreo
Dim columnCount = item.CalculateMaxUsedColumns()
For i = 0 To columnCount
item.Columns(i).AutoFit(1, item.Rows(i), item.Rows(item.Rows.Count - 1))
Next
FileExcel.Save(Me.Response, FileName, SaveOptions.XlsxDefault)
Next
Dim worksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=UsuarioActual.CveCliente).FiltroPrimeroValor("Nombre")
RangoNombreEmpresa.Style.Font.Size = 18 * 20
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
RangoTitulo.Style.Font.Name = "Calibri Light"
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
'If FechaIMes.Trim.Length > 0 And FechaFMes.Trim.Length > 0 Then
' Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex)
' RangoFechas.Merged = True
' RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}"
' RangoFechas.Style.Font.Size = 15 * 20
' RangoFechas.Style.Font.Name = "Calibri Light"
' RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
' RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
'End If
'If SubProyecto.Length > 0 Then
' Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex)
' RangoSubProyecto.Merged = True
' RangoSubProyecto.Value = SubProyecto
' RangoSubProyecto.Style.Font.Size = 20 * 20
' RangoSubProyecto.Style.Font.Name = "Calibri Light"
' RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
' RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
'End If
If Not String.IsNullOrEmpty(Filtros) Then
Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
RangoDatoTituloExtra.Merged = True
RangoDatoTituloExtra.Value = Filtros
RangoDatoTituloExtra.Style.Font.Size = 15 * 20
RangoDatoTituloExtra.Style.Font.Name = "Calibri Light"
RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
End If
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
If i > 0 Then
Try
worksheet.Columns(i).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
Dim IndexEndTable As Integer = DtDatos.Rows.Count + TotalRowHeader + TotalRowFooter
worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió"
worksheet.Rows(IndexEndTable + 1).Cells(0).Value = UsuarioActual.Nombre
worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión"
worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy")
'Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
'If Imagen.Exists Then
' Dim Ruta As String = String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)
' Using sr As New StreamReader(Ruta)
' Dim ms As New MemoryStream()
' sr.BaseStream.CopyTo(ms)
' worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", 100, 100, LengthUnit.Pixel)
' End Using
'End If
For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
If I > 0 Then
'If Divisor = 1 Then
' worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
'Else
' worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
'End If
Try
worksheet.Columns(I).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
excel.Save(Me.Response, Archivo, SaveOptions.XlsxDefault)
End Sub
Private Function CargaDireccion(ByVal lat As String, ByVal lng As String) As String
Try

View File

@@ -44,8 +44,21 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{
DdlTipoPeriodo.SelectedIndex = 0;
}
LtlUma.Text = "";
int cveempresa = 1;
if (UsuarioActual != null) { cveempresa = UsuarioActual.CveEmpresa; }
using (ClsClaseBaseD objbase = new ClsClaseBaseD())
{
if (objbase.runQuerystr($"SELECT Valor UMA FROM [dbo].[RH_TablasValores] WHERE Tipo =1 AND CveEmpresa ={cveempresa} AND Fecha<'{DateTime.Now:yyyy/MM/dd}' ORDER BY Fecha DESC"))
{
if(objbase.DtResultados.Rows.Count > 0)
{
LtlUma.Text = objbase.DtResultados.Rows[0]["UMA"].ToString();
}
}
}
}
LtlUma.Text = "86.88";
}
@@ -269,7 +282,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
protected void BtnRecalcular_Click(object sender, EventArgs e)
{
decimal uma = 86.88m;
decimal uma = LtlUma.Text.ToDecimal();
decimal aguiexentogral = uma * 30;
decimal salariodiario = 0;
decimal diasanio = 366;
@@ -308,24 +321,25 @@ public partial class Nomina_Aguinaldo : ClsPaginas
aguinaldo = diasaguipago * salariodiario;
aguinaldoexcento = (aguiexentogral > aguinaldo ? aguinaldo : aguiexentogral);
aguinaldogravado = aguinaldo - aguinaldoexcento;
if (aguinaldogravado > 0) {
FraccionI = (aguinaldogravado / diasanio) * diasmes;
FraccionII_1 = salariomensual + FraccionI;
str.Clear();
str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes);
str.AppendFormat(" dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes);
if (objbase.runQuerystr(str.ToString()))
if (aguinaldogravado > 0)
{
DataRow drow = objbase.DtResultados.Rows[0];
FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal();
FraccionIII_1 = drow["isrFraccionIII_1"].ToString().ToDecimal();
}
else { break; }
FraccionI = (aguinaldogravado / diasanio) * diasmes;
FraccionII_1 = salariomensual + FraccionI;
str.Clear();
str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes);
str.AppendFormat(" dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes);
if (objbase.runQuerystr(str.ToString()))
{
DataRow drow = objbase.DtResultados.Rows[0];
FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal();
FraccionIII_1 = drow["isrFraccionIII_1"].ToString().ToDecimal();
}
else { break; }
FraccionIII_2 = FraccionII_2 - FraccionIII_1;
FraccionV = FraccionIII_2 / FraccionI;
FraccionIV = aguinaldogravado * FraccionV;
Aguinaldoapagar = aguinaldo - FraccionIV;
FraccionIII_2 = FraccionII_2 - FraccionIII_1;
FraccionV = FraccionIII_2 / FraccionI;
FraccionIV = aguinaldogravado * FraccionV;
Aguinaldoapagar = aguinaldo - FraccionIV;
}
else
{
@@ -349,7 +363,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
}
}
LtlTotal.Text =string.Format("${0:N2}", AguinaldoapagarTotal);
LtlTotal.Text = string.Format("${0:N2}", AguinaldoapagarTotal);
/*
*
@@ -389,7 +403,7 @@ Aguinaldoapagar
}
}
class ClsClaseBaseD : IDisposable
class ClsClaseBaseD : IDisposable
{
protected SqlConnection SqlConexion;
protected SqlDataAdapter SqlAdapter;
@@ -534,11 +548,11 @@ Aguinaldoapagar
SqlAdapter.SelectCommand.CommandText = Query;
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
datos = new DataTable();
if (Listaparametros!= null)
if (Listaparametros != null)
{
foreach (parametroQuery pr in Listaparametros)
{
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
{
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}
@@ -574,11 +588,11 @@ Aguinaldoapagar
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = Query;
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
if (Listaparametros!= null)
if (Listaparametros != null)
{
foreach (parametroQuery pr in Listaparametros)
{
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}

View File

@@ -127,6 +127,9 @@
font-weight: bold;
font-size: 15px;
}
.form-group.form-md-line-input .form-control.input-sm ~ label {
padding-bottom: 20px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
@@ -1107,7 +1110,7 @@
<asp:UpdatePanel ID="UPSRVaaciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-5">
<div class="col-md-7">
<div class="portlet light xspadding bordered " id="pnlvacacionesgv">
<div class="portlet-title">
@@ -1120,10 +1123,49 @@
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel ID="UpGvVacaciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvVacaciones" Width="100%" runat="server" GridLines="None" BorderWidth="0" data-heighterror="330" data-freezecols="0" data-freezerows="1"
DataKeyNames="CvePersonalVacaciones,Periodo,FechaIng,Estatus,CveAutoriza,Autoriza,Dias,Usuario,SEstatus,Folio,FechaInicio,FechaFin,Documento,Motivo"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD GvVacaciones" data-sort="true" data-height="300" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False" OnRowDataBound="GvVacaciones_RowDataBound">
<Columns>
<asp:BoundField Visible="true" DataField="Periodo" HeaderText="Periodo" HeaderStyle-Width="80" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField Visible="true" DataField="Dias" HeaderText="Días" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<%--<asp:BoundField Visible="true" DataField="Autorizo" ItemStyle-CssClass="truncate" HeaderText="Autorizo" ItemStyle-HorizontalAlign="Left" />--%>
<asp:BoundField Visible="true" DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" HeaderText="FechaIng" HeaderStyle-Width="80" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center" />
<%--<asp:BoundField Visible="true" DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField ItemStyle-Width="124">
<ItemTemplate>
<div>
<asp:LinkButton ID="LnkEliminarSolicitud" runat="server" OnClick="LnkEliminarSolicitud_Click" AlternateText="Eliminar" CausesValidation="False" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la solicitud de vacaciones?" data-btn-ok-label="si"
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-trash' title='Eliminar' ></i>" />
<asp:LinkButton ID="ImgEditar" runat="server" OnClick="Edit_ClickVacacionDia" AlternateText="Autorizar" CausesValidation="False"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil' title='Autorizar' ></i>" />
<asp:LinkButton ID="ImgDescargaFormato" runat="server" OnClick="DownLoad_ClickSolicitudVacaciones" AlternateText="Editar" CausesValidation="False"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-download ' title='Descarga Solicitud' ></i>" />
<asp:LinkButton ID="ImgDescargaAutorizacion" runat="server" OnClick="DownLoad_ClickSolicitudAutorizacion" AlternateText="Editar" CausesValidation="False"
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-download ' title='Descarga autorización' ></i>" />
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<%--<asp:PostBackTrigger ="LnkListaRaya" />--%>
<%--<asp:AsyncPostBackTrigger EventName="DownLoad_ClickSolicitudVacaciones" />
<asp:AsyncPostBackTrigger EventName="DownLoad_ClickSolicitudAutorizacion" />--%>
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-7">
<div class="col-md-5">
<div class="portlet light xspadding bordered " id="pnlvacacionesform">
<div class="portlet-title">
@@ -1141,59 +1183,49 @@
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtvacDiasFeriados" CssClass="form-control input-sm " runat="server"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtvacDiasFeriados">Días feriados</asp:Label>
<asp:RequiredFieldValidator ID="rfvvacDiasFeriados" runat="server" ControlToValidate="TxtvacDiasFeriados" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Días feriados''</b> es necesario, por favor ingréselo." ValidationGroup="VG_Vacaciones"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="rfvvacDiasFeriados"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" AssociatedControlID="TxtvacDiasFeriados">Días feriados</asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtvacFechaPago" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtvacFechaPago">Fecha pago</asp:Label>
<ajax:MaskedEditExtender ID="MeeVacFechaPago" runat="server" TargetControlID="TxtvacFechaPago" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CeeVacFechaPago" TargetControlID="TxtvacFechaPago" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvvacFechaPago" runat="server" ControlToValidate="TxtvacFechaPago" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="VG_Vacaciones"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoVacFechaPago" runat="server" HighlightCssClass="vco" TargetControlID="rfvvacFechaPago"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" AssociatedControlID="TxtvacFechaPago">Fecha pago</asp:Label>
</div>
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtvacFechaInicio" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtvacFechaInicio">Fecha Inicio</asp:Label>
<ajax:MaskedEditExtender ID="MeeVacFechaInicio" runat="server" TargetControlID="TxtvacFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CeeVacFechaInicio" TargetControlID="TxtvacFechaInicio" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvvacFechaInicio" runat="server" ControlToValidate="TxtvacFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="VG_Vacaciones"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoVacFechaInicio" runat="server" HighlightCssClass="vco" TargetControlID="rfvvacFechaInicio"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" AssociatedControlID="TxtvacFechaInicio">Fecha Inicio</asp:Label>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtvacFechaFin" CssClass="form-control input-sm ADSMaskDate" Style="width: 118px" runat="server"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtvacFechaFin">Fecha Fin</asp:Label>
<ajax:MaskedEditExtender ID="MeeVacFechaFin" runat="server" TargetControlID="TxtvacFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CeeVacFechaFin" TargetControlID="TxtvacFechaFin" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvvacFechaFin" runat="server" ControlToValidate="TxtvacFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo." ValidationGroup="VG_Vacaciones"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoVacFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="rfvvacFechaFin"></ajax:ValidatorCalloutExtender>
<asp:Label runat="server" AssociatedControlID="TxtvacFechaFin">Fecha Fin</asp:Label>
</div>
</div>
</div>
</div>
</div>
<div class="text-right">
<asp:LinkButton ID="LnkSRVacacionesUP" OnClick="LnkSRVacacionesUP_Click" Visible="false" CssClass="btn btn-primary" ValidationGroup="VGMNom_" runat="server">Actualizar</asp:LinkButton>
<asp:LinkButton ID="LnkSRVacacionesADD" OnClick="LnkSRVacacionesADD_Click" Visible="false" CssClass="btn btn-success" ValidationGroup="VGMNom_" runat="server">Agregar</asp:LinkButton>
<asp:LinkButton ID="LnkSRVacacionesUP" OnClick="LnkSRVacacionesUP_Click" Visible="false" CssClass="btn btn-primary" ValidationGroup="VG_Vacaciones" runat="server">Actualizar</asp:LinkButton>
<asp:LinkButton ID="LnkSRVacacionesADD" OnClick="LnkSRVacacionesADD_Click" Visible="true" CssClass="btn btn-success" ValidationGroup="VG_Vacaciones" runat="server">Agregar</asp:LinkButton>
</div>
</div>
</div>

View File

@@ -365,9 +365,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
if (FiltCvePeriodo > 0)
{
int Estatus = 0;
using (ClsNominas objnom = new ClsNominas())
{
int Estatus=0;
if (objnom.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, FiltCvePeriodo))
{
DataRow drow = objnom.DtResultados.Rows[0];
@@ -403,11 +403,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
continuar = true;
}
if (dtempleados != null && Estatus > 2)
{
LnkTimbrarTodos.Visible = dtempleados.Rows.Count > 0 && dtempleados.COUNT("CvePersonal", "SeTimbro=0 AND CvePersonal >0") > 0;
}
LnkTimbrarTodos.Visible = dtempleados.Rows.Count > 0 && dtempleados.COUNT("CvePersonal", "SeTimbro=0 AND CvePersonal >0") > 0;
}
}
@@ -1508,12 +1504,28 @@ public partial class Nomina_Nomina2 : ClsPaginas
LblEmpleado.Text = Nombre;
TabPersonal.ActiveTabIndex = 0;
mostrarConceptos();
CargaVacaciones();
pnlAddupMovto.Visible = false;
CargaMovtoPermanente();
CargaPersonalIncapacidad();
RegistraScript("$('#ModalConceptos').modal();");
}
private void CargaVacaciones()
{
ClsRH objRH = new ClsRH();
if (objRH.VacacionesGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa))
{
GvVacaciones.DataSource = objRH.DtResultados;
}
else { GvVacaciones.DataSource = null; }
objRH.Dispose();
GvVacaciones.DataBind();
UpGvVacaciones.Update();
}
protected void LnkConcepto_Click(object sender, EventArgs e)
{
@@ -2722,7 +2734,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Fecha Ingr:{0:dd/MM/yyyy}, S.D.:{1:N2}, S.D.I.:{2:N2}, S.B.C.:{3:N2} ", drow2["FechaIngreso"], drow2["SalarioDiario"], drow2["SalarioDiarioIntegrado"], drow2["SalarioDiarioIMSS"])); cell.Blocks.Add(paragraphh);
paragraphh.ParagraphFormat.Style = styilo;
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Días pagados:{0}, Retardos: {1}, Ausencias:{2}, Centro de costos: {3}", drow2["DiasLaborados"], drow2["DiasRetardos"], drow2["DiasFaltados"], drow2["SubProyecto"])); cell.Blocks.Add(paragraphh);
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Días pagados:{0}, Retardos: {1}, Ausencias:{2},Incapacidad:{4}, Centro de costos: {3}", drow2["DiasLaborados"], drow2["DiasRetardos"], drow2["DiasFaltados"], drow2["SubProyecto"], drow2["DiasIncapacidad"])); cell.Blocks.Add(paragraphh);
paragraphh.ParagraphFormat.Style = styilo;
row = new GemBox.Document.Tables.TableRow(document);
@@ -2965,6 +2977,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
section.Blocks.Add(paragraphh);
paragraphh = new GemBox.Document.Paragraph(document, string.Format("Total Centro de costos {0}", SubProyecto.ToUpper()));
paragraphh.ParagraphFormat.Style = styilostrong;
section.Blocks.Add(paragraphh);
#region "totaldepto"
{
@@ -3352,6 +3366,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
keeptablesamepage(sobrereciboTable);
}
#endregion
section.Blocks.Add(new GemBox.Document.Paragraph(document, new GemBox.Document.SpecialCharacter(document, GemBox.Document.SpecialCharacterType.PageBreak)));
}
paragraphh = new GemBox.Document.Paragraph(document, "TOTAL ");
@@ -3692,7 +3707,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
cellx = new GemBox.Document.Tables.TableCell(document); rowx.Cells.Add(cellx);
cellx.CellFormat.PreferredWidth = new GemBox.Document.Tables.TableWidth(11, GemBox.Document.Tables.TableWidthUnit.Percentage);
paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("Total","CvePersonal > 0"))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right;
paragraphh = new GemBox.Document.Paragraph(document, string.Format("${0:N2}", dtempleados.SUM("Total", "CvePersonal > 0"))); cellx.Blocks.Add(paragraphh); paragraphh.ParagraphFormat.Alignment = GemBox.Document.HorizontalAlignment.Right;
paragraphh.ParagraphFormat.Style = styilostrong;
@@ -4193,126 +4208,133 @@ public partial class Nomina_Nomina2 : ClsPaginas
DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0", FiltroCvePersonal), "", getcolumnas);
DataTable dtconp = null;
int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
#region PropNomina
int CvePersonal = 0;
int CveNomina = 0;
int CveMetodoPago = 0;
double SubTotal = 0;
double Total = 0;
int CveMoneda = 1;
#endregion
#region PropNominaDetalle
int CveConcepto = 0;
decimal ImporteConcepto = 0, ImporteGravadoConcepto = 0, ImporteExentoConcepto = 0, ImporteValor = 0;
#endregion
using (ClsNominas objNomina = new ClsNominas())
if (FiltCveSubProyecto == -1 && DdlRegimenContratacion.SelectedValue == "-1")
{
objNomina.IniciaTransacSQL();
foreach (DataRow rtemp in dtr.Rows)
{
CveNomina = 0;
CvePersonal = rtemp["CvePersonal"].ToString().ToEntero();
CveMetodoPago = rtemp["CveMetodoPago"].ToString().ToEntero();
SubTotal = rtemp["SumaPercepciones"].ToString().ToDouble();
Total = rtemp["Total"].ToString().ToDouble();
if (CvePersonal > 0)
{
if (continuar)
{
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
{
#region PropNomina
int CvePersonal = 0;
int CveNomina = 0;
int CveMetodoPago = 0;
double SubTotal = 0;
double Total = 0;
int CveMoneda = 1;
#endregion
#region PropNominaDetalle
int CveConcepto = 0;
decimal ImporteConcepto = 0, ImporteGravadoConcepto = 0, ImporteExentoConcepto = 0, ImporteValor = 0;
#endregion
if (objNomina.DtResultados.Rows.Count > 0)
using (ClsNominas objNomina = new ClsNominas())
{
objNomina.IniciaTransacSQL();
foreach (DataRow rtemp in dtr.Rows)
{
CveNomina = 0;
CvePersonal = rtemp["CvePersonal"].ToString().ToEntero();
CveMetodoPago = rtemp["CveMetodoPago"].ToString().ToEntero();
SubTotal = rtemp["SumaPercepciones"].ToString().ToDouble();
Total = rtemp["Total"].ToString().ToDouble();
if (CvePersonal > 0)
{
if (continuar)
{
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
{
CveNomina = objNomina.CveNomina;
}
else
{
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, SubTotal, 0, 0, Total, CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina",
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
if (objNomina.DtResultados.Rows.Count > 0)
{
CveNomina = objNomina.CveNomina;
}
else
{
continuar = false;
if (objNomina.AddNom_Nominas(-1, 1, CvePersonal, CvePeriodoSeleccionado, SubTotal, 0, 0, Total, CveMoneda, 1, CveMetodoPago, DateTime.Now, "Deducciones nómina",
"", "", "", "", 0, 0, 0, new DateTime(), new DateTime(), new DateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
CveNomina = objNomina.CveNomina;
}
else
{
continuar = false;
}
}
}
}
}
if (CveNomina == 0)
{
continuar = false;
}
if (continuar)
{
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal));
foreach (DataRow rcon in dtconp.Rows)
if (CveNomina == 0)
{
continuar = false;
}
CveConcepto = rcon["CveConcepto"].ToString().ToEntero();
ImporteConcepto = rcon["Importe"].ToString().ToDecimal();
ImporteGravadoConcepto = rcon["ImporteGravado"].ToString().ToDecimal();
ImporteExentoConcepto = ImporteConcepto - ImporteGravadoConcepto;
ImporteValor = rcon["Valor"].ToString().ToDecimal();
if (continuar)
if (continuar)
{
dtconp = dtempleadosConceptos.FiltraParametros(string.Format("CvePersonal={0} AND Importe<>0", CvePersonal));
foreach (DataRow rcon in dtconp.Rows)
{
if (!objNomina.AddUPNom_NominasDetalles(CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, ImporteConcepto, ImporteGravadoConcepto, ImporteExentoConcepto, ImporteValor, UsuarioActual.CveUsuario))
CveConcepto = rcon["CveConcepto"].ToString().ToEntero();
ImporteConcepto = rcon["Importe"].ToString().ToDecimal();
ImporteGravadoConcepto = rcon["ImporteGravado"].ToString().ToDecimal();
ImporteExentoConcepto = ImporteConcepto - ImporteGravadoConcepto;
ImporteValor = rcon["Valor"].ToString().ToDecimal();
if (continuar)
{
continuar = false;
}
}
if (!objNomina.AddUPNom_NominasDetalles(CveNomina, CvePeriodoSeleccionado, CvePersonal, CveConcepto, ImporteConcepto, ImporteGravadoConcepto, ImporteExentoConcepto, ImporteValor, UsuarioActual.CveUsuario))
{
continuar = false;
}
}
}
}
if (continuar)
{
decimal SalarioDiario = rtemp["SalarioDiario"].ToString().ToEntero();
decimal SalarioDiarioIMSS = rtemp["SalarioDiarioIMSS"].ToString().ToEntero();
decimal SalarioDiarioIntegrado = rtemp["SalarioDiarioIntegrado"].ToString().ToEntero();
int DiasLaborados = rtemp["DiasLaborados"].ToString().ToEntero();
int DiasFaltados = rtemp["DiasFaltados"].ToString().ToEntero();
int DiasVacaciones = rtemp["DiasVacaciones"].ToString().ToEntero();
int DiasIncapacidad = rtemp["DiasIncapacidad"].ToString().ToEntero();
continuar = objNomina.PA_Nom_NominasAutorizarUP(CvePersonal, CvePeriodoSeleccionado, SalarioDiario, SalarioDiarioIMSS, SalarioDiarioIntegrado, 0, 0, Total, SubTotal, DiasLaborados, DiasFaltados, DiasVacaciones, DiasIncapacidad);
}
}
if (continuar)
{
decimal SalarioDiario = rtemp["SalarioDiario"].ToString().ToEntero();
decimal SalarioDiarioIMSS = rtemp["SalarioDiarioIMSS"].ToString().ToEntero();
decimal SalarioDiarioIntegrado = rtemp["SalarioDiarioIntegrado"].ToString().ToEntero();
int DiasLaborados = rtemp["DiasLaborados"].ToString().ToEntero();
int DiasFaltados = rtemp["DiasFaltados"].ToString().ToEntero();
int DiasVacaciones = rtemp["DiasVacaciones"].ToString().ToEntero();
int DiasIncapacidad = rtemp["DiasIncapacidad"].ToString().ToEntero();
continuar = objNomina.PA_Nom_NominasAutorizarUP(CvePersonal, CvePeriodoSeleccionado, SalarioDiario, SalarioDiarioIMSS, SalarioDiarioIntegrado, 0, 0, Total, SubTotal, DiasLaborados, DiasFaltados, DiasVacaciones, DiasIncapacidad);
}
}
if (continuar)
{
continuar = objNomina.AutorizaNom_Nominas(-1, CvePeriodoSeleccionado, true);
}
if (continuar)
{
objNomina.Commit();
Alert("La nomina se autorizó correctamente.");
cargaDatos();
}
else
{
objNomina.RollBack();
}
}
if (continuar)
if (dtr != null)
{
continuar = objNomina.AutorizaNom_Nominas(-1, CvePeriodoSeleccionado, true);
dtr.Dispose();
}
if (continuar)
if (dtconp != null)
{
objNomina.Commit();
Alert("La nomina se autorizó correctamente.");
cargaDatos();
}
else
{
objNomina.RollBack();
dtconp.Dispose();
}
}
if (dtr != null)
else
{
dtr.Dispose();
}
if (dtconp != null)
{
dtconp.Dispose();
Alert("para poder autorizar debe seleccionar a todos en el centro de costo y en Régimen de contratación.", TipoMensaje.MsgAdvertencia);
}
}
@@ -4769,7 +4791,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
e.Row.Cells[celda].CssClass = "cellFail";
e.Row.Cells[celda + 1].CssClass = "cellFail";
}
celda = celda + 2;
celda = celda + 4;
string CuotaFijaSUA = string.Format("{0:N2}", e.Row.DataKey("CuotaFijaSUA").ToDecimal());
string CuotaFijaSIG = string.Format("{0:N2}", e.Row.DataKey("CuotaFijaSIG").ToDecimal());
if (CuotaFijaSUA != CuotaFijaSIG)
@@ -5095,7 +5117,264 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkSRVacacionesADD_Click(object sender, EventArgs e)
{
DateTime fInicio = TxtvacFechaInicio.Text.ToDate();
DateTime fFin = TxtvacFechaFin.Text.ToDate();
string fechapago = TxtvacFechaPago.Text.ToDate().ToString("yyyy/MM/dd");
int diasinhabil = TxtvacDiasFeriados.Text.ToEntero();
// Dim motivoVacaciones As String = TxtMotivoVacaciones.Text
int VacCveSupervisor = 0;
int VacFolioActual = 0;
if (fInicio <= fFin)
{
using (ClsRH objRHx = new ClsRH())
{
if (objRHx.VacacionesResumenGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa))
{
if (objRHx.DtResultados.Rows.Count > 0)
{
VacCveSupervisor = objRHx.DtResultados.Rows[0]["SupervisorCorreo"].ToString().ToEntero();
}
}
if (objRHx.VacacionesGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa))
{
if (objRHx.DtResultados.Rows.Count > 0)
{
VacFolioActual = objRHx.DtResultados.Compute("Max(Folio)", string.Empty).ToString().ToEntero();
}
}
}
VacFolioActual = VacFolioActual + 1;
ClsRH objRH = new ClsRH();
// Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones)
bool continuar = objRH.SolicitudVacacionesAdd(SRCvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago: fechapago, diasinabiles: diasinhabil);
if (objRH.DtResultados.Rows.Count > 0)
{
string ShowError = objRH.DtResultados.Rows[0]["ShowError"].ToString();
if (ShowError.Length > 0)
{
Alert(ShowError, TipoMensaje.MsgAdvertencia);
continuar = false;
}
}
objRH.Dispose();
if (continuar)
{
TxtvacFechaInicio.Text = "";
TxtvacFechaFin.Text = "";
TxtvacFechaPago.Text = "";
TxtvacDiasFeriados.Text = "";
CargaVacaciones();
//CargaVacacionesResumenPeriodoActual();
//VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " + NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin);
Alert("Las vacaciones se han actualizodo");
}
}
else { Alert("La fecha Inicial debe ser inferior a la fecha final.", TipoMensaje.MsgAdvertencia); }
}
protected void GvVacaciones_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
bool _Estatus = bool.Parse(e.Row.DBCampo("Estatus").ToString());
string _Documento = e.Row.DataKey("Documento");
int _CveAutoriza = e.Row.DataKey("CveAutoriza").ToEntero();
string RutaDocuemntoAutorizacion = string.Format(@"{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, SRCvePersonal, _Documento);
LinkButton lnkDescargaFormato = e.Row.FCLinkButton("ImgDescargaFormato");
LinkButton lnkDescargaAutorizacion = e.Row.FCLinkButton("ImgDescargaAutorizacion");
LinkButton lnkEditar = e.Row.FCLinkButton("ImgEditar");
if (_CveAutoriza > 0 | !_Estatus)
lnkEditar.Visible = false;
lnkDescargaFormato.Visible = true;
// ScriptManager.GetCurrent(Me).RegisterAsyncPostBackControl(lnkDescargaFormato)
if (File.Exists(RutaDocuemntoAutorizacion) & _Estatus)
lnkDescargaAutorizacion.Visible = true;
else
lnkDescargaAutorizacion.Visible = false;
}
}
protected void LnkEliminarSolicitud_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
int CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero();
ClsRH objRH = new ClsRH();
if (objRH.RemoverSolicitudVacaciones(CvePersonalVacaciones))
{
CargaVacaciones();
Alert("Las vacaciones se ha eliminado");
}
objRH.Dispose();
}
public void Edit_ClickVacacionDia(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
//CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero;
//VacFolio = GvRow.DataKey("Folio").ToString().ToEntero;
TxtvacFechaInicio.Text = GvRow.DataKey("FechaInicio").ToString().ToDate().ToString("dd/MM/yyyy");
TxtvacFechaFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate().ToString("dd/MM/yyyy");
RegistraScript("$('#divEditarDiaVacacion').modal({ backdrop: 'static', keyboard: false});");
}
public void DownLoad_ClickSolicitudVacaciones(object sender, EventArgs e)
{
/*
GridViewRow GvRow = (GridViewRow)(LinkButton)sender.NamingContainer;
// Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
// DescarSolicitudVacaciones(Folio)
string RutaFormato = string.Format(@"{0}Formatos\SolicitudVacaciones.docx", UsuarioActual.Empresa.Ruta);
string NombreEmpleado = string.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text);
string Codigo = TxtCodigo.Text;
string Departamento = DdlDepartamento.SelectedItem.Text;
string JefeInmediato = DdlSupervisorOrganigrama.SelectedItem.Text;
DateTime fechaIngreso = TxtFechaIngreso.Text.ToDate();
int Periodoingreso = fechaIngreso.ToString("MMdd").ToEntero();
int PeriodoInicio = GvRow.DataKey("FechaInicio").ToDate().ToString("MMdd").ToEntero();
string FechaInicio = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy");
string FechaFin = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy");
string diasPermiso = GvRow.DataKey("Dias");
string MotivoPermiso = GvRow.DataKey("Motivo");
string Puesto = DdlPuesto.SelectedItem.Value;
string Fecha = DateTime.Now.ToString("dd/MM/yyyy");
string Solicitante = UsuarioActual.Nombre;
int anio = GvRow.DataKey("FechaInicio").ToDate().Year;
string FechaPeriodo = GvRow.DataKey("Periodo");
if (Periodoingreso > PeriodoInicio)
anio = anio - 1;
if (File.Exists(RutaFormato))
{
clsGemBoxDocument objGemDocument = new clsGemBoxDocument(RutaFormato);
List<TagsDocumentos> ListaTags = new List<TagsDocumentos>();
ListaTags = GetDatosTagsDocumentos();
ListaTags.Add(new TagsDocumentos("{Solicitante}", Solicitante));
ListaTags.Add(new TagsDocumentos("{Fecha}", Fecha));
ListaTags.Add(new TagsDocumentos("{NombreEmpleado}", NombreEmpleado));
ListaTags.Add(new TagsDocumentos("{Codigo}", Codigo));
ListaTags.Add(new TagsDocumentos("{Departamento}", Departamento));
ListaTags.Add(new TagsDocumentos("{JefeInmediato}", JefeInmediato));
ListaTags.Add(new TagsDocumentos("{FechaInicio}", FechaInicio));
ListaTags.Add(new TagsDocumentos("{FechaFin}", FechaFin));
ListaTags.Add(new TagsDocumentos("{diasPermiso}", diasPermiso));
ListaTags.Add(new TagsDocumentos("{MotivoPermiso}", MotivoPermiso));
ListaTags.Add(new TagsDocumentos("{Puesto}", Puesto));
ListaTags.Add(new TagsDocumentos("{anio}", anio.ToString()));
ListaTags.Add(new TagsDocumentos("{FechaPeriodo}", FechaPeriodo));
objGemDocument.SustituirTags(ListaTags);
// objGemDocument.GuardarStream()
objGemDocument.GuardarStreamPDF();
byte[] bytesInStream = objGemDocument.GetBytesDocumento();
// Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
objGemDocument.Dispose();
Response.Clear();
Response.ContentType = "application/force-download";
Response.AddHeader("content-disposition", "attachment; filename=" + CvePersonal + "_Solicitud_Vacaciones_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
Response.BinaryWrite(bytesInStream);
Response.End();
}
else
Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia);*/
}
public void DownLoad_ClickSolicitudPermiso(object sender, EventArgs e)
{
/* GridViewRow GvRow = (GridViewRow)(LinkButton)sender.NamingContainer;
// Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
// DescarSolicitudVacaciones(Folio)
string RutaFormato = string.Format(@"{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta);
string NombreEmpleado = string.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text);
string Codigo = TxtCodigo.Text;
string Departamento = DdlDepartamento.SelectedItem.Text;
string JefeInmediato = DdlSupervisorOrganigrama.SelectedItem.Text;
string FechaInicio = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy");
string FechaFin = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy");
string diasPermiso = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}";
string HorasPermiso = ""; // String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
string MotivoPermiso = string.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"));
if (File.Exists(RutaFormato))
{
clsGemBoxDocument objGemDocument = new clsGemBoxDocument(RutaFormato);
List<TagsDocumentos> ListaTags = new List<TagsDocumentos>();
ListaTags = GetDatosTagsDocumentos();
ListaTags.Add(new TagsDocumentos("{NombreEmpleado}", NombreEmpleado));
ListaTags.Add(new TagsDocumentos("{Codigo}", Codigo));
ListaTags.Add(new TagsDocumentos("{Departamento}", Departamento));
ListaTags.Add(new TagsDocumentos("{JefeInmediato}", JefeInmediato));
ListaTags.Add(new TagsDocumentos("{FechaInicio}", FechaInicio));
ListaTags.Add(new TagsDocumentos("{FechaFin}", FechaFin));
ListaTags.Add(new TagsDocumentos("{diasPermiso}", diasPermiso));
ListaTags.Add(new TagsDocumentos("{HorasPermiso}", HorasPermiso));
ListaTags.Add(new TagsDocumentos("{MotivoPermiso}", MotivoPermiso));
objGemDocument.SustituirTags(ListaTags);
// objGemDocument.GuardarStream()
objGemDocument.GuardarStreamPDF();
byte[] bytesInStream = objGemDocument.GetBytesDocumento();
// Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
objGemDocument.Dispose();
Response.Clear();
Response.ContentType = "application/force-download";
Response.AddHeader("content-disposition", "attachment; filename=" + CvePersonal + "_Solicituddepermiso_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
Response.BinaryWrite(bytesInStream);
Response.End();
}
else
Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia);
*/
}
public void DownLoad_ClickSolicitudAutorizacion(object sender, EventArgs e)
{
/*
GridViewRow GvRow = (GridViewRow)(LinkButton)sender.NamingContainer;
string _Documento = GvRow.DataKey("Documento");
string RutaDocuemntoAutorizacion = string.Format(@"{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento);
if (File.Exists(RutaDocuemntoAutorizacion))
{
byte[] bytesInStream = File.ReadAllBytes(RutaDocuemntoAutorizacion);
Response.Clear();
Response.ContentType = "application/force-download";
Response.AddHeader("content-disposition", "attachment; filename=" + _Documento);
Response.AddHeader("content-disposition", "attachment; filename=" + _Documento);
Response.BinaryWrite(bytesInStream);
Response.End();
}
else
Alert("No se encontro el documento que intenta descargar.");
}
*/
}
protected void BtnGeneratepdf_Click(object sender, EventArgs e)
{
@@ -5268,17 +5547,19 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkRegistrarProvision_Click(object sender, EventArgs e)
{
using (ClsNominas ObjNomina = new ClsNominas())
using(ClsNominas objnom = new ClsNominas() )
{
if (ObjNomina.Autorizaperiodoconta(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
int CvePrePolizaProvision = 0; int CvePrePolizaasmilidos=0;
if(objnom.DtResultados.Rows.Count > 0)
{
Alert("Provisión Generada", TipoMensaje.MsgAdvertencia);
CvePrePolizaProvision= objnom.DtResultados.Rows[0]["CvePrePoliza"].ToString().ToEntero();
CvePrePolizaasmilidos = objnom.DtResultados.Rows[0]["CvePrePolizaAsimilables"].ToString().ToEntero();
}
if (objnom.Autorizaperiodoconta(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa)){
string mensaje = string.Format("La provision a sido autorizada.<br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\">Provision </a><br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\"> Asimilados</a>", CvePrePolizaProvision, CvePrePolizaasmilidos);
Alert(mensaje);
}
}
}
@@ -5388,321 +5669,14 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void LnkLayoutContable_Click(object sender, EventArgs e)
{
using (ClsClaseBasez objbase = new ClsClaseBasez())
using (ClsNominas objnom = new ClsNominas())
{
if (objbase.runQuerystr($"PA_NomDispersiondenomina @CvePeriodo ={CvePeriodoSeleccionado}, @CveEmpresa ={UsuarioActual.CveEmpresa}"))
if (objnom.GetDispersiondenomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
CrearLayout(objbase.DtResultados);
CrearLayout(objnom.DtResultados);
}
}
}
}
}
class ClsClaseBasez : IDisposable
{
protected SqlConnection SqlConexion;
protected SqlDataAdapter SqlAdapter;
protected DataTable datos;
protected DataSet DTSet;
public DataTable DtResultados
{
get
{
return datos;
}
}
public DataSet DTSetResultados
{
get
{
return DTSet;
}
}
protected bool disposedValue = false;
protected bool EsTransaccion = false;
public string MyCurrentError;
// REGISTRAR CONEXIÓN
private int CveConexion = 0;
public ClsClaseBasez(ClsClaseBasez adsObj = null)
{
if (adsObj != null && adsObj.SqlAdapter != null && adsObj.SqlAdapter.SelectCommand != null && adsObj.SqlAdapter.SelectCommand.Transaction != null)
{
SqlConexion = adsObj.SqlConexion;
SqlAdapter = adsObj.SqlAdapter;
EsTransaccion = true;
}
else
{
SqlConexion = new SqlConnection();
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString;
try
{
SqlConexion.Open();
SqlAdapter = new SqlDataAdapter("", SqlConexion);
ConexionAdd();
}
catch (Exception ex)
{
this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex);
}
}
}
public void SqlDataAdapter(string StrSQL, CommandType TipoComando = CommandType.StoredProcedure)
{
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = StrSQL;
SqlAdapter.SelectCommand.CommandType = TipoComando;
datos = new DataTable();
DTSet = new DataSet();
}
}
protected void DataAdapter(string StrSQL, CommandType TipoComando = CommandType.Text)
{
// if (SqlAdapter.SelectCommand == null)
// {
// if ((sqlCommand != null))
// {
// SqlAdapter.SelectCommand = sqlCommand;
// }
// else
// {
// SqlAdapter.SelectCommand = new SqlCommand();
// }
// SqlAdapter.SelectCommand.Connection = SqlConexion;
// }
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = StrSQL;
SqlAdapter.SelectCommand.CommandType = TipoComando;
datos = new DataTable();
DTSet = new DataSet();
}
}
private void ConexionAdd()
{
if (ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1")
{
try
{
SqlDataAdapter("PA_Sis_RegistrarConexion");
{
var withBlock = SqlAdapter.SelectCommand.Parameters;
withBlock.Add("@Clase", SqlDbType.VarChar).Value = this.GetType().Name;
withBlock.Add("@Modulo", SqlDbType.VarChar).Value = string.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString(), HttpContext.Current.Request.QueryString.ToString());
withBlock.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output;
}
SqlAdapter.Fill(datos);
CveConexion = SqlAdapter.SelectCommand.Parameters["@IDConexion"].Value.ToString().ToEntero();
}
catch (Exception ex)
{
this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo());
}
}
}
private void ConexionClose()
{
if (CveConexion > 0 && ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1")
{
SqlDataAdapter(string.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text);
try
{
SqlAdapter.Fill(datos);
}
catch (Exception ex)
{
this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo());
}
CveConexion = 0;
}
}
protected void addParameters(string name, SqlDbType tipo, object valor)
{
if (SqlConexion.State == ConnectionState.Open)
SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor;
}
public bool runQuerystr(string Query, List<parametroQuery> Listaparametros = null, string msgError = "", bool mostrarError = true)
{
bool retorno = false;
try
{
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = Query;
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
datos = new DataTable();
if (Listaparametros != null)
{
foreach (parametroQuery pr in Listaparametros)
{
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}
SqlAdapter.Fill(datos);
retorno = true;
}
else
{
string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada";
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}";
ModExtensiones.GuardaLog(InfoAdicional);
}
}
catch (SqlException sqEx)
{
retorno = false;
setOnError(msgError, sqEx);
}
catch (Exception ex)
{
retorno = false;
setOnError(msgError, ex);
}
return retorno;
}
public int ExecQuery(string Query, List<parametroQuery> Listaparametros = null, string msgError = "", bool mostrarError = true)
{
int retorno = -1;
try
{
if (SqlConexion.State == ConnectionState.Open)
{
SqlAdapter.SelectCommand.Parameters.Clear();
SqlAdapter.SelectCommand.CommandText = Query;
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
if (Listaparametros != null)
{
foreach (parametroQuery pr in Listaparametros)
{
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
}
}
retorno = SqlAdapter.SelectCommand.ExecuteNonQuery();
}
else
{
string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada";
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}";
this.GuardaLog(InfoAdicional);
}
}
catch (SqlException sqEx)
{
retorno = -1;
setOnError(msgError, sqEx);
}
catch (Exception ex)
{
retorno = -1;
setOnError(msgError, ex);
}
return retorno;
}
protected bool RunQuery(string msgOnError)
{
bool retorno = false;
try
{
SqlAdapter.Fill(datos);
retorno = true;
}
catch (Exception ex)
{
retorno = false;
setOnError(msgOnError, ex);
}
return retorno;
}
protected bool RunQueryDS(string msgOnError)
{
bool retorno = false;
try
{
SqlAdapter.Fill(DTSet);
retorno = true;
}
catch (Exception ex)
{
retorno = false;
setOnError(msgOnError, ex);
}
return retorno;
}
public void setOnError(string Mensaje, Exception Exeption)
{
string InfoAdicional = "";
if (SqlAdapter != null && SqlAdapter.SelectCommand != null && SqlAdapter.SelectCommand.Parameters != null)
InfoAdicional = SqlAdapter.SelectCommand.Parameters.ParametrosInfo();
MyCurrentError = string.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString(), "\r\n", InfoAdicional);
this.OnError(Mensaje, Exeption, InfoAdicional);
}
public void IniciaTransacSQL()
{
SqlAdapter.SelectCommand.Transaction = SqlConexion.BeginTransaction();
EsTransaccion = true;
}
public void Commit()
{
SqlAdapter.SelectCommand.Transaction.Commit();
SqlConexion.Close();
}
public void RollBack()
{
SqlAdapter.SelectCommand.Transaction.Rollback();
SqlConexion.Close();
}
public void Dispose()
{
ConexionClose();
if ((SqlConexion != null))
{
if (SqlConexion.State == ConnectionState.Open)
{
try
{
if ((SqlAdapter != null))
SqlAdapter.Dispose();
SqlConexion.Close();
}
catch (Exception ex)
{
this.OnError("Ocurrió un error al intentar cerrar la base de datos.", ex);
}
}
SqlConexion.Dispose();
}
if (datos != null)
datos.Dispose();
if (SqlAdapter != null)
SqlAdapter.Dispose();
if (DTSet != null)
DTSet.Dispose();
GC.SuppressFinalize(this);
}
}

View File

@@ -1032,6 +1032,7 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpCuentasBancos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvBancosCuentas" GridLines="None" BorderColor="#D3D3D3" BorderWidth="1" CssClass="table table-striped table-hover Widthall" Style="table-layout: fixed" runat="server"
DataKeyNames="CveCuentaDeposito" AutoGenerateColumns="False" ShowHeaderWhenEmpty="true">
<%--<asp:GridView ID="GvBancosCuentas" runat="server" DataKeyNames="CveCuentaDeposito" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Cuentas Bancarias" CssClass="table table-striped table-advance table-hover" Style="table-layout: fixed" BorderWidth="0" GridLines="None">--%>
@@ -2293,7 +2294,7 @@
<ContentTemplate>
<div class="row">
<div class="col-md-3">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px!important">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
@@ -2307,8 +2308,7 @@
</div>
</div>
</div>
<div class="col-md-3">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright " style="width: 100px!important">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
<asp:TextBox ID="TxtFechaFinVac" runat="server" CausesValidation="true" CssClass="form-control input-sm"></asp:TextBox>
@@ -2322,26 +2322,9 @@
<br />
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px!important">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
<asp:TextBox ID="TxtFechaPago" runat="server" CausesValidation="true" CssClass="form-control input-sm"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkTxtFechaPago" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEETxtFechaPago" runat="server" TargetControlID="TxtFechaPago" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEETxtFechaPago" TargetControlID="TxtFechaPago" PopupButtonID="LnkTxtFechaPago" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<label>Fecha pago</label>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px!important">
<asp:TextBox ID="Txtdiasinabiles" runat="server" TextMode="Number" CausesValidation="true" CssClass="form-control input-sm"></asp:TextBox>
<label>días inhábiles</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px!important">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
@@ -2355,15 +2338,13 @@
</div>
</div>
</div>
<div class="col-md-3">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px!important">
<asp:TextBox ID="Txtdiasinabiles" runat="server" TextMode="Number" CausesValidation="true" CssClass="form-control input-sm"></asp:TextBox>
<label>días inhábiles</label>
</div>
</div>
</div>
<%--Motivo
<asp:TextBox ID="TxtMotivoVacaciones" runat="server" TextMode="MultiLine" Rows="4" CssClass="form-control Widthallimp"></asp:TextBox>--%>
</ContentTemplate>
</asp:UpdatePanel>
</div>

View File

@@ -1,7 +1,7 @@
Imports Extensiones
Imports System.Data
Partial Class Sistemas_PopUpAddUsuario
Inherits ClsPaginas
Inherits ClsPaginas
#Region "PROPIEDADES"
Public Property CveCliente As Integer
Get
@@ -51,7 +51,7 @@ Partial Class Sistemas_PopUpAddUsuario
Set(value As Integer)
ViewState("CvePlataforma") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
@@ -164,8 +164,14 @@ Partial Class Sistemas_PopUpAddUsuario
If ObjUsuario.UpdateUsuario(LtlUsuario.Text, TxtNombre.Text, -1, TxtEmail.Text, -1, -1, True, True, -1, CveUsuario, -1, -1) Then
Alert("La contraseña se reestableció correctamente a la contraseña por default '-acceso-'.")
Dim Liga As String = $"{Context.Request.Url.OriginalString.Substring(0, Context.Request.Url.OriginalString.Length - Context.Request.Url.PathAndQuery.Length)}/LogIn.aspx"
Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
EnviaCorreo(Liga, LigaActivar)
Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
If UsuarioActual.Empresa.CvePlataforma = 3 Then
EnviaCorreoGPS(Liga, LigaActivar)
Else
EnviaCorreo(Liga, LigaActivar)
End If
End If
End If
ObjUsuario.Dispose()
@@ -251,8 +257,14 @@ Partial Class Sistemas_PopUpAddUsuario
'ENVIA CORREO
If CveUsuario > 0 Then
Dim Liga As String = $"{Context.Request.Url.OriginalString.Substring(0, Context.Request.Url.OriginalString.Length - Context.Request.Url.PathAndQuery.Length)}/LogIn.aspx"
Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
Mensaje = EnviaCorreo(Liga, LigaActivar)
Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
If UsuarioActual.Empresa.CvePlataforma = 3 Then
Mensaje = EnviaCorreoGPS(Liga, LigaActivar)
Else
Mensaje = EnviaCorreo(Liga, LigaActivar)
End If
Else
HuboError = True
End If
@@ -651,16 +663,139 @@ Partial Class Sistemas_PopUpAddUsuario
OnError("Ocurrió error al mandar MAIL", ex)
End Try
Return Retorno
End Function
Private Function EnviaCorreoGPS(Liga As String, LigaActivar As String) As String
Dim Retorno As String = ""
Try
'Dim URL As String = "https://gps.signalsgps.com/" + LigaActivar
Dim Para = TxtEmail.Text.Trim
Dim Asunto = "ACCESO A SIGNALS GPS"
'Dim SBBody As New StringBuilder
''Linia de estilos
'SBBody.Append("<style> .mailbody{ background-color:#EEF1F5; padding:15px; font-family :'Open Sans', sans-serif; } .mailcontent{ background-color:#fff; font-size: 14px; color: #333; padding:0px 15px ; } .mailtitle{padding:8px;color:#32C5D2; font-size: 18px;font-weight: 700!important;border-bottom:2px solid #EEF1F5;text-transform: uppercase;}.marco{border: 1px solid #869ab3;border-top: 0;background-color: #67809F; margin: 10px 15px 25px 15px;color: #fff;}.marco-title{padding: 10px 10px;text-transform: uppercase;font-weight: 700!important;}.marco-body{color:#333;background-color:#fff;}.nota{background: #E5E5E5;padding:15px;color:#333;} .logo { font-size:12px; font-style:italic; text-align:right; } .col1{width:180px;font-weight: 700!important;display:inline-block;} .col2{min-width:260px;display:inline-block;} </style>")
''incio Cuerpo del correo
'SBBody.Append("<div Class='mailbody'>")
'SBBody.Append("<div Class='mailcontent'>")
'SBBody.Append("<div Class='mailtitle'>")
'SBBody.Append("ALTA DE CUENTA")
'SBBody.Append("</div>")
'SBBody.Append("<br/>")
'SBBody.AppendFormat("<b> Estimado {0}:</b><br/>", TxtNombre.Text.ToUpper)
'SBBody.AppendFormat("El presente correo es para informarle que se le han asignado los siguientes datos para el acceso a la Plataforma de: <b>{0}</b><br/><br/>", UsuarioActual.Empresa.Empresa)
'SBBody.Append("<div Class='marco'>")
'SBBody.Append("<div Class='marco-title'>Datos de usuario</div>")
'SBBody.Append("<div Class='marco-body'>")
'SBBody.Append("<div>")
'SBBody.Append("<div>")
'SBBody.Append("<div class='col1'> Usuario</div>")
'SBBody.AppendFormat("<div class='col2'>{0}</div>", TxtEmail.Text)
'SBBody.Append("</div>")
'SBBody.Append("<div>")
'SBBody.Append("<div class='col1'> Accesé al sistema dando click a la liga y estableciendo su contraseña</div>")
'SBBody.AppendFormat("<div class='col2'><a href='{0}'target='_blank'>Activar</a></div>", LigaActivar)
'SBBody.Append("</div>")
'SBBody.Append("</div>")
'SBBody.Append("</div>")
'SBBody.Append("<br/>")
'SBBody.Append("Para Activar su cuenta debera cambiar su contraseña.<br/><br/>")
'SBBody.Append("<div Class='nota'>")
'SBBody.Append("Nota Favor de NO responder este correo. ")
'SBBody.Append("</div><br/><br/>")
'SBBody.AppendFormat("<div class='logo'><img src='{0}Imagenes/LogoSinFondo.png' style='width:30px;'/>ADSistemas </div>", URL)
'SBBody.Append("</div>")
'SBBody.Append("</div>")
Dim SBBody As New StringBuilder()
SBBody.Append("<div>")
SBBody.Append("<div style ='border: none; border-bottom: solid #eef1f5 1.5pt; padding: 0in 0in 6.0pt 0in;'>")
SBBody.Append(" <table style='border-collapse: collapse;' border='0' cellspacing='0' cellpadding='0'>")
SBBody.Append(" <tbody>")
SBBody.Append(" <tr>")
SBBody.Append(" <td style='width: 65.55pt; padding: 0in 5.4pt 0in 5.4pt;' valign='top' width='87'>&nbsp;</td>")
SBBody.Append(" <td style='width: 376.5pt; padding: 0in 5.4pt 0in 5.4pt;' valign='bottom' width='502'>")
SBBody.Append(" <p class='MsoNormal' style='background: white;'><span style='font-size: 13.5pt; font-family: ' Avenir Next LT Pro Light',sans-serif; color: #c00000; text-transform: uppercase;'>DATOS DE ACCESO<u></u><u></u></span></p>")
SBBody.Append(" <p class='MsoNormal'><span style='font-size: 13.5pt; font-family: ' Avenir Next LT Pro Light',sans-serif; color: #c00000; text-transform: uppercase;'><u></u>&nbsp;<u></u></span></p>")
SBBody.Append(" </td>")
SBBody.Append(" </tr>")
SBBody.Append(" </tbody>")
SBBody.Append(" </table>")
SBBody.Append("</div>")
SBBody.AppendFormat(" <p Class='MsoNormal' style='margin-bottom: 12.0pt; background: white;'><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Avenir Next LT Pro Light',sans-serif; color: #404040;'><br /><strong>Estimado / a {0}:<u></u><u></u></strong></span></p>", TxtNombre.Text)
SBBody.Append(" <p Class='MsoNormal' style='margin-bottom: 12.0pt; background: white;'><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Avenir Next LT Pro Light',sans-serif; color: #333333;'>El presente correo es para informarle que se le han asignado los siguentes datos para el acceso</span><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Avenir Next LT Pro Light',sans-serif; color: black;'> a la plataforma </span><strong><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Avenir Next LT Pro Light',sans-serif; color: #c00000;'>SIGNALS GPS</span></strong><u></u><u></u></p>")
SBBody.Append(" <table style ='border-collapse: collapse;' border='0' cellspacing='0' cellpadding='0'>")
SBBody.Append(" <tbody>")
SBBody.Append(" <tr style='height: 21.25pt;'>")
SBBody.Append(" <td style='width: 441.4pt; border: none; border-bottom: solid #c00000 1.0pt; background: #e7e6e6; padding: 5.4pt 5.4pt 5.4pt 5.4pt; height: 21.25pt;' valign='bottom' width='589'>")
SBBody.Append(" <p class='MsoNormal' style='margin-bottom: 12.0pt; text-align: center;' align='center'><strong><span style='font-family: ' Avenir Next LT Pro Light',sans-serif; color: #c00000;'>USUARIO ASIGNADO</span></strong><u></u><u></u></p>")
SBBody.Append(" </td>")
SBBody.Append(" </tr>")
SBBody.Append(" <tr>")
SBBody.Append(" <td style='width: 441.4pt; border: none; border-bottom: solid #c00000 1.0pt; padding: 5.4pt 5.4pt 5.4pt 5.4pt;' valign='top' width='589'>")
SBBody.Append(" <p class='MsoNormal' style='margin-bottom: 12.0pt;'><strong><span style='font-family: ' Arial Nova Light',sans-serif; color: #c00000;'>Usuario</span></strong><span style='font-family: ' Arial Nova Light',sans-serif; color: #c00000;'>:<u></u><u></u></span></p>")
SBBody.AppendFormat(" <p class='MsoNormal' style='margin-bottom: 12.0pt;'><span style='font-family: ' Arial Nova Light',sans-serif;'><a href='mailto:{0}' target='_blank' rel='noopener'>{0}</a><u></u><u></u></span></p>", TxtEmail.Text)
SBBody.Append(" </td>")
SBBody.Append(" </tr>")
SBBody.Append(" <tr>")
SBBody.Append(" <td style='width: 441.4pt; padding: 5.4pt 5.4pt 5.4pt 5.4pt;' valign='top' width='589'>")
SBBody.Append(" <p class='MsoNormal' style='margin-bottom: 12.0pt;'><strong><span style='font-family: ' Arial Nova Light',sans-serif; color: #c00000;'>Contrase&ntilde;a</span></strong><span style='font-family: ' Arial Nova Light',sans-serif; color: #c00000;'>:<u></u><u></u></span></p>")
SBBody.Append(" <p class='MsoNormal' style='margin-bottom: 12.0pt;'><span style='font-size: 9.0pt; font-family: ' Arial',sans-serif; color: #333333; background: white;'>-acceso-</span><u></u><u></u></p>")
SBBody.Append(" </td>")
SBBody.Append(" </tr>")
SBBody.Append(" <tr>")
SBBody.Append(" <td style='width: 441.4pt; background: #c00000; padding: 5.4pt 5.4pt 5.4pt 5.4pt;' valign='top' width='589'>")
SBBody.AppendFormat(" <p class='MsoNormal' style='margin-bottom: 12.0pt; text-align: center;' align='center'><strong><span style='font-size: 22.0pt; font-family: ' Segoe UI Emoji',sans-serif; color: white;'><img class='CToWUd' style='margin: 0 0.2ex; vertical-align: middle; max-height: 24px;' src='https://mail.google.com/mail/e/1f446' alt='👆' data-goomoji='1f446' data-image-whitelisted=''/></span></strong><strong><span style='font-size: 22.0pt; font-family: ' Arial Nova Light',sans-serif; color: white;'><a href='{0}' target='_blank' rel='noopener' data-saferedirecturl='https://www.google.com/url?q={0}&amp;source=gmail&amp;ust=1617928195657000&amp;usg=AFQjCNGY8Tj8s35QxHYX-RPcqPlzZoBBFg'><span style='color: white;'>INGRESAR A SIGNALS GPS</span></a></span></strong><strong><span style='font-size: 22.0pt; font-family: ' Segoe UI Emoji',sans-serif; color: white;'><img class='CToWUd' style='margin: 0 0.2ex; vertical-align: middle; max-height: 24px;' src='https://mail.google.com/mail/e/1f446' alt='👆' data-goomoji='1f446' data-image-whitelisted=''/></span></strong><u></u><u></u></p>", LigaActivar)
SBBody.Append(" </td>")
SBBody.Append(" </tr>")
SBBody.Append("</tbody>")
SBBody.Append("</table>")
SBBody.Append("<div>")
SBBody.Append("<p Class='MsoNormal' style='margin-bottom: 12.0pt; background: white;'><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Arial Nova Light',sans-serif; color: #333333;'><br /></span><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Arial Nova Light',sans-serif; color: black;'>F</span><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Arial Nova Light',sans-serif; color: #333333;'>avor de NO responder este correo. <u></u><u></u></span></p>")
SBBody.Append("</div>")
SBBody.Append(" <p Class='MsoNormal' style='margin-bottom: 12.0pt; background: white;'><span lang='ES-MX' style='font-size: 10.5pt; font-family: 'Arial Nova Light',sans-serif; color: #333333;'><u></u>&nbsp;<u></u></span></p>")
SBBody.Append("</div>")
'Termino Cuerpo del correo
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo(Asunto, Para, SBBody.ToString))
Hilo.Start()
'Dim JSBTN As String = ""
'If UsuarioActual.CveCliente > 0 Then
' JSBTN = $"document.location.href=""javascript: Ir2({CveCliente})"";"
'ElseIf CveCliente > 0 Then
' JSBTN = $"document.location.href=""javascript:Ir({CveCliente})"";"
'End If
'If UsuarioActual.Empresa.CvePlataforma = 3 Then
' Alert("El correo se ha enviado correctamente a: " + TxtEmail.Text + ".", TipoMensaje.MsgInformacion, JSBTN)
'End If
Retorno = $"El correo se ha enviado correctamente a: <b>{TxtEmail.Text}</b>."
Catch ex As Exception
OnError("Ocurrió error al mandar MAIL", ex)
End Try
Return Retorno
End Function
Private Sub MandaCorreo(Asunto As String, Para As String, Body As String)
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
a.GuardaLog()
Dim Mail As New ClsSisMail()
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
End Sub
#End Region
Dim EmpresaEnvio As Empresa = ClsPaginas.EmpresaNotificaciones
If UsuarioActual.Empresa.CvePlataforma = 3 Then
EmpresaEnvio = ClsPaginas.EmpresaNotificacionesGPS
End If
Mail.SendMail(EmpresaEnvio, Para, Asunto, Body)
End Sub
#End Region
#Region "M O D U L O S"
Public Sub CargaModulosAcceso()
Dim ObjPermisos As New ClsSisUsuarios
@@ -808,11 +943,11 @@ Partial Class Sistemas_PopUpAddUsuario
End If
End If
End Sub
End Sub
#End Region
#Region "V E H I C U L O S"
Private Sub CargaDispositivos()
GvDispositivos.DataSource = GlobalDTDispositivos(CveCliente).FiltraParametros("Estatus = 1 ")
@@ -826,10 +961,10 @@ Partial Class Sistemas_PopUpAddUsuario
End If
End If
End If
End Sub
End Sub
#End Region
#Region "N O T I F I C A C I O N E S"
Private Sub CargarNotificaciones()
Dim ObjNotificaciones As New ClsSisNotificaciones
@@ -851,11 +986,11 @@ Partial Class Sistemas_PopUpAddUsuario
e.Row.FCCheckBox("chkApp").Checked = If(DtNotificacionesUsuarios.FiltroPrimeroValor("Alerta_App", $"CveNotificacion = {e.Row.DBCampo("CveNotificacion")}").ToString = "True", True, False)
End If
End If
End Sub
End Sub
#End Region
Protected Sub BtnCambiarUsuario_Click(sender As Object, e As EventArgs)
CveUsuario = -1

View File

@@ -6,7 +6,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="es">
<head runat="server" id="HeadAD">
<meta charset="utf-8" />
<title>Sistema de Información Gerencial</title>
<title id="tTitulo" runat="server">Sistema de Información Gerencial</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />

View File

@@ -76,6 +76,7 @@ Partial Class Site
If UsuarioActual.Empresa.CvePlataforma = 3 Then
lnkFavicon.Href = "/Imagenes/favicongps.ico"
tTitulo.Text = "SIGNALS GPS"
Else
lnkFavicon.Href = "/Imagenes/favicon.ico"
End If

View File

@@ -6274,8 +6274,6 @@ Partial Class PV
GvRecepcionUsados.DataSource = DtTamanios
GvRecepcionUsadosModal.DataSource = DtTamanios
DdlFolioGarantia.DataBind()
DdlTipoUso.DataBind()
DdlTipoDefecto.DataBind()
DdlFacturas.DataBind()

View File

@@ -756,8 +756,7 @@
</tr>
<tr align="left" id="TrServicioDomicilio" runat="server" visible="false">
<td><b>Servicio a Domicilio:</b>&nbsp;</td>
<td>
activado
<td>activado
</td>
</tr>
</table>
@@ -1263,7 +1262,7 @@
<asp:DropDownList runat="server" ID="DdlFR" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="FuenteRecaudacionCodigoRubroIngreso" DataValueField="CvePresupuestoIngreso" Style="max-width: 100px;" OnSelectedIndexChanged="DdlFR_SelectedIndexChanged"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<%--22--%>
<%--22--%>
<asp:BoundField DataField="TieneProntoPago" HeaderText="Pronto Pago" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ReadOnly="true" Visible="false" />
</Columns>
<RowStyle CssClass="Texto" />
@@ -1428,7 +1427,8 @@
<td>
<asp:TextBox ID="TxtSubTotal2" ClientIDMode="Static" runat="server" BorderStyle="None" Style="text-align: right;" Text="0.00" Width="78px"></asp:TextBox></td>
<td>
<asp:LinkButton ID="LkbAgregarComplementos" runat="server" CssClass="btn btn-circle btn-xs gray" Text="<i class='fa fa-bell '></i>"></asp:LinkButton></td>
<%-- <asp:LinkButton ID="LkbAgregarComplementos" runat="server" CssClass="btn btn-circle btn-xs gray" Text="<i class='fa fa-bell '></i>"></asp:LinkButton>--%>
</td>
</tr>
<tr align="right">
@@ -2210,8 +2210,7 @@
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" class="TextTab">
<tr valign="top">
<td>
<td rowspan="2" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
<div class="portlet-title">
<div class="caption font-green">
@@ -2343,8 +2342,7 @@
</div>
</div>
</td>
<td>
<td rowspan="1" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
<div class="portlet-title">
<div class="caption font-green">
@@ -2435,123 +2433,7 @@
</div>
</div>
</td>
<td>
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">7Eleven</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="form-body">
<table border="0">
<tr align="left">
<td>Proveedor:&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox ID="Txt7ElevenNumProveedor" CssClass="form-control input-sm" runat="server" Enabled="False"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>Folio:&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox ID="Txt7ElevenFolio" CssClass="form-control input-sm" runat="server"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>Tienda:&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox type="number" CssClass="form-control input-sm" ID="Txt7ElevenTienda" runat="server"></asp:TextBox><label></label><i></i>
</div>
<%--<ajax:MaskedEditExtender runat="server" ID="MEE7ElevenTienda" TargetControlID="Txt7ElevenTienda" MaskType="Number" Mask="999999" AcceptNegative="Left" MessageValidatorTip="true"></ajax:MaskedEditExtender>--%>
</td>
</tr>
<tr align="left">
<td>Fecha:&nbsp;</td>
<td>
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="Txt7ElevenFecha" CssClass="form-control" runat="server" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:HyperLink ID="ImgCalendario7ElevenFecha" class="btn default" runat="server"><i class="fa fa-calendar"></i></asp:HyperLink>
</span>
<ajax:MaskedEditExtender ID="MEE7ElevenFecha" runat="server" TargetControlID="Txt7ElevenFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario7ElevenFecha" runat="server" TargetControlID="Txt7ElevenFecha" PopupButtonID="ImgCalendario7ElevenFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFecha7Eleven" runat="server" ControlToValidate="Txt7ElevenFecha" Display="None" ErrorMessage="El campo <b>''Fecha de Orden de Compra''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCORFV7Eleven1Fecha" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha7Eleven" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">FORD</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="form-body">
<table border="0">
<tr align="left">
<td>GSDB:&nbsp;&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtFordGSDB" CssClass="form-control input-sm" runat="server" MaxLength="5"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>ASN :&nbsp;&nbsp;</td>
<td>
<div class="form-group form-md-line-input" style="width: 120px; display: inline-block">
<asp:TextBox ID="TxtFordASN" CssClass="form-control input-sm" size="15" runat="server" MaxLength="20"></asp:TextBox><label></label>
</div>
&nbsp;
<asp:LinkButton ID="LnkASN" runat="server" CssClass="fa fa-plus" ValidationGroup="GrpFordASN"></asp:LinkButton>
<asp:RequiredFieldValidator ID="RFVFordASN" runat="server" ControlToValidate="TxtFordASN" ErrorMessage="Ingrese ASN" ValidationGroup="GrpFordASN"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td></td>
<td>
<asp:ListBox ID="LstFordASN" Width="130px" runat="server"></asp:ListBox>
<asp:LinkButton ID="LnkFordQuitar" runat="server" CssClass="fa fa-minus"></asp:LinkButton>
</td>
</tr>
</table>
</div>
</div>
</div>
<br />
<td rowspan="1" colspan="2">
<div class="portlet light xspadding bordered whitoutcol" style="width: 850px;">
<div class="portlet-title">
<div class="caption font-green">
@@ -2723,6 +2605,230 @@
</div>
</td>
</tr>
<tr valign="top">
<td rowspan="1" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">7Eleven</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="form-body">
<table border="0">
<tr align="left">
<td>Proveedor:&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox ID="Txt7ElevenNumProveedor" CssClass="form-control input-sm" runat="server" Enabled="False"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>Folio:&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox ID="Txt7ElevenFolio" CssClass="form-control input-sm" runat="server"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>Tienda:&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox type="number" CssClass="form-control input-sm" ID="Txt7ElevenTienda" runat="server"></asp:TextBox><label></label><i></i>
</div>
<%--<ajax:MaskedEditExtender runat="server" ID="MEE7ElevenTienda" TargetControlID="Txt7ElevenTienda" MaskType="Number" Mask="999999" AcceptNegative="Left" MessageValidatorTip="true"></ajax:MaskedEditExtender>--%>
</td>
</tr>
<tr align="left">
<td>Fecha:&nbsp;</td>
<td>
<div class="input-group input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="Txt7ElevenFecha" CssClass="form-control" runat="server" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:HyperLink ID="ImgCalendario7ElevenFecha" class="btn default" runat="server"><i class="fa fa-calendar"></i></asp:HyperLink>
</span>
<ajax:MaskedEditExtender ID="MEE7ElevenFecha" runat="server" TargetControlID="Txt7ElevenFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario7ElevenFecha" runat="server" TargetControlID="Txt7ElevenFecha" PopupButtonID="ImgCalendario7ElevenFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFecha7Eleven" runat="server" ControlToValidate="Txt7ElevenFecha" Display="None" ErrorMessage="El campo <b>''Fecha de Orden de Compra''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCORFV7Eleven1Fecha" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha7Eleven" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</td>
<td rowspan="1" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">FORD</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="form-body">
<table border="0">
<tr align="left">
<td>GSDB:&nbsp;&nbsp;</td>
<td>
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtFordGSDB" CssClass="form-control input-sm" runat="server" MaxLength="5"></asp:TextBox><label></label><i></i>
</div>
</td>
</tr>
<tr align="left">
<td>ASN :&nbsp;&nbsp;</td>
<td>
<div class="form-group form-md-line-input" style="width: 120px; display: inline-block">
<asp:TextBox ID="TxtFordASN" CssClass="form-control input-sm" size="15" runat="server" MaxLength="20"></asp:TextBox><label></label>
</div>
&nbsp;
<asp:LinkButton ID="LnkASN" runat="server" CssClass="fa fa-plus" ValidationGroup="GrpFordASN"></asp:LinkButton>
<asp:RequiredFieldValidator ID="RFVFordASN" runat="server" ControlToValidate="TxtFordASN" ErrorMessage="Ingrese ASN" ValidationGroup="GrpFordASN"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td></td>
<td>
<asp:ListBox ID="LstFordASN" Width="130px" runat="server"></asp:ListBox>
<asp:LinkButton ID="LnkFordQuitar" runat="server" CssClass="fa fa-minus"></asp:LinkButton>
</td>
</tr>
</table>
</div>
</div>
</div>
</td>
<td rowspan="1" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 450px;">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Complementos INE</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="form-body">
<div class="row">
<div class="modal-body col-md-6" style="border-right: 1px solid lightgray;">
<asp:UpdatePanel runat="server" ID="UpComplementos" UpdateMode="Conditional">
<ContentTemplate>
<asp:RadioButtonList ID="RblComplementos" runat="server" AutoPostBack="true" CssClass="rbl" DataValueField="CveVentaComplemento" DataTextField="VentaComplemento" RepeatLayout="Table">
</asp:RadioButtonList>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-body col-md-6">
<asp:UpdatePanel runat="server" ID="UpDatosComplementos" UpdateMode="Conditional">
<ContentTemplate>
<table>
<tr id="trTipoCampaña" runat="Server" visible="False">
<td>Tipo Campaña:</td>
<td>
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlTipoCampaña" runat="server">
<asp:ListItem Text="Campaña" Value="Campaña" />
<asp:ListItem Text="Precampaña" Value="Precampaña" />
</asp:DropDownList>
</td>
</tr>
<tr id="trAmbito" runat="Server" visible="False">
<td>Ambito:</td>
<td>
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlAmbitoComplemento" runat="server">
<asp:ListItem Text="Local" Value="Local" />
<asp:ListItem Text="Federal" Value="Federal" />
</asp:DropDownList>
</td>
</tr>
<tr id="trEntidad" runat="Server" visible="False">
<td>Entidad:</td>
<td>
<asp:DropDownList CssClass="form-control input-sm select2me" ID="DdlINEEntidad" runat="server" AutoPostBack="true">
<asp:ListItem Text="AGU" Value="AGU" />
<asp:ListItem Text="BCN" Value="BCN" />
<asp:ListItem Text="BCS" Value="BCS" />
<asp:ListItem Text="CAM" Value="CAM" />
<asp:ListItem Text="CHP" Value="CHP" />
<asp:ListItem Text="CHH" Value="CHH" />
<asp:ListItem Text="COA" Value="COA" />
<asp:ListItem Text="COL" Value="COL" />
<asp:ListItem Text="DIF" Value="DIF" />
<asp:ListItem Text="DUR" Value="DUR" />
<asp:ListItem Text="GUA" Value="GUA" />
<asp:ListItem Text="GRO" Value="GRO" />
<asp:ListItem Text="HID" Value="HID" />
<asp:ListItem Text="JAL" Value="JAL" />
<asp:ListItem Text="MEX" Value="MEX" />
<asp:ListItem Text="MIC" Value="MIC" />
<asp:ListItem Text="MOR" Value="MOR" />
<asp:ListItem Text="NAY" Value="NAY" />
<asp:ListItem Text="NLE" Value="NLE" />
<asp:ListItem Text="OAX" Value="OAX" />
<asp:ListItem Text="PUE" Value="PUE" />
<asp:ListItem Text="QTO" Value="QTO" />
<asp:ListItem Text="ROO" Value="ROO" />
<asp:ListItem Text="SLP" Value="SLP" />
<asp:ListItem Text="SIN" Value="SIN" />
<asp:ListItem Text="SON" Value="SON" />
<asp:ListItem Text="TAB" Value="TAB" />
<asp:ListItem Text="TAM" Value="TAM" />
<asp:ListItem Text="TLA" Value="TLA" />
<asp:ListItem Text="VER" Value="VER" />
<asp:ListItem Text="YUC" Value="YUC" />
<asp:ListItem Text="ZAC" Value="ZAC" />
</asp:DropDownList>
</td>
</tr>
<tr id="trContaComplementos" runat="Server" visible="False">
<td>Id Conta:</td>
<td>
<asp:TextBox ID="TxtIdConta" runat="server" MaxLength="6" Width="100px"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVIdConta" runat="server" ControlToValidate="TxtIdConta" Display="None" ErrorMessage="El campo <b>''Id Conta''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." ValidationExpression="^([1-9]{1}[\d]{0,2}(\,[\d]{3})*(\.[\d]{0,4})?|[1-9]{1}[\d]{0,}(\.[\d]{0,4})?|0(\.[\d]{0,2})?|(\.[\d]{1,4})?)$" ValidationGroup="GrpComplementosTimbrado"></asp:RegularExpressionValidator>
<ajax:ValidatorCalloutExtender ID="VCEIdConta" runat="server" HighlightCssClass="vco" TargetControlID="REVIdConta" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
@@ -2840,9 +2946,9 @@
<div class="col-md-5">
<asp:RadioButtonList ID="RBLTipoContrato" AppendDataBoundItems="true" OnSelectedIndexChanged="RBLTipoContrato_SelectedIndexChanged" AutoPostBack="true" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Venta" Value="2" Selected="True" />
<asp:ListItem Text="Suministro" Value="1" />
<asp:ListItem Text="Suministro" Value="1" />
<asp:ListItem Text="Obra" Value="4" />
</asp:RadioButtonList>
</div>
<div class="col-md-6">
@@ -3366,7 +3472,7 @@
<div class="row">
<div class="col-md-6">
</div>
<label id="lblCambio" class="col-md-2">Cambio:</label>
<label id="lblCambio" class="col-md-2">Cambio:</label>
<div class="col-md-4 input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtCambio" CssClass="form-control input-sm " Enabled="false" runat="server" MaxLength="12" Width="100px" ClientIDMode="Static" Style="text-align: right;"></asp:TextBox>
@@ -3947,7 +4053,7 @@
</div>
</div>
<div id="ModalComplementos" class="modal ADS fade" role="dialog">
<%-- <div id="ModalComplementos" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 470px; min-width: 470px;">
<div class="modal-content">
@@ -4053,7 +4159,7 @@
</div>
</div>
</div>
</div>
</div>--%>
<%-- ******************************************** Corte de Caja *************************************************************************************************************************************** --%>
@@ -6060,7 +6166,8 @@
<div class="modal-body">
<div class="row">
<div class="col-md-2">
<label>Relación:</label></div>
<label>Relación:</label>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoRelacionARelacionar" CssClass=" form-control input-sm select2me" runat="server" Width="100%" DataTextField="SATTipoRelacion" DataValueField="CveTipoRelacion">
</asp:DropDownList>
@@ -6069,12 +6176,14 @@
<br />
<div id="DivDdlFacturaRela" runat="server" class="row">
<div class="col-md-2">
<label>Factura:</label></div>
<label>Factura:</label>
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlFacturaARelacionar" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="100%" CssClass="select2me"></asp:DropDownList>
</div>
<div class="col-md-2">
<asp:LinkButton ID="LnkAgregarFacturaRelacionada" runat="server" CssClass="btn btn-sm btn-primary" OnClick="LnkAgregarFacturaRelacionada_Click"><i class="fa fa-plus"></i>Agregar</asp:LinkButton></div>
<asp:LinkButton ID="LnkAgregarFacturaRelacionada" runat="server" CssClass="btn btn-sm btn-primary" OnClick="LnkAgregarFacturaRelacionada_Click"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
</div>
</div>
<br />
<div class="row">
@@ -6349,7 +6458,7 @@
<div class="col-md-12">
<asp:RadioButtonList ID="RblRNCTipo" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipo_SelectedIndexChanged">
<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</b></label></asp:ListItem>
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
<asp:ListItem Value="3" Class="one"><label><b>Ajuste/Garantía</b></label></asp:ListItem>
</asp:RadioButtonList>
</div>
@@ -6907,75 +7016,124 @@
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cargos</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<asp:RadioButtonList ID="RblRNCTipoDesc" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipoDesc_SelectedIndexChanged">
<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</b></label></asp:ListItem>
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
<asp:ListItem Value="3" Class="one"><label><b>Ajuste/Garantía</b></label></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
<div class="row" id="DivRNCCargoDesc" runat="server" visible="false">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<asp:CheckBox ID="ChkMostarProductosRNCDesc" runat="server" AutoPostBack="true" Text="Mostrar Productos" OnCheckedChanged="ChkMostarProductosRNCDesc_CheckedChanged" />
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="row" style="margin-right: 10px;" align="right">
<input type="text" id="TxtBusquedaNCCargos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvDescNCCargos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" AutoPostBack="true" OnCheckedChanged="ChkAplicarRNC_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Original", "{0:N2}") %>'></asp:Literal>
<asp:Literal ID="LtlAbrev" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div class="row" id="DivRNCCargoDescTotal" runat="server" visible="false">
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">
<asp:Literal ID="LtlCargoDesc" runat="server" Text="Cargo"></asp:Literal></span></span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
<tr align="right">
<td style="border: 1px none white"><b>Saldo Maximo Utilizable.:</b></td>
<td>
<asp:Label ID="LblSaldoMaximoUsados" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00"></asp:Label></td>
<td align="right">&nbsp;
</td>
</tr>
</table>
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
<div class="row" style="margin-right: 10px;" align="right">
<input type="text" id="TxtBusquedaNCCargos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvDescNCCargos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Original", "{0:N2}") %>'></asp:Literal>
<asp:Literal ID="LtlAbrev" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" id="DivRNCCargoDescDetalle" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvDescNCCargosDetalle" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta,CveVentaDetalleRNC,CvePS,PU,PorcentajeIVA" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidadRNC" runat="server" Text='<%#Eval("CantidadPendiente").ToString%>' MaxLength="12" Width="46px" Height="24px"></asp:TextBox>
<asp:RangeValidator ID="RVCantRNC" runat="server" Type="Double" MinimumValue="0" MaximumValue='<%#Eval("CantidadPendiente").ToString%>' ErrorMessage="Cantidad Excedida" ControlToValidate="TxtCantidadRNC" Display="None" ValidationGroup="VGAplicarRNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad3" runat="server" HighlightCssClass="vco" TargetControlID="RVCantRNC" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="TtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
<tr align="right">
<td style="border: 1px none white"><b>Saldo Maximo Utilizable.:</b></td>
<td>
<asp:Label ID="LblSaldoMaximoUsados" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00"></asp:Label></td>
<td align="right">&nbsp;
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="row" id="DivRNCBonificaciones" runat="server" visible="false">
<div class="row" id="DivRNCBonDesc" runat="server" visible="false">
<div class="col-md-12">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
@@ -7021,7 +7179,7 @@
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" />
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCBon" runat="server" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -7046,6 +7204,7 @@
</div>
</div>
<asp:HiddenField ID="HdnSaldoMaximoUsados" runat="server" ClientIDMode="Static" Value="0" />
<asp:HiddenField ID="HdnSMUBonDesc" runat="server" ClientIDMode="Static" Value="0" />
</div>
<div class="modal-footer">
<button id="CancelarAplicarDescNC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
@@ -7344,13 +7503,66 @@
}
function CalculaSaldoRNCBonChk(TxtImporte, Saldo, Chk) {
//if (Chk.checked) {
// TxtImporte.value = FormatoNumero(Saldo, 2);
//} else {
// TxtImporte.value = "";
//}
if (Chk.checked) {
TxtImporte.value = FormatoNumero(Saldo, 2);
let SaldoMaximoUtilizable = ToDouble(HdnSMUBonDesc.value)
let ImportesAsignados = 0;
$('.ImportesRNCBon').each(function () {
if ($(this).context.id != TxtImporte.id) {
ImportesAsignados += ToDouble($(this).val());
}
});
let Importe = SaldoMaximoUtilizable - ImportesAsignados;
if (Importe > 0) {
if (Saldo > Importe) {
TxtImporte.value = FormatoNumero(Importe, 2);
} else {
TxtImporte.value = FormatoNumero(Saldo, 2);
}
} else {
if (SaldoMaximoUtilizable > 0) {
TxtImporte.value = "";
Chk.checked = false;
} else {
TxtImporte.value = FormatoNumero(Saldo, 2);
}
}
} else {
TxtImporte.value = "";
}
}
function LimitaSaldoRNCBonChk(TxtImporte, Saldo) {
//var Importe = 0;
//if (TxtImporte.value.includes('.')) {
// return;
//}
//if (TxtImporte.value.includes(',')) {
// return;
//}
//var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$");
//if (regex.test(TxtImporte.value)) {
// if (TxtImporte.value != '') {
// Importe = parseFloat(TxtImporte.value);
// }
// if (Importe > Saldo) {
// TxtImporte.value = FormatoNumero(Saldo, 2);
// } else {
// TxtImporte.value = FormatoNumero(Importe, 2);;
// }
//}
var Importe = 0;
if (TxtImporte.value.includes('.')) {
@@ -7367,8 +7579,17 @@
Importe = parseFloat(TxtImporte.value);
}
if (Importe > Saldo) {
TxtImporte.value = FormatoNumero(Saldo, 2);
let SaldoMaximoUtilizable = parseFloat(HdnSMUBonDesc.value)
let ImportesAsignados = 0;
$('.ImportesRNCBon').each(function () {
if ($(this).context.id != TxtImporte.id) {
ImportesAsignados += ToDouble($(this).val());
}
});
let ImporteDiferencia = SaldoMaximoUtilizable - ImportesAsignados;
if (Importe > ImporteDiferencia) {
TxtImporte.value = FormatoNumero(ImporteDiferencia, 2);
} else {
TxtImporte.value = FormatoNumero(Importe, 2);;
}
@@ -8402,99 +8623,99 @@
function ConvertirDolares(ChkConvertirDolares) {
//LIMPIA
$('#<%= LblDolaresConvertidos.ClientID %>').text('');
$("#TrConversionDolaresTexto").hide();
//CALCULA
if (ChkConvertirDolares.checked) {
ConvertirPesosDlls();
}
}
//FUNCIONES PARA MODAL "ModalAplicarNC"
function CalculaImporteNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value);
$get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2);
}
function CalculaPorcentajeNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value);
$get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4);
}
function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) {
debugger;
if (tipocambio.value.length > 0) {
if (CveMoneda == 1) {
txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2);
} else {
txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2);
$("#TrConversionDolaresTexto").hide();
//CALCULA
if (ChkConvertirDolares.checked) {
ConvertirPesosDlls();
}
}
}
function BuscarOCRegistrada() {
$('#btnBuscarOCRegistrada').click();
}
//FUNCIONES PARA MODAL "ModalAplicarNC"
function CalculaImporteNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value);
function ValidaAnticipoBoton() {
$get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2);
}
var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2);
var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2);
function CalculaPorcentajeNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value);
$get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4);
}
var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex'));
function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) {
debugger;
if (tipocambio.value.length > 0) {
if (CveMoneda == 1) {
txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2);
} else {
txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2);
}
}
}
function BuscarOCRegistrada() {
$('#btnBuscarOCRegistrada').click();
}
function ValidaAnticipoBoton() {
var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2);
var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2);
var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex'));
if (IndexActualDdl == 1 && IndexActualDd2 > 0 && TotalAnticipos > 0) {
if (IndexActualDdl == 1 && IndexActualDd2 > 0 && TotalAnticipos > 0) {
if (TotalAnticipos > 0) {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false);
if (TotalAnticipos > 0) {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false);
} else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
}
} else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
}
} else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
}
}
function showDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');
$('#<%= TxtCPCliente.ClientID %>').val('');
$('#<%= TxtColoniaCliente.ClientID %>').val('');
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
$('#<%= TxtCiudadCliente.ClientID %>').val('');
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
$('#<%= DdlSATPais.ClientID %>').val('');
$('#<%= DdlEstadoSAT.ClientID %>').val('');
$('#<%= TxtCorreoCliente.ClientID %>').val('');
function showDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val('');
$('#<%= TxtNumIntCliente.ClientID %>').val('');
$('#<%= TxtCPCliente.ClientID %>').val('');
$('#<%= TxtColoniaCliente.ClientID %>').val('');
$('#<%= TxtTelefonoCliente.ClientID %>').val('');
$('#<%= TxtCiudadCliente.ClientID %>').val('');
$('#<%= TxtLocalidadCliente.ClientID %>').val('');
$('#<%= DdlSATPais.ClientID %>').val('');
$('#<%= DdlEstadoSAT.ClientID %>').val('');
$('#<%= TxtCorreoCliente.ClientID %>').val('');
$('#divAgregarCliente').modal();
}
$('#divAgregarCliente').modal();
}
function hideDivEC() {
$('#divAgregarCliente').modal('hide');
}
function hideDivEC() {
$('#divAgregarCliente').modal('hide');
}
var ValidarRNC = false;
function AplicarValidarRNC(Valor) {
ValidarRNC = Valor;
}
function CompararNC() {
if (ValidarRNC) {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
var ValidarRNC = false;
function AplicarValidarRNC(Valor) {
ValidarRNC = Valor;
}
function CompararNC() {
if (ValidarRNC) {
var TotalRem = ToDouble(document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').value);
var TotalNC = ToDouble(document.getElementById('<%= TxtNCImporte.ClientID %>').value);
if (TotalRem == TotalNC) {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431";
if (TotalRem == TotalNC) {
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.border = "2px solid #04B431";
document.getElementById('<%= TxtImportesRemisionesNC.ClientID %>').style.color = "";
document.getElementById('<%= TxtNCImporte.ClientID %>').style.color = "";
@@ -8519,22 +8740,22 @@
var verficaRNC = function () {
var total = 0;
if ('<%= UsuarioActual.CveEmpresa %>' == '140') {
$(".ChkAplicaRNC > input").each(function () {
if (this.checked) {
total = total + 1;
}
if (total == 2) {
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
this.checked = false;
return false;
}
});
}
};
$(".ChkAplicaRNC > input").each(function () {
if (this.checked) {
total = total + 1;
}
if (total == 2) {
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
this.checked = false;
return false;
}
});
}
};
function showDivAgregarSucursal() {
function showDivAgregarSucursal() {
$('#<%= TxtNombreSucursal.ClientID %>').val('');
$('#<%= TxtNombreSucursal.ClientID %>').val('');
$('#<%= TxtDireccionSucursal.ClientID %>').val('');
$('#<%= TxtNumExtSucursal.ClientID %>').val('');
$('#<%= TxtNumIntSucursal.ClientID %>').val('');

File diff suppressed because it is too large Load Diff

View File

@@ -210,6 +210,16 @@