This commit is contained in:
rrene
2020-12-04 12:14:22 -07:00
38 changed files with 2933 additions and 1649 deletions

View File

@@ -120,6 +120,83 @@ Public Class ClsClaseBase
SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor
End If
End Sub
Public Function runQuerystr(Query As String, Optional Listaparametros As List(Of parametroQuery) = Nothing, Optional msgError As String = "", Optional mostrarError As Boolean = True) As Boolean
Dim retorno As Boolean = False
Try
If SqlConexion.State = ConnectionState.Open Then
SqlAdapter.SelectCommand.Parameters.Clear()
SqlAdapter.SelectCommand.CommandText = Query
SqlAdapter.SelectCommand.CommandType = CommandType.Text
Data = New DataTable()
If Not IsNothing(Listaparametros) Then
For Each pr As parametroQuery In Listaparametros
If Not IsNothing(pr.SqlDataType) Then
If Not IsNothing(pr.ParameterDirection) Then
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection
Else
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = If(Not IsNothing(pr.SqlValue), pr.SqlValue, DBNull.Value)
End If
Else
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue)
End If
Next
End If
SqlAdapter.Fill(Data)
retorno = True
Else
Dim InfoAdicional As String = "Se intenta realizar una conexion con una conexion cerrada"
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}"
GuardaLog(InfoAdicional)
End If
Catch sqEx As SqlException
retorno = False
setOnError(msgError, sqEx)
Catch ex As Exception
retorno = False
setOnError(msgError, ex)
End Try
Return retorno
End Function
Public Function ExecQuery(Query As String, Optional Listaparametros As List(Of parametroQuery) = Nothing, Optional msgError As String = "", Optional mostrarError As Boolean = True) As Integer
Dim retorno As Integer = -1
Try
If SqlConexion.State = ConnectionState.Open Then
SqlAdapter.SelectCommand.Parameters.Clear()
SqlAdapter.SelectCommand.CommandText = Query
SqlAdapter.SelectCommand.CommandType = CommandType.Text
If Not IsNothing(Listaparametros) Then
For Each pr As parametroQuery In Listaparametros
If Not IsNothing(pr.SqlDataType) Then
If Not IsNothing(pr.ParameterDirection) Then
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection
Else
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = If(Not IsNothing(pr.SqlValue), pr.SqlValue, DBNull.Value)
End If
Else
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue)
End If
Next
End If
retorno = SqlAdapter.SelectCommand.ExecuteNonQuery()
Else
Dim InfoAdicional As String = "Se intenta realizar una conexion con una conexion cerrada"
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}"
GuardaLog(InfoAdicional)
End If
Catch sqEx As SqlException
retorno = -1
setOnError(msgError, sqEx)
Catch ex As Exception
retorno = -1
setOnError(msgError, ex)
End Try
Return retorno
End Function
Protected Function RunQuery(msgOnError As String) As Boolean
Dim retorno As Boolean = False
@@ -203,3 +280,19 @@ Public Class ClsClaseBase
End Sub
End Class
Public Class parametroQuery
Public Sub New(parameterName As String, sqlValue As Object, Optional sqlDataType As SqlDbType = Nothing, Optional parameterDirection As ParameterDirection = Nothing)
Me.ParameterName = parameterName
Me.SqlDataType = sqlDataType
Me.ParameterDirection = parameterDirection
Me.SqlValue = sqlValue
End Sub
Public Property ParameterName As String
Public Property SqlDataType As SqlDbType
Public Property ParameterDirection As ParameterDirection
Public Property SqlValue As Object
End Class

View File

@@ -360,7 +360,7 @@ Public Class ClsInventarios
End Function
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean
Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_AlmacenesAdd")
@@ -377,7 +377,7 @@ Public Class ClsInventarios
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
.Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual
End With
Try
@@ -396,7 +396,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1) As Boolean
Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_AlmacenesUpdate")
@@ -413,6 +413,7 @@ Public Class ClsInventarios
.Add("@Orden", SqlDbType.SmallInt).Value = Orden
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CveUsuarioAutoriza", SqlDbType.Int).Value = CveUsuarioAutoriza
.Add("@CveAlmacenVirtual", SqlDbType.Int).Value = CveAlmacenVirtual
End With

View File

@@ -2524,7 +2524,7 @@ Public Class ClsOC
End Function
#End Region
#Region "REP SOLICITUDES ANTICIPO"
Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer) As Boolean
Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer, Optional CveUsuario As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RepSolicitudAnticipoGet")
@@ -2534,6 +2534,8 @@ Public Class ClsOC
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
.Add("@CveEventoEstatus", SqlDbType.Int).Value = CveEventoEstatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With
Try

View File

@@ -4860,6 +4860,7 @@ Public Class ClsPaginas
PaginaDict.Add("/RH/SolicitudViaticos.aspx".ToUpper(), 663)
PaginaDict.Add("/RH/ReporteViaticos.aspx".ToUpper(), 664)
PaginaDict.Add("/RH/MiPerfil.aspx".ToUpper(), -1) ' se dejará libre el módulo para que cualquier que tenga cvepersonal, pueda acceder
PaginaDict.Add("/RH/CatChecadores.aspx".ToUpper(), 694)
#End Region
#Region "Sistema"
'Cargo las páginas que deben tener restricción
@@ -6753,7 +6754,7 @@ Public Class ClsPaginas
End If
'ECONOLLANTAS - AGREGAR QR DE DESCARGA
If UsuarioActual.CveEmpresa = 141 Then
If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then
Dim QRDescarga As String = ""
Dim cfdi As New RVCFDI33.GeneraCFDI()

View File

@@ -2135,6 +2135,74 @@ Public Class ClsProductosServicios
End Try
Return Retorno
End Function
End Function
Public Function GetProductosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ProductosModificadosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los productos modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetPreciosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ProductosPreciosModificadosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los precios modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetExistenciasEmpresa(Codigo As String, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ProductosExistenciasEmpresaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function GetVendedoresModificados(CveEmpresa As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VendedoresModificadosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener los vendedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
End Class

View File

@@ -41,36 +41,36 @@ Public Class ClsRH
Public Sub Commit()
SqlTransacc.Commit()
End Sub
End Sub
#End Region
#Region "Propiedades"
Public ReadOnly Property DSResultados() As DataSet
Get
DSResultados = DSet
End Get
End Property
End Property
#End Region
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
Try
SqlConexion.Open()
Catch ex As Exception
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try
Else
SqlConexion = TransaccionCompartida.Connection
SqlTransacc = TransaccionCompartida
EsTransaccionCompartida = True
End If
SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
Try
SqlConexion.Open()
Catch ex As Exception
OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
End Try
Else
SqlConexion = TransaccionCompartida.Connection
SqlTransacc = TransaccionCompartida
EsTransaccionCompartida = True
End If
SqlAdapter = New SqlDataAdapter("", SqlConexion)
ConexionAdd()
End Sub
Private Sub DataAdapter(pStrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
With SqlAdapter.SelectCommand
@@ -80,23 +80,23 @@ Public Class ClsRH
End With
Data = New DataTable
End Sub
Private CveConexion As Integer = 0
Private EsTransaccionCompartida As Boolean = False
Private CveConexion As Integer = 0
Private EsTransaccionCompartida As Boolean = False
#Region "Conexiones"
Private Sub ConexionAdd()
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
Try
DataAdapter("PA_Sis_RegistrarConexion")
With SqlAdapter.SelectCommand.Parameters
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
Try
DataAdapter("PA_Sis_RegistrarConexion")
With SqlAdapter.SelectCommand.Parameters
.Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
.Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
End With
SqlAdapter.Fill(Data)
CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
@@ -141,7 +141,7 @@ Public Class ClsRH
Return Retorno
End Function
Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer,
Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer,
chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean
Dim Retorno As Boolean = False
@@ -178,7 +178,7 @@ Public Class ClsRH
Return Retorno
End Function
Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer,
Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer,
chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean
Dim Retorno As Boolean = False
@@ -1549,7 +1549,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer,
CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer,
CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer,
FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer,
FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer,
CveEmpresa As Integer, Optional TopSelect As Integer = 10000) As Boolean
Dim Retorno As Boolean = False
@@ -1820,8 +1820,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CelularPersonal", SqlDbType.VarChar).Value = CelularPersonal
.Add("@TelefonoMarcadoRapido", SqlDbType.VarChar).Value = TelefonoMarcadoRapido
.Add("@ContactoAlterno", SqlDbType.VarChar).Value = ContactoAlterno
.Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario
.Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
@@ -1937,8 +1937,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@FechaActivo", SqlDbType.Date).Value = FechaActivo
.Add("@FechaReingreso", SqlDbType.Date).Value = FechaReingreso
.Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario
.Add("@CveTipodeSalario", SqlDbType.Int).Value = CveTipodeSalario
End With
Try
@@ -1955,16 +1955,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Try
Return Retorno
End Function
Public Function UpdateSalariointegrado(CvePersonal As Integer, CveEmpresa As Integer, SDI As Double, SalarioDiario As Double) As Boolean
End Function
Public Function UpdateSalariointegrado(CvePersonal As Integer, CveEmpresa As Integer, SDI As Double, SalarioDiario As Double) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalUpdateSalarioIntegrado")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@SDI", SqlDbType.Money).Value = SDI
.Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario
.Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario
End With
Try
SqlAdapter.Fill(Data)
@@ -1973,8 +1973,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateSalarios(CvePersonal As Integer, Fecha As String, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, SalarioDiarioPago As Double, Optional CalcularSDI As Boolean = False) As Boolean
End Function
Public Function UpdateSalarios(CvePersonal As Integer, Fecha As String, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, SalarioDiarioPago As Double, Optional CalcularSDI As Boolean = False) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalUpdateSalarios")
With SqlAdapter.SelectCommand.Parameters
@@ -1985,7 +1985,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario
.Add("@SDI", SqlDbType.Money).Value = SDI
.Add("@SalarioDiarioSS", SqlDbType.Money).Value = SalarioDiarioSS
.Add("@CalcularSDI", SqlDbType.Bit).Value = CalcularSDI
.Add("@CalcularSDI", SqlDbType.Bit).Value = CalcularSDI
End With
Try
SqlAdapter.Fill(Data)
@@ -1994,16 +1994,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetMovimientosToSUA(CveEmpresa As Integer, FechaI As String, FechaF As String) As Boolean
End Function
Public Function GetMovimientosToSUA(CveEmpresa As Integer, FechaI As String, FechaF As String) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_MovimientosToSUA")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@FechaI", SqlDbType.VarChar).Value = FechaI
.Add("@FechaF", SqlDbType.VarChar).Value = FechaF
.Add("@FechaF", SqlDbType.VarChar).Value = FechaF
End With
Try
SqlAdapter.Fill(Data)
@@ -2012,17 +2012,17 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateRFCValidado(RFC As String, CveEmpresa As Integer, RFCValidadoisok As Boolean) As Boolean
End Function
Public Function UpdateRFCValidado(RFC As String, CveEmpresa As Integer, RFCValidadoisok As Boolean) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalUpdateRFCValidado")
With SqlAdapter.SelectCommand.Parameters
.Add("@RFC", SqlDbType.VarChar).Value = RFC
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@isOk", SqlDbType.Bit).Value = RFCValidadoisok
.Add("@isOk", SqlDbType.Bit).Value = RFCValidadoisok
End With
Try
SqlAdapter.Fill(Data)
@@ -2031,14 +2031,14 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
OnError("Ocurrió un error al intentar guardar los cambios en el Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function Updateestemporal(CvePersonal As Integer, CveEmpresa As Integer, estemporal As Boolean) As Boolean
End Function
Public Function Updateestemporal(CvePersonal As Integer, CveEmpresa As Integer, estemporal As Boolean) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalUpdateesTemporal")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@isOk", SqlDbType.Bit).Value = estemporal
.Add("@isOk", SqlDbType.Bit).Value = estemporal
End With
Try
SqlAdapter.Fill(Data)
@@ -2052,8 +2052,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double,
CvePersonal As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
Dim Retorno As Boolean = False
SqlDataAdapter("PA_RH_PersonalUpdateMasivo")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveTurno", SqlDbType.Int).Value = CveTurno
@@ -2391,8 +2391,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Try
Return Retorno
End Function
End Function
Public Function AddAsistenciaMasiva2(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -2418,9 +2418,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Try
Return Retorno
End Function
End Function
#End Region
#Region "Asistencias Detalles"
Public Function GetAsistenciasDetalle() As Boolean
Dim Retorno As Boolean = False
@@ -3442,7 +3442,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CveTurno", SqlDbType.Int).Value = RHRequerido.CveTurno
.Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad
.Add("@CveUsuario", SqlDbType.Int).Value = RHRequerido.CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa
.Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa
.Add("@CveDepartamento", SqlDbType.Int).Value = RHRequerido.CveDepartamento
End With
@@ -3464,8 +3464,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CveRequerimiento", SqlDbType.Int).Value = RHRequerido.CveRequerimiento
.Add("@CveSubProyecto", SqlDbType.Int).Value = RHRequerido.CveSubProyecto
.Add("@CveTurno", SqlDbType.Int).Value = RHRequerido.CveTurno
.Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad
.Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa
.Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad
.Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa
.Add("@CveDepartamento", SqlDbType.Int).Value = RHRequerido.CveDepartamento
End With
@@ -3480,13 +3480,13 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Function
Public Function RemovePersonalRequerido(CveRequerimiento As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_PersonalRequeridoRemove")
DataAdapter("PA_RH_PersonalRequeridoRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveRequerimiento", SqlDbType.Int).Value = CveRequerimiento
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveRequerimiento", SqlDbType.Int).Value = CveRequerimiento
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
@@ -3504,10 +3504,10 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
End Try
Return Retorno
End Function
End Function
#End Region
#Region "ClsRHReportePersonalNecesidades"
Public Function GetReportePersonalNecesidades(CveTurno As Integer, CveProyecto As Integer, tCveSubProyeto As Integer, Estatus As Integer, CveEmpresa As Integer, CveDepartamento As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -3529,9 +3529,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
OnError("Ocurrió un error al obtener el Reporte de Necesidades de Personal", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
End Function
#End Region
#Region "ClsRHReporteRotacionPersonal"
Public Function GetReporteRotacionPersonal(FechaInicio As Date, FechaFin As Date, CveTurno As Integer, CveProyecto As Integer, CveSubProyeto As Integer, CveEmpresa As Integer) As Boolean
@@ -3634,92 +3634,6 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
#Region "C H E C A D O R E S T A C I O N E S"
Public Function ChecadorEstacionesAdd(CveChecadorTipo As Integer, CveZonaHoraria As Integer, CveUsuario As Integer, CveEmpresa As Integer, ChecadorEstacion As String, Ip As String, Puerto As Integer, Estatus As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorEstacionesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecadorTipo", SqlDbType.Int).Value = CveChecadorTipo
.Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ChecadorEstacion", SqlDbType.VarChar).Value = ChecadorEstacion
.Add("@Ip", SqlDbType.VarChar).Value = Ip
.Add("@Puerto", SqlDbType.Int).Value = Puerto
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function ChecadorEstacionesUpdate(CveChecadorEstacion As Integer, CveChecadorTipo As Integer, CveZonaHoraria As Integer, CveUsuario As Integer, CveEmpresa As Integer, ChecadorEstacion As String, Ip As String, Puerto As Integer, Estatus As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorEstacionesUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion
.Add("@CveChecadorTipo", SqlDbType.Int).Value = CveChecadorTipo
.Add("@CveZonaHoraria", SqlDbType.Int).Value = CveZonaHoraria
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ChecadorEstacion", SqlDbType.VarChar).Value = ChecadorEstacion
.Add("@Ip", SqlDbType.VarChar).Value = Ip
.Add("@Puerto", SqlDbType.Int).Value = Puerto
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function ChecadorEstacionesRemove(CveChecadorEstacion As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorEstacionesRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function ChecadorEstacionesGet(CveChecadorEstacion As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorEstacionesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecadorEstacion", SqlDbType.Int).Value = CveChecadorEstacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el checador de estaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function DdlChecadorTipoGet(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_DdlChecadorTipoGet")
@@ -4158,16 +4072,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch exs As SqlException
If exs.Message.Contains("Número: 547;") Then
Catch exs As SqlException
If exs.Message.Contains("Número: 547;") Then
OnError("El Tema no se puede eliminar porque tiene registros relacionados..", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Else
OnError("El Tema no se puede eliminar porque tiene registros relacionados. TemasRemove.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End If
End If
'If exs.ErrorCode = -2146232060 Then
' OnError("Ocurrió al Eliminar el Tema Existen registros relacionadados.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
'Else
@@ -4463,7 +4377,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Beneficiario", SqlDbType.Bit).Value = Beneficiario
End With
@@ -4498,9 +4412,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Telefono", SqlDbType.VarChar).Value = Telefono
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@Beneficiario", SqlDbType.Int).Value = Beneficiario
.Add("@Beneficiario", SqlDbType.Int).Value = Beneficiario
End With
Try
@@ -6747,9 +6661,9 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
ListaTagsDocumentost.Add(New TagsDocumentos("{HoraInicioJornada}", DtResultados(0)("HorarioDe").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{HoraFinJornada}", DtResultados(0)("HorarioA").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{Salario}", ""))
ListaTagsDocumentost.Add(New TagsDocumentos("{HoraInicioJornada}", DtResultados(0)("HorarioDe").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{HoraFinJornada}", DtResultados(0)("HorarioA").ToString))
ListaTagsDocumentost.Add(New TagsDocumentos("{Salario}", ""))
ListaTagsDocumentost.Add(New TagsDocumentos("{MetodoPago}", DtResultados(0)("MetodoPago").ToString))
End If
@@ -6875,22 +6789,97 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
OnError("Ocurrió un error al obtener los pagos de factura de personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
End Function
#End Region
'Public msgsError As New StringBuilder()
'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "")
' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
' msgsError.AppendLine(Mensaje)
' msgsError.Append("<br/>")
' 'Alert(Obj, Mensaje, TipoMensaje.MsgError)
' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
'End Sub
#Region "Checador"
Public Function GetChecadores(CveChecador As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el listado de checadores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddChecadores(Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, CveUsuario As Integer, Optional CveModelo As Integer = 1, Optional Estatus As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@Checador", SqlDbType.NVarChar).Value = Checador
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal
.Add("@Puerto", SqlDbType.NVarChar).Value = Puerto
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveModelo", SqlDbType.Int).Value = CveModelo
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateChecadores(CveChecador As Integer, Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, Optional CveModelo As Integer = 1, Optional Estatus As Boolean = True) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
.Add("@Checador", SqlDbType.NVarChar).Value = Checador
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal
.Add("@Puerto", SqlDbType.NVarChar).Value = Puerto
.Add("@CveModelo", SqlDbType.Int).Value = CveModelo
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveChecadores(CveChecador As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
'Public msgsError As New StringBuilder()
'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "")
' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
' msgsError.AppendLine(Mensaje)
' msgsError.Append("<br/>")
' 'Alert(Obj, Mensaje, TipoMensaje.MsgError)
' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
'End Sub
#Region " IDisposable Support "
' IDisposable
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
'If msgsError.ToString().Length > 0 Then
' Alert(msgsError.ToString(), TipoMensaje.MsgError)

View File

@@ -2,8 +2,9 @@
Imports System
Imports System.Web
Imports System.Data
Imports System.Data
Imports System.Net.Http
Imports System.Net
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports Extensiones
@@ -28,8 +29,46 @@ Public Class E141 : Implements IHttpHandler
End If
End Get
End Property
Public ReadOnly Property UsuarioWSE141 As String
Get
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("UsuarioWSE141")) Then
Return ""
Else
Return System.Configuration.ConfigurationManager.AppSettings("UsuarioWSE141").ToString()
End If
End Get
End Property
Public ReadOnly Property PasswordWSE141 As String
Get
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("PasswordWSE141")) Then
Return ""
Else
Return System.Configuration.ConfigurationManager.AppSettings("PasswordWSE141").ToString()
End If
End Get
End Property
Public ReadOnly Property TokenAutorizacion As String
Get
If EsProduccion Then
Return "$2y$10$AGCCDbEoGEpd0ys89fuBXedtWlunwUeLRlo4MdeLyxDvJF4GwpL7a"
Else
Return "$2y$10$8Mk3YeIkJESilIwD.U5dG.SsA4JloycJKbaGls8TNEw/AKBE1qane"
End If
End Get
End Property
Public ReadOnly Property URLBase As String
Get
If EsProduccion Then
Return "https://services.fidelityapps.mx/"
Else
Return "https://econollantas-pruebas.fidelityapps.mx/"
End If
End Get
End Property
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = "application/json"
Dim retorno As String = "no se encontro la variable"
Try
Dim Params = If(context.Request("P") = Nothing, "", context.Request("P").ToString())
@@ -43,57 +82,379 @@ Public Class E141 : Implements IHttpHandler
End If
End If
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
Dim FiltrarTodos = If(context.Request("FiltrarTodos") = Nothing, "", context.Request("FiltrarTodos").ToString())
If Metodo = "CrearActualizarProductos" Then
retorno = CrearActualizarProductos(If(FiltrarTodos = "1", True, False))
End If
If Metodo = "ActualizarPrecios" Then
retorno = ActualizarPrecios(If(FiltrarTodos = "1", True, False))
End If
If Metodo = "ActualizarExistencias" Then
retorno = ActualizarExistencias(If(FiltrarTodos = "1", True, False))
End If
If Metodo = "ActualizarVendedores" Then
retorno = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
End If
If Metodo = "GetExistencia" Then
Dim Codigo = If(context.Request("Sku") = Nothing, "", context.Request("Sku").ToString())
retorno = GetExistencia(context, Codigo)
End If
Catch ex As Exception
retorno = ex.ToString()
ex.GuardaLog(ex.ToString())
context.Response.Write(retorno)
End Try
context.Response.Write(retorno)
End Sub
Private Function GetExistencia(ByVal context As HttpContext, Codigo As String) As String
Dim respuesta = New With {.isSuccess = False, .message = "", .products = New JArray}
If String.IsNullOrEmpty(Codigo) OrElse Codigo = "-1" Then
respuesta.message = "el parametro 'Sku' es invalido"
respuesta.isSuccess = False
'Private Function DescargarFactura(CveVenta As Integer) As Byte()
' Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0", CveVenta))))
' Dim File As Byte() = Nothing
' Try
' Using httpClient = New HttpClient()
' httpClient.Timeout = New TimeSpan(0, 15, 0)
' Using request = New HttpRequestMessage(HttpMethod.Get, Url)
' request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
' Dim response = httpClient.SendAsync(request).Result
' If response.StatusCode = Net.HttpStatusCode.OK Then
' File = response.Content.ReadAsByteArrayAsync().Result
' End If
' End Using
' End Using
' Catch ex As Exception
' File = Nothing
' OnError("Ocurrió un error al descargar la factura", ex)
' End Try
' Return File
Return JsonConvert.SerializeObject(respuesta)
End If
Dim unauthorized As Boolean = True
Dim authHeader = context.Request.Headers("Authorization")
If authHeader IsNot Nothing Then
Dim basicAuth As String = authHeader.Replace("Basic ", "")
Dim usernamePasswordArray = Encoding.UTF8.GetString(Convert.FromBase64String(basicAuth)).Split(":"c)
Dim userName = usernamePasswordArray(0)
Dim password = usernamePasswordArray(1)
unauthorized = Not (userName = Me.UsuarioWSE141 AndAlso password = Me.PasswordWSE141)
Else
respuesta.message = "el usuario y/o contraseña son requeridos"
respuesta.isSuccess = False
'context.Response.StatusCode = 401
Return JsonConvert.SerializeObject(respuesta)
End If
If unauthorized Then
respuesta.message = "el usuario y/o contraseña no son validos"
respuesta.isSuccess = False
'context.Response.StatusCode = 401
Return JsonConvert.SerializeObject(respuesta)
End If
Using ObjPS As New ClsProductosServicios()
If ObjPS.GetExistenciasEmpresa(Codigo, CveEmpresa) Then
Dim ArrayPS As New JArray
For Each RowPS As DataRow In ObjPS.DtResultados.Rows
Dim producto As New JObject(
New JProperty("sku", RowPS("Codigo")),
New JProperty("stock", RowPS("Existencia"))
)
ArrayPS.Add(producto)
Next
respuesta.products = ArrayPS
respuesta.isSuccess = True
respuesta.message = "La existencia se obtuvo correctamente"
Else
respuesta.isSuccess = False
respuesta.message = "Ocurrió un error al obtener la existencia"
End If
End Using
Return JsonConvert.SerializeObject(respuesta)
End Function
Private Function EnviarInformacion(url As String, payload As String) As String
Dim Retorno As String = "{}"
Try
Using httpClient = New HttpClient()
Using request = New HttpRequestMessage(HttpMethod.Post, New Uri(url))
request.Headers.Add("token", TokenAutorizacion)
Using content = New StringContent(payload, Encoding.UTF8, "application/json")
request.Content = content
Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
Retorno = response.Content.ReadAsStringAsync().Result
End If
End Using
End Using
End Using
Catch ex As Exception
Retorno = New JObject(New JProperty("Error", ex.ToString())).ToString()
OnError("Ocurrió un error al enviar la informacion", ex)
End Try
Return Retorno
End Function
'Private Function EnviarInformacion2(url As String, payload As String) As String
' Dim Retorno As String = "{}"
' Try
' Dim Request As WebRequest = WebRequest.Create(url)
' Request.Method = "post"
' Request.ContentType = "application/json"
' Request.Headers.Add("token", TokenAutorizacion)
' Dim byteArray As Byte() = Encoding.UTF8.GetBytes(payload)
' Request.ContentLength = byteArray.Length
' Using dataStream As Stream = Request.GetRequestStream()
' dataStream.Write(byteArray, 0, byteArray.Length)
' Using tResponse As WebResponse = Request.GetResponse()
' Using dataStreamResponse As Stream = tResponse.GetResponseStream()
' Using tReader As New StreamReader(dataStreamResponse)
' Retorno = tReader.ReadToEnd()
' End Using
' End Using
' End Using
' End Using
' Catch ex As Exception
' Retorno = New JObject(New JProperty("Error", ex.ToString())).ToString()
' OnError("Ocurrió un error al enviar la informacion", ex)
' End Try
' Return Retorno
'End Function
#Region "C R E A C I Ó N / A C T U A L I Z A C I Ó N - P R O D U C T O S"
Private Function CrearActualizarProductos(Todos As Boolean) As String
Return EnviarInformacion($"{Me.URLBase}api/services/products/import", GetProductosModificados(Todos))
End Function
Private Function DescargarFactura(FilePDF As String) As Byte()
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?TipoDocto=Ing&File={1}&TipoArchivo=PDF", "http://localhost/", FilePDF))
Dim File As Byte() = Nothing
Try
Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 1, 0)
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
Dim response = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
End If
End Using
End Using
Catch ex As Exception
File = Nothing
OnError("Ocurrió un error al descargar la factura", ex)
End Try
Return File
Private Function GetProductosModificados(Todos As Boolean) As String
Dim Retorno As String = "{}"
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
DtPS = ObjPS.DtResultados.Copy()
End If
End Using
If DtPS IsNot Nothing Then
Dim ArrayPS As New JArray
For Each RowPS As DataRow In DtPS.Rows
Dim PSData As String() = RowPS("PS").ToString().Split(" ".ToCharArray())
Dim Measurement As String = "", Size As String = "", alt_code As String = ""
If PSData.Length > 0 Then
Measurement = PSData(0)
End If
If PSData.Length > 1 Then
Size = PSData(1)
End If
alt_code = String.Concat(Measurement, Size)
Dim producto As New JObject(
New JProperty("clasificacion", RowPS("Clasificacion")),
New JProperty("category", "Prod"),
New JProperty("pza", RowPS("Unidad")),
New JProperty("sku", RowPS("Codigo")),
New JProperty("name", RowPS("PS")),
New JProperty("measurement", Measurement),
New JProperty("size", Size),
New JProperty("brand", RowPS("Marca")),
New JProperty("price", RowPS("Precio")),
New JProperty("active", RowPS("Estado")),
New JProperty("user", RowPS("UsuarioModifico")),
New JProperty("alt_code", alt_code),
New JProperty("short_description", ""),
New JProperty("description", ""),
New JProperty("currency", 1),
New JProperty("promo_price", RowPS("PrecioPromocion"))
)
ArrayPS.Add(producto)
Next
Retorno = New JObject(New JProperty("products", ArrayPS)).ToString()
End If
Return Retorno
End Function
#End Region
#Region "A C T U A L I Z A R - P R E C I O S"
Private Function ActualizarPrecios(Todos As Boolean) As String
Return EnviarInformacion($"{Me.URLBase}api/services/products/price-import", GetPreciosModificados(Todos))
End Function
Private Function GetPreciosModificados(Todos As Boolean) As String
Dim Retorno As String = "{}"
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetPreciosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
DtPS = ObjPS.DtResultados.Copy()
End If
End Using
If DtPS IsNot Nothing Then
Dim ArrayPS As New JArray
For Each RowPS As DataRow In DtPS.Rows
Dim producto As New JObject(
New JProperty("sku", RowPS("Codigo")),
New JProperty("price", RowPS("Precio")),
New JProperty("promo_price", RowPS("PrecioPromocion"))
)
ArrayPS.Add(producto)
Next
Retorno = New JObject(New JProperty("products", ArrayPS)).ToString()
End If
Return Retorno
End Function
#End Region
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
Private Function ActualizarExistencias() As String
Return EnviarInformacion($"{Me.URLBase}api/services/products/stock", GetPSExistencias())
End Function
Private Function GetPSExistencias() As String
Dim Retorno As String = "{}"
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
DtPS = ObjPS.DtResultados.Copy()
End If
End Using
If DtPS IsNot Nothing Then
Dim ArrayPS As New JArray
For Each RowPS As DataRow In DtPS.Rows
Dim producto As New JObject(
New JProperty("sku", RowPS("Codigo")),
New JProperty("branch_office_code", "01"),
New JProperty("stock", RowPS("Existencia"))
)
ArrayPS.Add(producto)
Next
Retorno = New JObject(New JProperty("stock", ArrayPS)).ToString()
End If
Return Retorno
End Function
#End Region
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
Private Function ActualizarVendedores(Todos As Boolean) As String
Return EnviarInformacion($"{Me.URLBase}api/v1/sellers/import", GetVendedores(Todos))
End Function
Private Function GetVendedores(Todos As Boolean) As String
Dim Retorno As String = "{}"
Dim DtVendedores As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetVendedoresModificados(CveEmpresa, If(Todos, -1, 1)) Then
DtVendedores = ObjPS.DtResultados.Copy()
End If
End Using
If DtVendedores IsNot Nothing Then
Dim ArrayVendedores As New JArray
For Each RowVendedor As DataRow In DtVendedores.Rows
Dim VendedorData As String() = RowVendedor("Vendedor").ToString().Split(" ".ToCharArray())
Dim Nombre As String = "", Apellido As String = ""
Select Case VendedorData.Length
Case 1
Nombre = VendedorData(0)
Case 2
Nombre = VendedorData(1)
Apellido = VendedorData(0)
Case 3
Nombre = VendedorData(2)
Apellido = String.Concat(VendedorData(0), " ", VendedorData(1))
Case 4
Nombre = String.Concat(VendedorData(2), " ", VendedorData(3))
Apellido = String.Concat(VendedorData(0), " ", VendedorData(1))
End Select
Dim vendedor As New JObject(
New JProperty("email", RowVendedor("Correo")),
New JProperty("password", RowVendedor("Correo")),
New JProperty("name", Nombre),
New JProperty("last_name", Apellido),
New JProperty("type_seller", "Administrador"),
New JProperty("state", RowVendedor("Estado")),
New JProperty("city", RowVendedor("Municipio")),
New JProperty("age", 0),
New JProperty("gender", 0),
New JProperty("address", ""),
New JProperty("code", "")
)
ArrayVendedores.Add(vendedor)
Next
Retorno = New JObject(New JProperty("sellers", ArrayVendedores)).ToString()
End If
Return Retorno
End Function
#End Region
#Region "D E S C A R G A - P D F"
Private Function DescargarFactura(FilePDF As String) As Byte()
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?TipoDocto=Ing&File={1}&TipoArchivo=PDF", "http://localhost/", FilePDF))
Dim File As Byte() = Nothing
Try
Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 1, 0)
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
Dim response = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
End If
End Using
End Using
Catch ex As Exception
File = Nothing
OnError("Ocurrió un error al descargar la factura", ex)
End Try
Return File
End Function
Public Sub ImprimirbytesPDF(ByVal context As HttpContext, bytes As Byte(), NombreArchivo As String)
@@ -118,18 +479,20 @@ Public Class E141 : Implements IHttpHandler
End Try
End Sub
Private Function Parametros(Cadena As String) As Hashtable
Dim P1() As String = Cadena.Split("&"c)
Dim Tmp As String
Dim P2() As String
Dim URLParametros As New Hashtable
For Each Tmp In P1
P2 = Tmp.Replace("%26%", "&").Split("="c)
URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
Next
Return URLParametros
#End Region
Private Function Parametros(Cadena As String) As Hashtable
Dim P1() As String = Cadena.Split("&"c)
Dim Tmp As String
Dim P2() As String
Dim URLParametros As New Hashtable
For Each Tmp In P1
P2 = Tmp.Replace("%26%", "&").Split("="c)
URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
Next
Return URLParametros
End Function
End Class

View File

@@ -2688,77 +2688,88 @@ Partial Class Compras_Compras
TmpDT.Columns.Add("CveContrato", GetType(Integer))
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer))
If Not TmpDT.Columns.Contains("CveContratoDetalle") Then
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
End If
If Not TmpDT.Columns.Contains("CveCultivoCuadroDetalle") Then
TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer))
End If
GvPS.DataSource = TmpDT
GvPS.DataBind()
If UsuarioActual.Empresa.UsaAC Then
CargaHidendsAC()
End If
CalculaTotales(True)
If UsuarioActual.Empresa.UsaInventarios Then
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
If dr("Inventario").ToString = "1" Then
CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero
Dim Inv As New ClsInventarios
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento")))
'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros)
ImgImprimirAlmacen.Visible = True
ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento"))
Dim drt As DataRow
'actualizo el almacen
For Each dri As DataRow In DtInv.Rows
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
If drt IsNot Nothing Then
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie
TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie
dri("CveAlmacen") = drt("CveAlmacen")
End If
Next
End If
'Proceso Super Tramposo de Charlie
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then
Dim drt As DataRow
For Each dri As DataRow In DtInv.Rows
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
If drt IsNot Nothing Then
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0)
TmpDr("CveAlmacen") = drt("CveAlmacen")
End If
Next
End If
Inv.Dispose()
GvPS.DataBind()
If UsuarioActual.Empresa.UsaAC Then
CargaHidendsAC()
End If
CargaGvInv()
CalculaTotales(True)
'Ocultamos "Recibir Aqui"
GvInv.Columns(6).Visible = False
GvInv.Columns(7).Visible = False
If UsuarioActual.Empresa.UsaInventarios Then
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
If dr("Inventario").ToString = "1" Then
CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero
Dim Inv As New ClsInventarios
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento")))
'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros)
ImgImprimirAlmacen.Visible = True
ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento"))
Dim drt As DataRow
'actualizo el almacen
For Each dri As DataRow In DtInv.Rows
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
If drt IsNot Nothing Then
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie
TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie
dri("CveAlmacen") = drt("CveAlmacen")
End If
Next
End If
'Proceso Super Tramposo de Charlie
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then
Dim drt As DataRow
For Each dri As DataRow In DtInv.Rows
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
If drt IsNot Nothing Then
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0)
TmpDr("CveAlmacen") = drt("CveAlmacen")
End If
Next
End If
Inv.Dispose()
End If
CargaGvInv()
'Ocultamos "Recibir Aqui"
GvInv.Columns(6).Visible = False
GvInv.Columns(7).Visible = False
End If
End If
End If
DdlTipoComprobante.Enabled = False
DdlTipoComprobante.Enabled = False
DdlTipoComprobante.SelectedValue = dr("TipoDocto").ToString
If dr("TipoDocto").ToString = "Fac" Then
ChkAplicaNotaCredito.Enabled = True

View File

@@ -37,208 +37,222 @@
<link href="/Metronic/assets/global/plugins/dropzone/css/dropzone.css" rel="stylesheet"/>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Avance de Contrato
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption" style="position: relative;">
<asp:UpdatePanel class="row" ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<label class="col-md-1 truncate">Contrato:</label>
<div class="col-md-6 col-lg-4">
<div class="ddls">
<asp:DropDownList ID="DdlContratos" runat="server" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
<div class="col-md-2 col-lg-2 " style="display: none!important">
<asp:DropDownList ID="DdlAvances" runat="server" DataTextField="Name" DataValueField="Fecha" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-1" style="text-align: right!important">
Fecha:
</div>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-6" style="text-align:right!important">
<div style="display: inline-block">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", Gv.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", Gv.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<br />
<table class="table table-striped Widthall">
<tr>
<th style="width: 300px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
</tr>
<tr>
<th>Producto / Servicio</th>
<th colspan="2">Avance</th>
<th colspan="2">Ultimo Avance</th>
<th colspan="2">Levantamiento</th>
<th style="text-align: right;">Anexo</th>
<th style="text-align: right;"></th>
</tr>
</table>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
DataKeyNames="CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance"
CssClass="table GVEstimacion table-advance table-hover mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false"></asp:LinkButton>
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="UM">
<ItemTemplate>
<span><%# Eval("Abreviatura")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText=" ">
<ItemTemplate>
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" />
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm btn-success" ID="LnkModalDropzone" Visible="false"> <i class='fa fa-plus'></i></asp:LinkButton>
<div runat="server" id="ModalAnexoEvidencia" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Cargar Evidencia</h4>
</div>
<div class="modal-body">
<div style="text-align: left">
<asp:TextBox ID="TXTAnexo" CssClass="ADSdropzone hidden" data-maxFile="10" Text="" runat="server"></asp:TextBox>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="LnkGuardarAvance" Text="Guardar" CssClass="btn btn-primary" runat="server" OnClick="LnkGuardarAvance_Click" Visible="false" Height="30px" ValidationGroup="GrpGuardar"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="text-center" runat="server" visible="false">
<asp:Button ID="BtnGuardar" CssClass="btn btn-primary" runat="server" Text="Guardar" Visible="false" ValidationGroup="GrpGuardar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- <ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
<ajax:TabPanel ID="TabAvance" runat="server" HeaderText="Avance">
<ContentTemplate>
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" ValidationGroup="GrpConsultar" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption" style="position: relative;">
<asp:UpdatePanel class="row" ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<label class="col-md-1 truncate">Contrato:</label>
<div class="col-md-6 col-lg-4">
<div class="ddls">
<asp:DropDownList ID="DdlContratos" runat="server" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
<div class="col-md-2 col-lg-2 " style="display:none!important">
<asp:DropDownList ID="DdlAvances" runat="server" DataTextField="Name" DataValueField="Fecha" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-1" style="text-align:right!important">
Fecha:
</div>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-6" style="text-align:right">
</div>
</div>
<br />
<table class="table table-striped Widthall">
<tr>
<th style="width: 300px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
<th style="width: 100px;"></th>
</tr>
<tr>
<th>Producto / Servicio</th>
<th colspan="2">Avance</th>
<th colspan="2">Ultimo Avance</th>
<th colspan="2">Levantamiento</th>
<th style="text-align: right;">Anexo</th>
<th style="text-align: right;"> </th>
</tr>
</table>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
DataKeyNames="CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance"
CssClass="table GVEstimacion table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false"></asp:LinkButton>
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="UM">
<ItemTemplate>
<span><%# Eval("Abreviatura")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" Text="" CssClass="txtcant" onkeyup="ValidateCant(this)" type="number" step="any" data-cantidad='<%# Eval("CantidadMax")%>' data-pu='<%# Eval("PU")%>' data-cve='<%# Eval("CveContratoDetalle") %>' Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:TextBox ID="TxtImporte" Text="" data-cve='<%# Eval("CveContratoDetalle") %>' CssClass="txtimporte" type="number" step="any" Width="90" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText=" ">
<ItemTemplate>
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" />
<asp:LinkButton runat="server" CssClass="btn btn-circle btn-sm btn-success" ID="LnkModalDropzone" Visible="false"> <i class='fa fa-plus'></i></asp:LinkButton>
<div runat="server" id="ModalAnexoEvidencia" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Cargar Evidencia</h4>
</div>
<div class="modal-body">
<div style="text-align: left">
<asp:TextBox ID="TXTAnexo" CssClass="ADSdropzone hidden" data-maxFile="10" Text="" runat="server"></asp:TextBox>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton ID="LnkGuardarAvance" Text="Guardar" CssClass="btn btn-primary" runat="server" OnClick="LnkGuardarAvance_Click" Visible="false" ValidationGroup="GrpGuardar" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="text-center" runat="server" visible ="false">
<asp:Button id="BtnGuardar" CssClass="btn btn-primary" runat="server" Text="Guardar" Visible="false" ValidationGroup="GrpGuardar" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
@@ -341,7 +355,7 @@
</ajax:TabPanel>
</ajax:TabContainer>
</ajax:TabContainer>--%>

View File

@@ -138,8 +138,8 @@ Partial Class Contratos_ContratoAvance
DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DdlContratos.DataBind()
DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
DDlContratosEstimaciones.DataBind()
'DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}"))
'DDlContratosEstimaciones.DataBind()
End Sub
@@ -207,7 +207,7 @@ Partial Class Contratos_ContratoAvance
If e.Row.DataKey("CveContratoDetalle").ToEntero > 0 Then
Dim LnkAnexo As LinkButton = e.Row.FCLinkButton("LnkModalDropzone")
'LnkAnexo.Visible = True
Dim DVAnexo As Control = DirectCast(e.Row.FindControl("ModalAnexoEvidencia"), Control)
LnkAnexo.OnClientClick = $" $('#{DVAnexo.ClientID}').modal('show'); return false;"
@@ -220,9 +220,20 @@ Partial Class Contratos_ContratoAvance
Dim LnkGuardarAvance As LinkButton = e.Row.FCLinkButton("LnkGuardarAvance")
LnkGuardarAvance.Visible = True
If e.Row.DataKey("CantidadMax").ToDouble = 0 Then
LnkAnexo.Visible = False
e.Row.FCTextBox("TxtCantidad").Visible = False
LnkGuardarAvance.Visible = False
End If
End If
End If
End Sub
Protected Sub GetAnexos(sender As Object, e As System.EventArgs)
@@ -432,120 +443,120 @@ Partial Class Contratos_ContratoAvance
#Region "ESTIMACION"
Private Sub CargaAvancesParaEstimar()
CveContratoEstimacion = -1
'Private Sub CargaAvancesParaEstimar()
' CveContratoEstimacion = -1
Dim ObjContratos As New ClsContratos()
Dim DTEstimaciones As New DataTable
Dim NumeroEstimacionActual As Integer = 0
' Dim ObjContratos As New ClsContratos()
' Dim DTEstimaciones As New DataTable
' Dim NumeroEstimacionActual As Integer = 0
If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then
DTEstimaciones = ObjContratos.DtResultados
' If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then
' DTEstimaciones = ObjContratos.DtResultados
CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero
' CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero
End If
' End If
ObjContratos.Dispose()
' ObjContratos.Dispose()
If DTEstimaciones.Rows.Count > 0 Then
GvEstimaciones.DataSource = DTEstimaciones
BtnGuardarEstimacion.Visible = True
Else
GvEstimaciones.DataSource = Nothing
BtnGuardarEstimacion.Visible = False
End If
GvEstimaciones.DataBind()
' If DTEstimaciones.Rows.Count > 0 Then
' GvEstimaciones.DataSource = DTEstimaciones
' BtnGuardarEstimacion.Visible = True
' Else
' GvEstimaciones.DataSource = Nothing
' BtnGuardarEstimacion.Visible = False
' End If
' GvEstimaciones.DataBind()
UpEstimaciones.Update()
End Sub
' UpEstimaciones.Update()
'End Sub
Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click
'Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click
CargaAvancesParaEstimar()
' CargaAvancesParaEstimar()
End Sub
'End Sub
Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound
'Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
' If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
' If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then
If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then
If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then
e.Row.CssClass = "SubTotales"
Else
e.Row.CssClass = "SubTotales2"
End If
Else
e.Row.CssClass = "SubTotales3"
End If
End If
End If
' If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then
' If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then
' e.Row.CssClass = "SubTotales"
' Else
' e.Row.CssClass = "SubTotales2"
' End If
' Else
' e.Row.CssClass = "SubTotales3"
' End If
' End If
' End If
End Sub
'End Sub
Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click
'Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click
CveEstimacionNueva = -1
NuemeroEstimacionNuevo = -1
' CveEstimacionNueva = -1
' NuemeroEstimacionNuevo = -1
Dim ObjContratos As New ClsContratos()
Dim ErrorProceso As Boolean = False
' Dim ObjContratos As New ClsContratos()
' Dim ErrorProceso As Boolean = False
ObjContratos.IniciaTransacSQL()
' ObjContratos.IniciaTransacSQL()
If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CveEstimacionNueva = ObjContratos.CveEstimacionNueva
NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva
' CveEstimacionNueva = ObjContratos.CveEstimacionNueva
' NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva
For Each GvRow As GridViewRow In GvEstimaciones.Rows
' For Each GvRow As GridViewRow In GvEstimaciones.Rows
If GvRow.DataKey("CveContratoAvance").ToEntero > 0 Then
If Not ObjContratos.UpdateContratosAvanceEstimacion(GvRow.DataKey("CveContratoAvance").ToEntero, ObjContratos.CveEstimacionNueva, UsuarioActual.CveEmpresa) Then
ErrorProceso = True
Exit For
End If
End If
Next
' If GvRow.DataKey("CveContratoAvance").ToEntero > 0 Then
' If Not ObjContratos.UpdateContratosAvanceEstimacion(GvRow.DataKey("CveContratoAvance").ToEntero, ObjContratos.CveEstimacionNueva, UsuarioActual.CveEmpresa) Then
' ErrorProceso = True
' Exit For
' End If
' End If
' Next
Else
ErrorProceso = True
End If
' Else
' ErrorProceso = True
' End If
'AddContratosAvanceEstimacion
'UpdateContratosAvanceEstimacion
' 'AddContratosAvanceEstimacion
' 'UpdateContratosAvanceEstimacion
If Not ErrorProceso Then
ObjContratos.Commit()
Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.")
' If Not ErrorProceso Then
' ObjContratos.Commit()
' Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.")
BtnGuardarEstimacion.Visible = False
BtnDescargarGenerado.Visible = True
' BtnGuardarEstimacion.Visible = False
' BtnDescargarGenerado.Visible = True
Else
ObjContratos.RollBack()
End If
' Else
' ObjContratos.RollBack()
' End If
ObjContratos.Dispose()
' ObjContratos.Dispose()
UpEstimaciones.Update()
End Sub
' UpEstimaciones.Update()
'End Sub
Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click
'Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click
GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text)
' GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text)
End Sub
'End Sub
Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String)

View File

@@ -320,24 +320,20 @@
</div>
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Datos del Contrato</div>
</div>
<div class="portlet-body rowpadding">
<div class="portlet-body rowpadding">
<div class="row">
<label class="col-md-2 truncate">No. Contrato:</label>
<div class="col-md-10">
<label class="col-md-3 truncate">No. Contrato:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtNumeroContrato" runat="server" Width="200px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNumeroContrato" runat="server" ControlToValidate="TxtNumeroContrato" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''No. Contrato''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENumeroContrato" runat="server" HighlightCssClass="vco" TargetControlID="RFVNumeroContrato" Width="300px" BehaviorID="_content_VCENumeroContrato"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<label class="col-md-2 truncate">Descripción del Contrato:</label>
<div class="col-md-10">
<label class="col-md-3 truncate">Descripción del Contrato:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtDescripcionContrato" runat="server" MaxLength="70" Width="400px" TextMode="MultiLine" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcionContrato" runat="server" ControlToValidate="TxtDescripcionContrato" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''DescripcionContrato''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDescripcionContrato" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcionContrato" Width="300px" BehaviorID="_content_VCEDescripcionContrato"></ajax:ValidatorCalloutExtender>
@@ -345,16 +341,16 @@
</div>
<div id="trLicitacion" runat="server" class="row">
<label class="col-md-2 truncate">Número Licitación:</label>
<div class="col-md-10">
<label class="col-md-3 truncate">Número Licitación:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtNumeroLicitacion" runat="server" MaxLength="70" Width="200px"></asp:TextBox>
</div>
</div>
<div class="row" id="TrProveedor" runat="server">
<label class="col-md-2 truncate ">
<label class="col-md-3 truncate ">
<asp:Label ID="LblProveedor" runat="server" Text="Proveedor:"></asp:Label></label>
<div class="col-md-10">
<div class="col-md-9">
<asp:DropDownList ID="DdlContratista" runat="server" CssClass="input-sm form-control select2me" AppendDataBoundItems="True" DataTextField="RazonSocial" DataValueField="CveProveedor" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 350px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -363,10 +359,10 @@
<div class="row" >
<label class="col-md-2 truncate ">
<label class="col-md-3 truncate ">
<asp:Label ID="LblCliente" runat="server" Text="Cliente:"></asp:Label></label>
<div class="col-md-10">
<div class="col-md-9">
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="True" DataTextField="NombreComercial" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 350px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -378,21 +374,21 @@
<div class="row" style="display: none;">
<label class="col-md-2 truncate ">Ubicacion:</label>
<div class="col-md-10">
<label class="col-md-3 truncate ">Ubicacion:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtUbicacion" runat="server" MaxLength="50" Width="400px"></asp:TextBox>
</div>
</div>
<div class="row" id="divResponsable" runat="server">
<label class="col-md-2 truncate ">Responsable:</label>
<div class="col-md-10">
<label class="col-md-3 truncate ">Responsable:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtResponsable" runat="server" MaxLength="50" Width="400px"></asp:TextBox>
</div>
</div>
<div class="row" id="div3" runat="server">
<label class="col-md-2 truncate ">Lugar:</label>
<div class="col-md-10">
<label class="col-md-3 truncate ">Lugar:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtLugar" runat="server" MaxLength="300" Width="400px"></asp:TextBox>
</div>
</div>
@@ -400,8 +396,8 @@
<div class="row">
<label class="col-md-2 truncate">Tipo Contrato:</label>
<div class="col-md-10">
<label class="col-md-3 truncate">Tipo Contrato:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlTipoContratoObra" runat="server" CssClass="select2me" Width="150px" >
<asp:ListItem Value="-1">Seleccione uno</asp:ListItem>
<asp:ListItem Value="30">Obra</asp:ListItem>
@@ -415,8 +411,8 @@
</div>
<div class="row">
<label class="col-md-2 truncate">Fecha Inicial:</label>
<div class="col-md-10">
<label class="col-md-3 truncate">Fecha Inicial:</label>
<div class="col-md-9">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaInicial" runat="server" CssClass="form-control" CausesValidation="True" Style="width: 118px" MaxLength="10"></asp:TextBox><span class="input-group-btn "><asp:LinkButton ID="ImgCalendarioInicial" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton></span>
</div>
@@ -427,8 +423,8 @@
</div>
</div>
<div class="row">
<label class="col-md-2 truncate">Fecha Final:</label>
<div class="col-md-10">
<label class="col-md-3 truncate">Fecha Final:</label>
<div class="col-md-9">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaFinal" runat="server" CssClass="form-control" CausesValidation="True" Style="width: 118px" MaxLength="10"></asp:TextBox><span class="input-group-btn "><asp:LinkButton ID="ImgCalendarioFinal" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton></span>
</div>
@@ -445,8 +441,8 @@
<div class="row" id="DVddlproyecto" runat="server">
<asp:Label runat="server" ID="LblProyecto" class="col-md-2 truncate">Proyecto:</asp:Label>
<div class="col-md-10">
<asp:Label runat="server" ID="LblProyecto" class="col-md-3 truncate">Proyecto:</asp:Label>
<div class="col-md-9">
<asp:DropDownList ID="DdlProyecto" runat="server" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Style="width: 200px;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Sin Proyecto asignado" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -459,8 +455,8 @@
<div class="row" id="DVSubProyecto" runat="server" visible="false">
<asp:Label runat="server" ID="LblSubProyectoTitulo" class="col-md-2 truncate"></asp:Label>
<asp:Label runat="server" ID="LblSubProyecto" class="col-md-10 truncate"></asp:Label>
<asp:Label runat="server" ID="LblSubProyectoTitulo" class="col-md-3 truncate"></asp:Label>
<asp:Label runat="server" ID="LblSubProyecto" class="col-md-9 truncate"></asp:Label>
</div>
@@ -484,24 +480,23 @@
</div>
<div class="caption uppercase" style="position: relative;"><i class="fa fa-info-circle"></i>Información</div>
</div>
<div class="portlet-body rowpadding">
<div class="portlet-body rowpadding">
<div class="row" id="TrCliente" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label><div class="col-md-10">
<label class="col-md-3 ">
<asp:Label ID="Label1" runat="server" Text="Cliente:"></asp:Label></label>
<div class="col-md-9">
</div>
</div>
</div>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row" id="TrClienteSucursal" runat="server" visible="False">
<label class="col-md-2 truncate">
<asp:Label ID="Label2" runat="server" Text="Sucursal Cliente:"></asp:Label></label><div class="col-md-10">
<label class="col-md-3 ">
<asp:Label ID="Label2" runat="server" Text="Sucursal Cliente:"></asp:Label></label>
<div class="col-md-9">
<asp:DropDownList ID="DdlSucursalCliente" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal" Width="75%">
<asp:ListItem Selected="true" Text="Matriz" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -514,64 +509,64 @@
<div class="row">
<label class="col-md-2 truncate">Moneda:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlMoneda" CssClass="form-control input-sm select2me" runat="server" DataTextField="Moneda" AutoPostBack="True" DataValueField="CveMoneda" Width="150px"></asp:DropDownList>
<label class="col-md-3 ">Moneda:</label>
<div class="col-md-9">
<asp:DropDownList ID="DdlMoneda" CssClass="form-control input-sm select2me" runat="server" DataTextField="Moneda" AutoPostBack="True" DataValueField="CveMoneda" Width="200px"></asp:DropDownList>
</div>
</div>
<div class="row" runat="server" id="tipoCambio" visible="False">
<label class="col-md-2 truncate">Tipo de cambio:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtTipoCambio" runat="server" MaxLength="12" Width="90px"></asp:TextBox>
<label class="col-md-3 ">Tipo de cambio:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtTipoCambio" runat="server" MaxLength="12" Width="200px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender7" runat="server" TargetControlID="TxtTipoCambio" FilterType="Custom, Numbers" ValidChars="." BehaviorID="_content_SoloNumeros" />
</div>
</div>
<div id="trIva" runat="server" class="row">
<label class="col-md-2 truncate">% IVA:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtPorIVA" runat="server" MaxLength="12" Width="150px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtPorIVA" FilterType="Custom, Numbers" ValidChars="." BehaviorID="_content_SoloNumeros" />
<label class="col-md-3 ">% IVA:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtPorIVA" runat="server" MaxLength="12" Width="200px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtPorIVA" FilterType="Custom, Numbers" ValidChars="." BehaviorID="_content_SoloNumeros" />
</div>
</div>
<div id="trAnticipo" runat="server" class="row">
<label class="col-md-2 truncate ">% Anticipo:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtPorAnticipo" runat="server" MaxLength="12" Width="150px"></asp:TextBox>
<label class="col-md-3 ">% Anticipo:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtPorAnticipo" runat="server" MaxLength="12" Width="200px"></asp:TextBox>
</div>
</div>
<div id="trAmortizacion" runat="server" class="row">
<label class="col-md-2 truncate ">% Amortización de Anticipo:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtPorAmortizacionAnticipo" runat="server" MaxLength="12" Width="150px"></asp:TextBox>
<label class="col-md-3 ">% Amortización de Anticipo:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtPorAmortizacionAnticipo" runat="server" MaxLength="12" Width="200px"></asp:TextBox>
</div>
</div>
<div id="trPorGarantia" runat="server" class="row">
<label class="col-md-2 truncate ">% Garantía:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtPorGarantia" runat="server" MaxLength="12" Width="150px"></asp:TextBox>
<label class="col-md-3 ">% Garantía:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtPorGarantia" runat="server" MaxLength="12" Width="200px"></asp:TextBox>
</div>
</div>
<div class="row" runat="server">
<label class="col-md-2 truncate ">% Limite de Gastos:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtLimiteGastos" runat="server" MaxLength="5" Width="150px"></asp:TextBox>
<label class="col-md-3 ">% Limite de Gastos:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtLimiteGastos" runat="server" MaxLength="5" Width="200px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="TxtLimiteGastos" FilterType="Custom, Numbers" ValidChars=",." BehaviorID="_content_SoloNumeros" />
</div>
</div>
<div class="row" id="DvTotal" runat="server">
<label class="col-md-2 truncate ">Total:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtTotal" runat="server" MaxLength="12" Width="150px"></asp:TextBox>
<label class="col-md-3 ">Total con IVA:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtTotal" runat="server" MaxLength="12" Width="200px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender8" runat="server" TargetControlID="TxtTotal" FilterType="Custom, Numbers" ValidChars=",." BehaviorID="_content_SoloNumeros" />
</div>
</div>
<div class="row" id="DvObservaciones" runat="server" visible="false">
<label class="col-md-2 truncate ">Observación de Facturación:</label>
<div class="col-md-10">
<label class="col-md-3 ">Observación de Facturación:</label>
<div class="col-md-9">
<asp:TextBox ID="TxtObservaciones" runat="server" Width="400px" TextMode="MultiLine" Rows="2"></asp:TextBox>
</div>
</div>
@@ -1274,12 +1269,12 @@
<div id="dvCa" style="width: 100%; top: 30px">
<table id="dTable" class="table Widthall ">
<tr>
<td width="30%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="15%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="15%" id="TH3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td>
<td width="15%" id="TH4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td>
<td width="15%" id="TH5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td>
<td width="10%" id="TH6" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Anticipo</strong> </td>
<td width="25%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="10%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="18%" id="TH3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td>
<td width="18%" id="TH4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td>
<td width="10%" id="TH5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td>
<td width="5%" id="TH6" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Anticipo</strong> </td>
</tr>
</table>
</div>
@@ -1303,10 +1298,14 @@
<asp:LinkButton ID="LBAvanceImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="AvancePorcentaje" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Cantidad" DataField="FaltanteCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="FaltanteImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="%" DataField="FaltantePorcentaje" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>
<asp:LinkButton ID="LBAvanceXFacturarCantidad" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceXFacturarCantidad", "{0:###,###,##0.00##}") %>' runat="server" />
@@ -1346,8 +1345,8 @@
<div id="dvCaCon" style="width: 100%; top: 30px">
<table id="dTable" class="table Widthall ">
<tr>
<td width="30%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="15%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="25%" id="TH1" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Clasificación</strong> </td>
<td width="10%" id="TH2" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Contratado</strong> </td>
<td width="15%" id="TH3" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance</strong> </td>
<td width="15%" id="TH4" style="font-size: medium; text-align: center!important; background-color: #dddddd;"><strong>Faltante</strong> </td>
<%-- <td width="15%" id="TH5" style="font-size: medium; text-align: center!important; background-color: #b9b9b9;"><strong>Avance Por Facturar</strong> </td>
@@ -1375,9 +1374,11 @@
<asp:LinkButton ID="LBAvanceImporte" OnClick="MuestaModalVentasAvance" Text='<%# Eval("AvanceImporte", "{0:###,###,##0.00##}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="AvancePorcentaje" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Cantidad" DataField="FaltanteCantidad" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Importe $" DataField="FaltanteImporte" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,##0.00##}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="%" DataField="FaltantePorcentaje" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="5%" />
<%-- <asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="7.5%" ItemStyle-CssClass="Derecha">
<ItemTemplate>

View File

@@ -37,6 +37,7 @@
<link href="/Metronic/assets/global/plugins/dropzone/css/dropzone.css" rel="stylesheet"/>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Autorización de Avance
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
@@ -45,130 +46,140 @@
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride" ActiveTabIndex="0">
<ajax:TabPanel ID="TabEstimación" runat="server" HeaderText="Estimación">
<ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpEstimaciones" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultarEstimaciones" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption" style="position: relative;">
<asp:UpdatePanel class="row" ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<label class="col-md-1 truncate">Contrato:</label>
<div class="col-md-6 col-lg-4">
<div class="ddls">
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvEstimaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
DataKeyNames="CveContratoAvance,CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance,Fecha,CveEstimacion"
CssClass="table GVEstimacion table-advance table-hover mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="" ItemStyle-Width="60%">
<ItemTemplate>
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false" ></asp:LinkButton>
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acciones">
<ItemTemplate>
<ContentTemplate>
<table style="width:120px!important">
<tr>
<td>
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" Visible="false" />
</td>
<td>
<asp:LinkButton ID="LnkEliminarAvance" runat="server" OnClick="LnkEliminarAvance_Click" AlternateText="Agregar Anexo" Visible="false"
CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Confimra la elimiancion del avance?" data-btn-ok-label="si"
/>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="text-center">
<asp:Button id="BtnAutoriza" CssClass="btn btn-primary" runat="server" Text="Autorizar" Visible="false" OnClick="BtnAutoriza_Click" />
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
<asp:Button id="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false"/>
</div>
</div>
</div>
</ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultarEstimaciones" runat="server" Text="Consultar" class="btn btn-default" />
</div>
<div class="titlefiltros caption" style="position: relative;">
<asp:UpdatePanel class="row" ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<label class="col-md-1 truncate">Contrato:</label>
<div class="col-md-6 col-lg-4">
<div class="ddls">
<asp:DropDownList ID="DDlContratosEstimaciones" runat="server" DataTextField="ContratoCompleto" DataValueField="CveContrato" Class=" form-control input-inline select2me" Width="100%">
</asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6" style="text-align: right!important">
</div>
<div class="col-md-6" style="text-align:right!important">
<div style="display: inline-block">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEstimaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEstimaciones.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvEstimaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
DataKeyNames="CveContratoAvance,CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance,Fecha,CveEstimacion"
CssClass="table GVEstimacion table-advance table-hover mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="" ItemStyle-Width="60%">
<ItemTemplate>
<asp:LinkButton ID="Producto" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>' Visible="false"></asp:LinkButton>
<asp:Label ID="LinkButton1" runat="server" CssClass="Texto" Text='<%# Eval("PS")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<span><%# Eval("Cantidad_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<span><%# Eval("Importe_Ultima", "{0:N2}")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Acciones">
<ItemTemplate>
<table style="width: 120px!important">
<tr>
<td>
<asp:LinkButton ID="LnkAnexo" runat="server" OnClick="GetAnexos" AlternateText="Agregar Anexo" CssClass="btn btn-circle btn-sm btn-success anexo" Text="<i class='fa fa-folder'></i>" Visible="false" />
</td>
<td>
<asp:LinkButton ID="LnkEliminarAvance" runat="server" OnClick="LnkEliminarAvance_Click" AlternateText="Agregar Anexo" Visible="false"
CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Confimra la elimiancion del avance?" data-btn-ok-label="si" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="text-center">
<asp:Button ID="BtnAutoriza" CssClass="btn btn-primary" runat="server" Text="Autorizar" Visible="false" OnClick="BtnAutoriza_Click" />
<asp:Button ID="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false" />
<asp:Button ID="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false" />
</div>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargarGenerado" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>

View File

@@ -221,14 +221,26 @@
<asp:TemplateField HeaderText="Avance $">
<ItemTemplate>
<asp:Label ID="HplOFA" CssClass="Texto" runat="server" Text='<%# Eval("AvanceImporte", "{0:N2}")%>'></asp:Label>
<asp:Label ID="LblAvanceImporte" CssClass="Texto" runat="server" Text='<%# Eval("AvanceImporte", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Facturado">
<asp:TemplateField HeaderText="Avance Acumulado $">
<ItemTemplate>
<asp:Label ID="LblFacturado" CssClass="Texto" runat="server" Text='<%# Eval("Facturado")%>'></asp:Label>
<asp:Label ID="LblAvanceAcumuladoImporte" CssClass="Texto" runat="server" Text='<%# Eval("AvanceAcumuladoImporte", "{0:N2}")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Center" HeaderText="Factura" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" Target="_blank" />
<asp:TemplateField HeaderText="Estado">
<ItemTemplate>
<asp:Label ID="LblEstatus" CssClass="Texto" runat="server" Text='<%# Eval("EstimacionEstatus")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>

View File

@@ -373,7 +373,7 @@ Partial Class RepContratosObraAvancesDetalle
Dim objContrato As New ClsContratos
Dim DTArchivos As New DataTable
If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, Drow("Fecha").ToString, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
If objContrato.GetContratosAvanceAnexos(Drow("CveContratoDetalle").ToString.ToEntero, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
DTArchivos = objContrato.DtResultados
End If
objContrato.Dispose()

View File

@@ -116,7 +116,7 @@ Partial Class RepContratosObraAvancesPartida
Dim CveContratoAvance As Integer = GvRow.DataKey("CveContratoAvance").ToEntero
Dim objContrato As New ClsContratos
If objContrato.GetContratosAvanceAnexos(CveContratoDetalle, Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion, CveContratoAvance:=CveContratoAvance) Then
If objContrato.GetContratosAvanceAnexos(CveContratoDetalle, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion, CveContratoAvance:=CveContratoAvance) Then
GvAnexos.DataSource = objContrato.DtResultados
GvAnexos.DataBind()
GvAnexos.Visible = True

View File

@@ -151,7 +151,7 @@
</div>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta,CveUsuarioAutoriza" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAlmacen,IdCtaContable,Inventariable,Modalidad,CveTipoAlmacen,Almacen,Estatus,CveSubProyecto,Orden,CveCuenta,CveUsuarioAutoriza,CveAlmacenVirtual" EmptyDataText="No se encontraron Almacenes" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="300px" data-freezerows="1" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="15%" HeaderText="Almacen">
<ItemTemplate>
@@ -314,8 +314,16 @@
</div>
</div>
<br />
<div id="divAlmacenesVirtuales" runat="server" class="row" visible="false">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlAlmacenesVirtuales" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" Width="50%" CssClass="form-control input-sm select2me"/>
<asp:Label AssociatedControlID="DdlAlmacenesVirtuales" runat="server" Text="Almacén Virtual:"></asp:Label>
</div>
</div>
</div>
<br />
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">

View File

@@ -49,6 +49,7 @@ Partial Class Inventarios_CatAlmacenes
CargaTipoAlmacen()
CargaDatos()
CargaUsuarios()
CargaAlmacenVirtual()
End If
End Sub
@@ -64,7 +65,14 @@ Partial Class Inventarios_CatAlmacenes
ObjAlmacen.Dispose()
End Sub
Private Sub CargaAlmacenVirtual()
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
divAlmacenesVirtuales.Visible = True
DdlAlmacenesVirtuales.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24)
DdlAlmacenesVirtuales.DataBind()
DdlAlmacenesVirtuales.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
End Sub
#Region "C O M B O S"
@@ -84,23 +92,23 @@ Partial Class Inventarios_CatAlmacenes
DdlTipoAlmacen.DataBind()
End Sub
Private Sub CargaUsuarios()
Dim DT As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros(" Estatus = 1 ").Copy
DT.DefaultView.Sort = "Nombre ASC"
DT = DT.DefaultView.ToTable
DdlUsuariosAutoriza.DataSource = DT
DdlUsuariosAutoriza.DataBind()
DdlUsuariosAutoriza.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
Private Sub CargaUsuarios()
Dim DT As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros(" Estatus = 1 ").Copy
DT.DefaultView.Sort = "Nombre ASC"
DT = DT.DefaultView.ToTable
DdlUsuariosAutoriza.DataSource = DT
DdlUsuariosAutoriza.DataBind()
DdlUsuariosAutoriza.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
Private Sub CargaCuentasContables()
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
divCuentasCompac.Visible = False
divCuentasCompac.Visible = False
pnlCuentassig.Visible = True
Using ObjContabilidad As New ClsContabilidad
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
@@ -111,22 +119,22 @@ Partial Class Inventarios_CatAlmacenes
End If
End Using
Else
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
divCuentasCompac.Visible = True
pnlCuentassig.Visible = False
Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
DtCuentasContables = ObjContabilidad.DtResultados
Else
DtCuentasContables = Nothing
End If
End Using
DdlCuentasContables.DataSource = DtCuentasContables
DdlCuentasContables.DataBind()
End If
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
divCuentasCompac.Visible = True
pnlCuentassig.Visible = False
Using ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentasRecursiva(UsuarioActual.Empresa.Funcionalidad(208).ToEntero, 1) Then
DtCuentasContables = ObjContabilidad.DtResultados
Else
DtCuentasContables = Nothing
End If
End Using
DdlCuentasContables.DataSource = DtCuentasContables
DdlCuentasContables.DataBind()
End If
End If
UpAddAlmacen.Update()
@@ -159,9 +167,9 @@ Partial Class Inventarios_CatAlmacenes
'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
If e.Row.DBCampo("IdCtaContable").ToEntero > 0 Then
e.Row.FCLiteral("LtlCuentaContable").Text = DtCuentasContables.FiltroPrimeroValor("CtaCodigo", $"Id = {e.Row.DBCampo("IdCtaContable")}")
'Else
' e.Row.FCLiteral("LtlCuentaContable").Text = "Sin Cuenta"
e.Row.FCLiteral("LtlCuentaContable").Text = DtCuentasContables.FiltroPrimeroValor("CtaCodigo", $"Id = {e.Row.DBCampo("IdCtaContable")}")
'Else
' e.Row.FCLiteral("LtlCuentaContable").Text = "Sin Cuenta"
End If
End If
@@ -184,14 +192,14 @@ Partial Class Inventarios_CatAlmacenes
e.Row.FCDropDownList("DdlTipoAlmacen").DataSource = GlobalDTTipoAlmacen(-1)
e.Row.FCDropDownList("DdlTipoAlmacen").DataBind()
e.Row.FCDropDownList("DdlTipoAlmacen").SelectedValue = e.Row.DBCampo("CveTipoAlmacen")
'e.Row.FCDropDownList("DdlModalidad").DataSource =
'e.Row.FCDropDownList("DdlModalidad").DataBind()
e.Row.FCDropDownList("DdlTipoAlmacen").SelectedValue = e.Row.DBCampo("CveTipoAlmacen")
'e.Row.FCDropDownList("DdlModalidad").DataSource =
'e.Row.FCDropDownList("DdlModalidad").DataBind()
e.Row.FCDropDownList("DdlModalidad").Items.Add(New ListItem("Solo Existencia", "0"))
e.Row.FCDropDownList("DdlModalidad").Items.Add(New ListItem("Contable", "1"))
e.Row.FCDropDownList("DdlModalidad").SelectedValue = If(e.Row.DBCampo("Modalidad").ToString = "Contable", "1", "0")
@@ -199,20 +207,20 @@ Partial Class Inventarios_CatAlmacenes
End If
End If
End Sub
End Sub
#End Region
#Region "O R D E N A M I E N T O"
'Private Sub OrdenaDatos()
' If (GvDatos.Rows.Count > 0) Then
' GvDatos.UseAccessibleHeader = True
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
' RegistraScript("OrdenarGV();")
' End If
'End Sub
'Private Sub OrdenaDatos()
' If (GvDatos.Rows.Count > 0) Then
' GvDatos.UseAccessibleHeader = True
' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
' RegistraScript("OrdenarGV();")
' End If
'End Sub
#End Region
Private Sub RecargaGlobalAlmacenes()
GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjAlmacen As New ClsInventarios
@@ -239,19 +247,21 @@ Partial Class Inventarios_CatAlmacenes
Dim Estatus = 0
If ChkEstatus.Checked Then Estatus = 1
Dim CuentaContable As Integer = 0
Dim CveCuenta As Integer = 0
If pnlCuentassig.Visible Then
CveCuenta = DdlCuentasSig.SelectedValue.ToEntero()
End If
If divCuentasCompac.Visible Then
CuentaContable = DdlCuentasContables.SelectedValue.ToEntero()
End If
Dim CveCuenta As Integer = 0
If pnlCuentassig.Visible Then
CveCuenta = DdlCuentasSig.SelectedValue.ToEntero()
End If
If divCuentasCompac.Visible Then
CuentaContable = DdlCuentasContables.SelectedValue.ToEntero()
End If
If HdnModalidad.Value = "A" Then
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero) Then
If ObjAlmacen.AddAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero,
CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero()) Then
Alert("El nuevo Almacen se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -261,7 +271,7 @@ Partial Class Inventarios_CatAlmacenes
Else
TieneError = True
End If
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero) Then
ElseIf ObjAlmacen.UpdateAlmacen(TxtAlmacen.Text.Trim, DdlTipoAlmacen.SelectedValue.ToEntero, CuentaContable, DdlModalidad.SelectedValue.ToEntero, (CByte(Estatus)), HdnID.Value.ToEntero, CByte(DdlInventariable.SelectedValue), DdlSubProyecto.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, CveCuenta, CveUsuarioAutoriza:=DdlUsuariosAutoriza.SelectedValue.ToEntero, CveAlmacenVirtual:=DdlAlmacenesVirtuales.SelectedValue.ToEntero) Then
Alert("El Almacen se actualizo correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTAlmacenes") = ObjAlmacen.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -278,7 +288,7 @@ Partial Class Inventarios_CatAlmacenes
End Sub
Public Sub Agregar()
HdnModalidad.Value = "A"
HdnModalidad.Value = "A"
UpDatos.Update()
If DdlModalidad.SelectedValue = 1 Then
DdlCuentasContables.Visible = True
@@ -290,6 +300,7 @@ Partial Class Inventarios_CatAlmacenes
ChkEstatus.Checked = True
divEstatus.Visible = False
DdlUsuariosAutoriza.SelectedValueExist("-1")
DdlAlmacenesVirtuales.SelectedValue = "-1"
UpAddAlmacen.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
@@ -326,16 +337,17 @@ Partial Class Inventarios_CatAlmacenes
DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto"))
DdlTipoAlmacen.SelectedValueExist(GvRow.DataKey("CveTipoAlmacen"))
TxtAlmacen.Text = GvRow.DataKey("Almacen")
TxtOrden.Text = GvRow.DataKey("Orden")
DdlUsuariosAutoriza.SelectedValueExist(If(GvRow.DataKey("CveUsuarioAutoriza").ToEntero > 0, GvRow.DataKey("CveUsuarioAutoriza"), "-1"))
TxtOrden.Text = GvRow.DataKey("Orden")
DdlUsuariosAutoriza.SelectedValueExist(If(GvRow.DataKey("CveUsuarioAutoriza").ToEntero > 0, GvRow.DataKey("CveUsuarioAutoriza"), "-1"))
DdlAlmacenesVirtuales.SelectedValueExist(GvRow.DataKey("CveAlmacenVirtual"))
divEstatus.Visible = True
ChkEstatus.Checked = If((GvRow.DataKey("Estatus")) = "Activo", True, False)
UpAddAlmacen.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddAlmacen"))
End Sub
Private Sub LnkAlmacen_Click(sender As Object, e As EventArgs) Handles LnkAlmacen.Click
Agregar()

View File

@@ -229,7 +229,7 @@
<div class="row" style="margin-top: 5px;">
<label class="col-md-4">Código.Barras</label>
<div class="col-md-8">
<asp:TextBox runat="server" ID="TxtCodigoBarras" ></asp:TextBox>
<asp:TextBox runat="server" ID="TxtCodigoBarras"></asp:TextBox>
</div>
</div>
<div class="row" style="margin-top: 5px;" runat="server" id="divSerie" visible="false">
@@ -240,7 +240,7 @@
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="row" style="margin-top: 5px;" runat="server" id="divLote" visible="false">
<label class="col-md-4">Lote</label>
<div class="col-md-8">
@@ -259,12 +259,22 @@
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12" style="text-align: center;">
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" />
<div class="row" style="margin-top: 5px" runat="server" id="divSeccion" visible="false">
<label class="col-md-4">Sección Almacén:</label>
<div class="col-md-8">
<asp:DropDownList runat="server" ID="DdlSeccionAlmacen" CssClass="select2me" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" Width="100%">
<%--<asp:ListItem Selected="True" Value="-1">Seleccione</asp:ListItem>--%>
</asp:DropDownList>
<asp:RequiredFieldValidator runat="server" ID="RfvSeccionAlmacen" ControlToValidate="DdlSeccionAlmacen" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Seccion Almacen''</b> es necesario, por favor ingrése una." Display="Dynamic" InitialValue="-1"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacen" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12" style="text-align: center;">
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" />
</div>
</div>
</div>
</div>
</asp:Panel>
</div>

View File

@@ -6,7 +6,7 @@ Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Inventarios_InventarioFisicoDetalle
Inherits ClsPaginas
Inherits ClsPaginas
#Region "Propiedades"
Public Property DtEquivalencias() As DataTable
Get
@@ -39,9 +39,18 @@ Partial Class Inventarios_InventarioFisicoDetalle
Set(value As DataTable)
ViewState("DtVentas") = value
End Set
End Property
End Property
Private Property CveAlmacenes As String
Get
Return ViewState("CveAlmacenes").ToString
End Get
Set(value As String)
ViewState("CveAlmacenes") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
If Request("CveInventarioFisico") IsNot Nothing AndAlso Request("CveInventarioFisico").ToString.ToEntero > 0 Then
@@ -51,10 +60,10 @@ Partial Class Inventarios_InventarioFisicoDetalle
End If
End If
End Sub
End Sub
#Region " USUARIOS "
Private Sub CargaUsuarios()
ddlUsuario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "Nombre")
@@ -82,9 +91,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
UPAgregarPro.Update()
UPPInventario.Update()
End Sub
End Sub
#End Region
#Region " CARGA DATOS "
Private Sub CargaDatos(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1)
@@ -135,13 +144,16 @@ Partial Class Inventarios_InventarioFisicoDetalle
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
Dim dt As DataTable = ObjInventario.DtResultados
Dim str As New StringBuilder
Dim CveAlmacenesStr As New StringBuilder
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
For Each dr As DataRow In dt.Rows
str.AppendFormat("{0},", dr("almacen"))
CveAlmacenesStr.AppendFormat("{0},", dr("CveAlmacen"))
Next
End If
LblAlmacenes.Text = str.ToString
CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1)
End If
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
@@ -246,11 +258,11 @@ Partial Class Inventarios_InventarioFisicoDetalle
RegistraScript("OrdenarGV();")
End If
UPPInventario.Update()
End Sub
End Sub
#End Region
#Region " AGREGAR "
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim Valido As Boolean = False
@@ -260,8 +272,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
Dim Serie As String = TxtCodigoSerie.Text.Trim
Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1")
Dim FechaCaducidad As String=MinFecha.ToString
Dim FechaCaducidad As String = MinFecha.ToString
Dim CveSeccionAlmacen As Integer = -1
Dim SeccionAlmacen As String = ""
Dim Cantidad = TxtCantidadProducto.Text.ToDouble
@@ -279,11 +292,13 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1"
Dim AplicaLote As Boolean = dr("AplicaLote") = "1"
Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1"
Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1"
'divSeccionAlmacen.Visible = AplicaSeccion
divLote.Visible = AplicaLote
divFechaCaducidad.Visible = AplicaCaducidad
divSerie.Visible = AplicaSerie
UPAgregarPro.Update()
If AplicaSerie And Serie = "" Then
@@ -294,7 +309,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
RFVSerie.ValidationGroup = " "
Exit Sub
End If
If AplicaLote And Lote = "" Then
If AplicaLote And (Lote = "" Or Lote = "-1") Then
RFVLote.Enabled = True
RFVLote.Visible = True
RFVLote.SetFocusOnError = True
@@ -313,13 +328,46 @@ Partial Class Inventarios_InventarioFisicoDetalle
End If
FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
End If
If AplicaSeccion Then
Dim ObjInv As New ClsInventarios
Dim SeccionesAlmacenDelProducto As New DataTable
If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then
SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
End If
'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString)
If SeccionesAlmacenDelProducto.Rows.Count = 1 Then
CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen")
Else
divSeccion.Visible = AplicaSeccion
If DdlSeccionAlmacen.Items.Count = 0 Then
DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto
DdlSeccionAlmacen.DataBind()
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
If DdlSeccionAlmacen.SelectedValue = "-1" Then
RfvSeccionAlmacen.Enabled = True
RfvSeccionAlmacen.Visible = True
RfvSeccionAlmacen.SetFocusOnError = True
RfvSeccionAlmacen.Validate()
RfvSeccionAlmacen.ValidationGroup = " "
Exit Sub
End If
CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero
End If
ObjInv.Dispose()
SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen))
End If
RFVSerie.ValidationGroup = "GrpIngresar"
RFVSerie.Enabled = False
RFVLote.ValidationGroup = "GrpIngresar"
RFVLote.Enabled = False
RFVCaducidad.ValidationGroup = "GrpIngresar"
RFVCaducidad.Enabled = False
RfvSeccionAlmacen.ValidationGroup = "GrpIngresar"
RfvSeccionAlmacen.Enabled = False
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
@@ -331,7 +379,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
Using Inventarios As New ClsInventarios
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario,
CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0
GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> ""
@@ -344,7 +392,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PSCodigo").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = ""
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen
GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim
GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote
GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad
@@ -371,6 +419,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
divLote.Visible = False
divFechaCaducidad.Visible = False
divSerie.Visible = False
divSeccion.Visible = False
RegistraScript("playsonidito('beep-07.wav')")
Else
TxtCodigoSerie.Text = ""
@@ -386,6 +435,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
divLote.Visible = False
divFechaCaducidad.Visible = False
divSerie.Visible = False
divSeccion.Visible = False
TxtLote.Text = ""
TxtFechaCaducidad.Text = ""
Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError)
@@ -395,9 +445,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
DivBuscador.Visible = False
UPPInventario.Update()
End Sub
End Sub
#End Region
#Region " ELIMINAR "
Protected Sub gvInventarioFisicoDetalle_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvIFD.RowDeleting
If ddlUsuario.SelectedValue = UsuarioActual.CveUsuario.ToString OrElse UsuarioActual.TienePermisoProceso(283) Then
@@ -425,9 +475,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
Alert("No se puede eliminar un producto registrado por otro usuario.", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
End If
End Sub
End Sub
#End Region
#Region " FINALIZAR "
Protected Sub btnFin_Click(sender As Object, e As EventArgs) Handles btnFin.Click
If btnFin.Text.Contains("Iniciar") Then
@@ -475,9 +525,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
UPAgregarPro.Update()
UPPInventario.Update()
End Sub
End Sub
#End Region
#Region " VER AVANCE "
Protected Sub LBAvance_Click(sender As Object, e As EventArgs)
Response.Redirect($"~/Inventarios/RepAnomalias.aspx?CveInventarioFisico={CveInventarioFisico}&EsAvance=1")

View File

@@ -752,7 +752,7 @@
<asp:HiddenField runat="server" ID="HdnCodAFEdit" Value="-1" ClientIDMode="Static" />
<asp:GridView ID="GvM" runat="server" GridLines="none" Width="70%"
CssClass="table table-hover ADScroller btn-xs" ShowHeader="True"
EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CvePS,PU,Cantidad,CveTamaño"
EmptyDataText="Aún no hay registros." DataKeyNames="No,CveMovimientoDetalle,CvePS,PU,Cantidad,CveTamaño,CodigoPS"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
<Columns>
<asp:TemplateField HeaderText="" ItemStyle-Font-Size="6pt">

View File

@@ -2489,7 +2489,6 @@ Partial Class Inventarios_RecepcionUsados
For Each Row As GridViewRow In GvM.Rows
If Row.RowType = DataControlRowType.DataRow Then
Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero()
Dim Cantidad As Decimal = Row.DataKey("Cantidad").ToDecimal()
Dim PU As Decimal = Row.DataKey("PU").ToDecimal()
Dim CveTamaño As Integer = Row.DataKey("CveTamaño").ToEntero()
@@ -2502,29 +2501,45 @@ Partial Class Inventarios_RecepcionUsados
Dim PS As String = ""
Dim PorcentajeIVA As Decimal = 0D
Dim IVA As Decimal = 0D
If CvePS > 0 Then
If SubTotal > 0 Then
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
If Dr IsNot Nothing Then
CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
PS = Dr("PSCodigo").ToString
UnidadMedida = Dr("UnidadMedida").ToString
Clasificacion = Dr("Clasificacion").ToString
Dim CvePS As Integer = 0
Select Case RblUsadosAjuste.SelectedValue
Case "0" ' USADOS
CvePS = Row.DataKey("CvePS").ToEntero()
Case "1" ' AJUSTE/GARANTIA
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
If drDatos IsNot Nothing Then
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
End If
PorcentajeIVA = 0.16D
IVA = SubTotal * PorcentajeIVA
End Select
If CvePS > 0 Then
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If Dr IsNot Nothing Then
CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
PS = Dr("PSCodigo").ToString
UnidadMedida = Dr("UnidadMedida").ToString
Clasificacion = Dr("Clasificacion").ToString
End If
PorcentajeIVA = 0.16D
IVA = SubTotal * PorcentajeIVA
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
Else
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño)
End If
Next
'SI ES AJUSTE/GARANTIA
If RblUsadosAjuste.SelectedValue = "1" Then
'agrego un registro extra del importe de ajuste
Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal
Dim PU As Decimal = TmpDTAjustes.SUMD("Importe")
'CONSULTA EL CONCEPTO DE NC
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1
@@ -2540,7 +2555,18 @@ Partial Class Inventarios_RecepcionUsados
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
CvePS = Dr("CvePS").ToString.ToEntero
Dim PorcentajeIVA As Decimal = 0.16D
Dim Obs As String = $"Descuento por garantía. BCI: {DdlBCIAjuste.SelectedValue}"
Dim SbBCI As New StringBuilder()
SbBCI.Append("BCI: ")
'AGREGA LOS PRODUCTOS COMO OBSERVACION
For Each GvRow As GridViewRow In GvM.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
SbBCI.AppendFormat("{0},", GvRow.DataKey("CodigoPS"))
End If
Next
SbBCI.Remove(SbBCI.Length - 1, 1)
Dim Obs As String = SbBCI.ToString()
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
@@ -2570,7 +2596,6 @@ Partial Class Inventarios_RecepcionUsados
ObjRemisionNC.Total = Total
ObjRemisionNC.TotalOtrosConceptos = 0
ObjRemisionNC.DtMovimientosUsados = DtMovimientos
ObjRemisionNC.CveAlmacen = DdlAlmacen.SelectedValue.ToEntero()
ObjRemisionNC.ObservacionesMovimiento = TxtObservaciones.Text
@@ -2646,6 +2671,10 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Private Sub CargaPSAjuste()
DdlPSAjuste.setEsWebService(True)
DdlPSAjuste.Attributes.Add("data-cvesubproyecto", "-1")
DdlPSAjuste.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
DdlPSAjuste.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
DdlPSAjuste.ddlWS.Attributes.Add("data-Estatus", "1")
End Sub
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
@@ -2996,28 +3025,38 @@ Partial Class Inventarios_RecepcionUsados
End If
Dim ObjPS As New ClsProductosServicios
Dim CveTamaño As Integer = -1
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
End If
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
If drDatos IsNot Nothing Then
Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
Dim drTamañoPS As DataRow = Nothing
DtMovimientos.Rows.Clear()
If ObjPS.GetPS(drDatos.Item("CvePSCargo").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
Try
Dim CveTamaño As Integer = -1
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero
End If
Else
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If
Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa))
If drDatos IsNot Nothing Then
Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal
Dim drTamañoPS As DataRow = Nothing
DtMovimientos.Rows.Clear()
Select Case RblUsadosAjuste.SelectedValue
Case "0" ' USADOS
CvePS = drDatos.Item("CvePSCargo").ToString.ToEntero
Case "1" ' AJUSTE/GARANTIA
CvePS = DdlPSAjuste.SelectedValue.ToEntero
End Select
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
drTamañoPS = ObjPS.DtResultados.FiltroPrimero("")
'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos
AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe,
"", "-1", "-1", "-1", "", "", -1, "", "", CveTamaño)
End If
Else
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If
Catch ex As Exception
OnError("Ocurrió un error al agregar el producto", ex)
End Try
ObjPS.Dispose()
GuardaAjuste()

View File

@@ -198,6 +198,7 @@
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
@@ -232,6 +233,7 @@
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />

View File

@@ -194,6 +194,9 @@ Partial Class Inventarios_RepAnomalias
e.Row.Cells(8).Text = "0"
End If
If e.Row.Cells(7).Text = MinFecha Then
e.Row.Cells(7).Text = ""
End If
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
End If
@@ -273,9 +276,10 @@ Partial Class Inventarios_RepAnomalias
#End Region
Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable)
Gv.Columns(4).Visible = resultado.MAX("Serie") <> ""
Gv.Columns(5).Visible = resultado.MAX("Lote") <> ""
Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
Gv.Columns(4).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0
Gv.Columns(5).Visible = resultado.MAX("Serie") <> ""
Gv.Columns(6).Visible = resultado.MAX("Lote") <> ""
Gv.Columns(7).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
End Sub
End Class

View File

@@ -3,6 +3,26 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.dSala {
width: 90px;
}
.dlab {
width: 50px;
}
.dSala input {
width: 80px;
text-align: right;
}
.dlab input {
width: 40px;
text-align: right;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
<script>$('body').removeClass('rhumanosbody').addClass('rhumanosbody')</script>
@@ -51,7 +71,7 @@
<asp:UpdatePanel ID="upDatosPA_N" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-3 col-md-offset-1">
<div class="col-md-2 col-md-offset-1">
<div class="dashboard-stat blue">
<div class="visual"><i class="fa fa-sort-numeric-desc"></i></div>
<div class="details">
@@ -59,35 +79,55 @@
<asp:Literal ID="LtlTotal" runat="server"></asp:Literal>
</div>
<div class="desc">
Total Aguinaldo
Total aguinaldo
</div>
</div>
</div>
</div>
<div class="col-md-3 col-md-offset-1">
<div class="col-md-2 col-md-offset-1">
<div class="dashboard-stat green">
<div class="visual"><i class="fa fa-line-chart"></i></div>
<div class="details">
<div class="number">
<asp:Literal ID="LtlAutorizado" runat="server"></asp:Literal></div>
<asp:Literal ID="LtlAutorizado" runat="server"></asp:Literal>
</div>
<div class="desc">
Autorizado
</div>
</div>
</div>
</div>
<div class="col-md-3 col-md-offset-1">
<div class="col-md-2 col-md-offset-1">
<div class="dashboard-stat green">
<div class="visual"><i class="fa fa-line-chart"></i></div>
<div class="details">
<div class="number">
<asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal></div>
<asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal>
</div>
<div class="desc">
Días ejercicio
</div>
</div>
</div>
</div>
<div class="col-md-2 col-md-offset-1">
<div class="dashboard-stat green">
<div class="visual"><i class="fa fa-line-chart"></i></div>
<div class="details">
<div class="number">
<asp:Literal ID="LtlUma" runat="server"></asp:Literal>
</div>
<div class="desc">
UMA
</div>
</div>
</div>
</div>
</div>
<br />
<div style="text-align: right">
<asp:Button ID="BtnRecalcular" CssClass="btn btn-primary" OnClick="BtnRecalcular_Click" runat="server" Text="Recalcular" />
</div>
<asp:GridView ID="GVCalcularAguinaldo" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVCalcularUtilidades" AutoGenerateColumns="False"
DataKeyNames="Nombre,CvePersonal" OnRowDataBound="GVCalcularAguinaldo_RowDataBound">
@@ -97,37 +137,31 @@
<asp:Label ID="lblnombreCompleto" runat="server" Text='<%# Eval("Nombre")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Días Laborados">
<asp:TemplateField HeaderText="Salario diario">
<ItemTemplate>
<asp:Label ID="lbldiasLaborados" runat="server" Text='<%# Eval("DiasLaborados")%>'> </asp:Label>
<asp:TextBox ID="TxtsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
<ItemStyle HorizontalAlign="Right" CssClass="dSala" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Días Aguinaldo">
<asp:TemplateField HeaderText="Días laborados">
<ItemTemplate>
<asp:Label ID="lbldiasAguinaldo" runat="server" Text='<%# Eval("NumDiasAguinaldo")%>'> </asp:Label>
<asp:TextBox ID="TxtdiasLaborados" runat="server" Text='<%# Eval("DiasLaborados")%>'> </asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
<ItemStyle HorizontalAlign="Right" CssClass="dlab" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Salario Diario">
<asp:TemplateField HeaderText="Días aguinaldo">
<ItemTemplate>
<asp:Label ID="lblsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:Label>
<asp:TextBox ID="TxtdiasAguinaldo" runat="server" Text='<%# Eval("NumDiasAguinaldo")%>'> </asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
<ItemStyle HorizontalAlign="Right" CssClass="dlab" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Aguinaldo Completo">
<asp:TemplateField HeaderText="Aguinaldo completo">
<ItemTemplate>
<asp:Label ID="lblsueldoAguinaldoCompleto" runat="server" Text='<%# Eval("AguinaldoCompleto", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Aguinaldo">
<ItemTemplate>
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Aguinaldo Gravado">
<asp:TemplateField HeaderText="Aguinaldo gravado">
<ItemTemplate>
<asp:Label ID="lblAguinaldoGravado" runat="server" Text='<%# Eval("AguinaldoGravado", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
@@ -135,7 +169,13 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto">
<ItemTemplate>
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
<asp:Label ID="lblISRAguinaldo" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Aguinaldo por pagar">
<ItemTemplate>
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
@@ -143,6 +183,7 @@
<ItemTemplate>
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField HeaderText="Gravadas">
<ItemTemplate>
<asp:Label ID="lbluGravadas" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
@@ -174,7 +215,7 @@
<h4 class="modal-title">Autorizar</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="row">
<label class="col-md-4 ">Tipo Período:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoPeriodoB" runat="server" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoPeriodoB_SelectedIndexChanged"
@@ -182,15 +223,15 @@
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="row">
<label class="col-md-4 ">Período:</label>
<div class="col-md-8">
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;" >
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -1,7 +1,10 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -42,6 +45,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
DdlTipoPeriodo.SelectedIndex = 0;
}
}
LtlUma.Text = "86.88";
}
@@ -58,13 +62,14 @@ public partial class Nomina_Aguinaldo : ClsPaginas
DTAguinaldos = objnom.DtResultados;
GVCalcularAguinaldo.DataSource = DTAguinaldos;
LtlTotal.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo"));
LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo","CveNomina>0"));
LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo", "CveNomina>0"));
LtldiasEjercicio.Text = string.Format("{0}/12/31", ejercicio).ToDate().DayOfYear.ToString();
}
GVCalcularAguinaldo.DataBind();
LnkAutorizarModal.Visible = true;
BtnRecalcular_Click(sender, null);
upDatosPA_N.Update();
}
private void CargaPeriodos()
@@ -149,7 +154,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
{
continuar = false;
Alert("debe agregar un concepto para el calculo del aguinaldo", ModExtensiones.TipoMensaje.ToastAdventencia);
}
}
}
if (continuar)
{
@@ -169,9 +174,9 @@ public partial class Nomina_Aguinaldo : ClsPaginas
ImporteGravado = row["AguinaldoGravado"].ToString().ToDecimal();
ImporteExento = Importe - ImporteGravado;
ImporteValor = row["DiasLaborados"].ToString().ToDecimal();
if (CvePersonal > 0 && Importe>0 && row["CveNomina"].ToString().ToEntero()==0)
if (CvePersonal > 0 && Importe > 0 && row["CveNomina"].ToString().ToEntero() == 0)
{
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
{
@@ -261,4 +266,466 @@ public partial class Nomina_Aguinaldo : ClsPaginas
}
}
}
}
protected void BtnRecalcular_Click(object sender, EventArgs e)
{
decimal uma = 86.88m;
decimal aguiexentogral = uma * 30;
decimal salariodiario = 0;
decimal diasanio = 366;
decimal diaslaborados = 0;
decimal diasaguinaldo = 0;
decimal diasaguipago = 0;
decimal salariomensual = 0;
decimal aguinaldo = 0;
decimal aguinaldoexcento = 0;
decimal aguinaldogravado = 0;
decimal diasmes = 30.5m;
decimal FraccionI = 0;
decimal FraccionII_1 = 0;
decimal FraccionII_2 = 0;
decimal FraccionIII_1 = 0;
decimal FraccionIII_2 = 0;
decimal FraccionV = 0;
decimal FraccionIV = 0;
decimal Aguinaldoapagar = 0;
decimal AguinaldoapagarTotal = 0;
StringBuilder str = new StringBuilder();
using (ClsClaseBaseD objbase = new ClsClaseBaseD())
{
foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows)
{
salariodiario = gvrow.FCTextBox("TxtsueldoDiario").Text.ToDecimal();
diaslaborados = gvrow.FCTextBox("TxtdiasLaborados").Text.ToDecimal();
diasaguinaldo = gvrow.FCTextBox("TxtdiasAguinaldo").Text.ToDecimal();
if (salariodiario > 0)
{
diasaguipago = (diaslaborados / diasanio) * diasaguinaldo;
salariomensual = salariodiario * 30;
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()))
{
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;
}
else
{
FraccionIV = 0;
Aguinaldoapagar = aguinaldo - FraccionIV;
}
}
else
{
aguinaldo = 0;
Aguinaldoapagar = 0;
aguinaldogravado = 0;
FraccionIV = 0;
}
AguinaldoapagarTotal += Aguinaldoapagar;
gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text = string.Format("${0:N2}", aguinaldo);
gvrow.FCLabel("lblAguinaldo").Text = string.Format("${0:N2}", Aguinaldoapagar);
gvrow.FCLabel("lblAguinaldoGravado").Text = string.Format("${0:N2}", aguinaldogravado);
gvrow.FCLabel("lblISRAguinaldo").Text = string.Format("${0:N2}", FraccionIV);
}
}
LtlTotal.Text =string.Format("${0:N2}", AguinaldoapagarTotal);
/*
*
*
lblAguinaldo
lblAguinaldoGravado
lblISRAguinaldo
salario diario
dias año
Dias laborados
dias Aguinaldo
dias aguinaldo(PAGO)
UMA
Salario mensual
Aguinaldo
Aguinaldo excento
Aguinaldo gravado
dias mes
FraccionI
FraccionII
FraccionII
FraccionIII
FraccionIII
FraccionV
FraccionIV
Aguinaldoapagar
*
*/
}
}
class ClsClaseBaseD : 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 ClsClaseBaseD(ClsClaseBaseD 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)
{
if (pr.SqlDataType != null)
{
if (pr.ParameterDirection != null)
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
else
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
}
else
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
}
}
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)
{
if ( pr.SqlDataType != null)
{
if ( pr.ParameterDirection != null)
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
else
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
}
else
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
}
}
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);
}
}
public class parametroQuery
{
public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection))
{
this.ParameterName = parameterName;
this.SqlDataType = sqlDataType;
this.ParameterDirection = parameterDirection;
this.SqlValue = sqlValue;
}
public string ParameterName { get; set; }
public SqlDbType SqlDataType { get; set; }
public ParameterDirection ParameterDirection { get; set; }
public object SqlValue { get; set; }
}

View File

@@ -30,7 +30,7 @@
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
<%--<a href="javascript:;" class="expand"></a>--%>
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row" style="margin-left: 10px;">
@@ -81,6 +81,18 @@
</div>
<div class="portlet-body" style="display: none;">
<div class="row" style="margin-left: 10px;">
<label class="col-md-1 " runat="server" style="margin-top: 5px; font-size:12px;">Usuario Registró:</label>
<div class="col-md-2" runat="server">
<asp:DropDownList ID="DdlUsuarios" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveUsuario" DataTextField="Nombre" ValidationGroup="GrpGuardar" CssClass="select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Label runat="server" ID="lblSubProyecto" class="col-md-1 " style="margin-top: 5px; font-size:12px;">Subproyecto:</asp:Label>
<div class="col-md-2" runat="server">
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -73,15 +73,28 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
txtFechaI.Text = DateTime.Now.AddMonths(-1).FirstDayOfMonth().ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString();
CveProveedor = -1;
CargaSubProyectos();
CargaProveedor();
CargaUsuarios();
CargaDatos();
}
private void CargaSubProyectos()
{
CargarCentrosDeCosto(null,DdlSubProyecto,null,lblSubProyecto);
}
private void CargaUsuarios()
{
DdlUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa);
DdlUsuarios.DataBind();
}
protected void CargaProveedor()
{
DdlProveedores.setEsWebService(true);
DdlProveedores.Attributes.Add("data-metodo", "getproveedores");
DdlProveedores.SelectedText = "Seleccione";
DdlProveedores.SelectedText = "Todos";
DdlProveedores.SelectedValue = "-1";
}
@@ -93,7 +106,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
FechaI = (txtFechaI.Text.ToString() != "" ? txtFechaI.Text.ToDateTime() : MinFecha);
FechaF = (txtFechaF.Text.ToString() != "" ? txtFechaF.Text.ToDateTime() : DateTime.Now);
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero()))
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero(),DdlUsuarios.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero()))
{
DtDatos = ObjOC.DtResultados;
GvSolicitudes.DataSource = DtDatos;
@@ -145,6 +158,10 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
if (DdlProveedores.SelectedValue != "-1") { Proveedor = $"&emsp;<b>Proveedor:</b> {DdlProveedores.ddl.SelectedItem.Text}"; } else { Proveedor = ""; }
String Estatus;
if (DdlEstatus.SelectedValue != "1") { Estatus = $"&emsp;<b>Estatus:</b> {DdlEstatus.SelectedItem.Text}"; } else { Estatus = ""; }
String Usuario;
if (DdlUsuarios.SelectedValue != "-1") { Usuario = $"&emsp;<b>Usuario:</b> {DdlUsuarios.SelectedItem.Text}"; } else { Usuario = ""; }
String SubProyectos;
if (DdlSubProyecto.SelectedValue != "-1") { SubProyectos = $"&emsp;<b>{lblSubProyecto.Text}:</b> {DdlSubProyecto.SelectedItem.Text}"; } else { SubProyectos = ""; }
if (DtDatos.Rows.Count > 0)
{
@@ -154,7 +171,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
para.Add(new ReportParameter("Estatus", DdlEstatus.SelectedValue));
String Agrupadores = $"{Proveedor}{FechaI}{FechaF}{Estatus}";
String Agrupadores = $"{Proveedor}{FechaI}{FechaF}{Estatus}{Usuario}{SubProyectos}";
para.Add(new ReportParameter("AgrupadoPor", (Agrupadores == "" ? "": $"<b>Agrupado Por:</b> {Agrupadores}")));
if (Imagen.Exists)
{

View File

@@ -1,132 +0,0 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatChecadorEstaciones.aspx.vb" Inherits="RH_CatChecadorEstaciones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Catálogo Estaciones
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<li>
<asp:LinkButton ID="LnkChecadorEstaciones" runat="server"><i class="fa fa-plus-circle"></i> Agregar</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveChecadorEstaciones" Value="-1" />
<div class="row" style="margin-right: 10px; margin-top: 18px;text-align:right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvChecadorEstaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvChecadorEstaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvChecadorEstaciones" runat="server" GridLines="None" DataKeyNames="CveChecadorEstacion,ChecadorEstacion,CveChecadorTipo,Ip,Puerto,CveZonaHoraria,Estatus,Fecha,CveUsuario,CveEmpresa,ChecadorTipo,Usuario,ZonaHoraria"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-freezerows="1" AutoGenerateColumns ="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Checadores de Estaciones ">
<Columns>
<asp:BoundField DataField="ChecadorEstacion" HeaderText="Checador de Estacion" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="ChecadorTipo" HeaderText="Tipo de Checador" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="ZonaHoraria" HeaderText="Zona Horaria" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Ip" HeaderText="IP" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Puerto" HeaderText="Puerto" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<%--POPUP AGREGAR--%>
<div id="divAddChecadorEstaciones" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpAddChecadorEstaciones" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">Agregar Checador de Estacion</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyChecadorEstaciones" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtChecadorEstaciones" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVChecadorEstaciones" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtChecadorEstaciones" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Checador de Estaciones''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtChecadorEstaciones.ClientID.ToString()%>">Checador de Estaciones:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlChecadorTipo" DataValueField="CveChecadorTipo" Width="150" DataTextField="ChecadorTipo" runat="server" CssClass="form-control select2me"></asp:DropDownList>
<label for="<%= DdlChecadorTipo.ClientID.ToString()%>">Tipo de Checador:</label>
<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RfvDdlChecadorTipo" ControlToValidate="DdlChecadorTipo" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VADdlChecadorTipo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChecadorTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlZonaHoraria" DataValueField="CveZonaHoraria" DataTextField="ZonaHoraria" Width="150" runat="server" CssClass="form-control select2me"></asp:DropDownList>
<label for="<%= DdlZonaHoraria.ClientID.ToString()%>">Zona Horaria:</label>
<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RfvDdlZonaHoraria" ControlToValidate="DdlZonaHoraria" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor seleccione uno." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VADdlZonaHoraria" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlZonaHoraria" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtIp" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="25"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVIp" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtIp" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''IP''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtIp.ClientID.ToString()%>">IP:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPuerto" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="5" ></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FIETxtPuerto" TargetControlID="TxtPuerto" FilterType="Numbers" runat="server" />
<asp:RequiredFieldValidator ID="RFVPuerto" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPuerto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puerto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtPuerto.ClientID.ToString()%>">Puerto:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<i></i>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="BtnAgregarChecadorEstaciones" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -1,131 +0,0 @@

Imports Extensiones
Imports System.Data
Partial Class RH_CatChecadorEstaciones
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDdlChecadorTipo()
CargaDdlZonaHoraria()
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjRH As New ClsRH()
HdnID.Value = -1
If ObjRH.ChecadorEstacionesGet(HdnID.Value, UsuarioActual.CveEmpresa) Then
GvChecadorEstaciones.DataSource = ObjRH.DtResultados
GvChecadorEstaciones.DataBind()
End If
ObjRH.Dispose()
UpDatos.Update()
End Sub
Private Sub CargaDdlChecadorTipo()
Dim ObjRH As New ClsRH()
If ObjRH.DdlChecadorTipoGet(UsuarioActual.CveEmpresa) Then
DdlChecadorTipo.DataSource = ObjRH.DtResultados
DdlChecadorTipo.DataBind()
End If
ObjRH.Dispose()
UpDatos.Update()
End Sub
Private Sub CargaDdlZonaHoraria()
Dim ObjRH As New ClsRH()
If ObjRH.DdlZonaHorariaGet() Then
DdlZonaHoraria.DataSource = ObjRH.DtResultados
DdlZonaHoraria.DataBind()
End If
ObjRH.Dispose()
UpDatos.Update()
End Sub
Private Sub BtnAgregarChecadorEstaciones_Click(sender As Object, e As EventArgs) Handles BtnAgregarChecadorEstaciones.Click
Dim ObjRH As New ClsRH
Dim Estatus = 0
If ChkEstatus.Checked Then Estatus = 1
If HdnModalidad.Value = "A" Then
If ObjRH.ChecadorEstacionesAdd(DdlChecadorTipo.SelectedValue, DdlZonaHoraria.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtChecadorEstaciones.Text, TxtIp.Text, TxtPuerto.Text, Estatus) Then
CargaDatos()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf HdnModalidad.Value = "U" Then
If ObjRH.ChecadorEstacionesUpdate(HdnID.Value, DdlChecadorTipo.SelectedValue, DdlZonaHoraria.SelectedValue, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtChecadorEstaciones.Text, TxtIp.Text, TxtPuerto.Text, Estatus) Then
CargaDatos()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
End If
End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddChecadorEstaciones"))
ObjRH.Dispose()
UpDatos.Update()
End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnModalidad.Value = "U"
HdnID.Value = GvRow.DataKey("CveChecadorEstacion")
UpDatos.Update()
BtnAgregarChecadorEstaciones.Text = "Actualizar"
DdlChecadorTipo.SelectedValueExist(GvRow.DataKey("CveChecadorTipo"))
DdlZonaHoraria.SelectedValueExist(GvRow.DataKey("CveZonaHoraria"))
TxtChecadorEstaciones.Text = GvRow.DataKey("ChecadorEstacion")
TxtIp.Text = GvRow.DataKey("Ip")
TxtPuerto.Text = GvRow.DataKey("Puerto")
ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
UpAddChecadorEstaciones.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddChecadorEstaciones"))
End Sub
Public Sub Agregar()
HdnModalidad.Value = "A"
UpDatos.Update()
BtnAgregarChecadorEstaciones.Text = "Agregar"
TxtChecadorEstaciones.Text = ""
TxtIp.Text = ""
TxtPuerto.Text = ""
CargaDdlChecadorTipo()
CargaDdlZonaHoraria()
ChkEstatus.Checked = False
UpAddChecadorEstaciones.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddChecadorEstaciones"))
End Sub
Public Sub Delete_Click(sender As Object, e As EventArgs)
Dim ObjRH As New ClsRH()
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnID.Value = GvRow.DataKey("CveChecadorEstacion")
UpDatos.Update()
If ObjRH.ChecadorEstacionesRemove(HdnID.Value) Then
CargaDatos()
End If
ObjRH.Dispose()
UpDatos.Update()
End Sub
Private Sub LnkChecadorEstaciones_Click(sender As Object, e As EventArgs) Handles LnkChecadorEstaciones.Click
Agregar()
End Sub
Private Sub GvChecadorEstaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvChecadorEstaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Estatus") = True Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
Else
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
End If
End If
End Sub
End Class

111
RH/CatChecadores.aspx Normal file
View File

@@ -0,0 +1,111 @@
<%@ Page Title="RH - Catálogo de Checadores" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatChecadores.aspx.cs" Inherits="RH_CatChecadores" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Checadores
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="BtnAgregarChecador" OnClick="BtnAgregarChecador_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Checador" Text="<i class='fa fa-plus'></i>Agregar Checador"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveChecador,Checador,CveModelo,CveSubProyecto,SubProyecto,CveUsuario,Estatus,FechaIng,IPLocal,Puerto" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Checador" DataField="Checador" />
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" />
<asp:BoundField HeaderText="IP Local" DataField="IPLocal" />
<asp:BoundField HeaderText="Puerto" DataField="Puerto" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
<asp:BoundField HeaderText="Estatus" DataField="Estatus" />
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
<ItemTemplate>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivAgregarTiposD" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Checadores</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtChecador" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtChecador" runat="server" ControlToValidate="TxtChecador" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Checador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
<label for="TxtChecador">Checador:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlSubProyecto">Subproyecto:</label>
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCODdlSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlModelo">Modelo:</label>
<asp:DropDownList ID="DdlModelo" Width="100%" runat="server" AppendDataBoundItems="true" ValidationGroup="GrpGuardar" CssClass="select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="zkteco" Value="1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModelo" runat="server" ControlToValidate="DdlModelo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modelo''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlModelo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModelo" Width="300px"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtIPLocal" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RegularExpressionValidator ID="RfvTxtIPLocal" runat="server"
ValidationExpression="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
ControlToValidate="TxtIPLocal" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''IP Local''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD" />
<label for="TxtChecador">IP Local:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPuerto" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RegularExpressionValidator ID="RfvTxtPuerto" runat="server" ValidationExpression="\d*" ControlToValidate="TxtPuerto" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puerto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD" />
<label for="TxtPuerto">Puerto:</label>
<i></i>
</div>
<div id="divChkEstatus" runat="server" class="form-group form-md-line-input input-iconright">
<label for="ChkEstatus">Estatus:</label>
<asp:CheckBox runat="server" ID="ChkEstatus" CssClass="make-switchsd" data-size="small" Text=" " />
</div>
</div>
</br>
<div class="modal-footer">
<asp:Button ID="BtnChecadorAgregar" OnClick="BtnChecadorAgregar_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

117
RH/CatChecadores.aspx.cs Normal file
View File

@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
public partial class RH_CatChecadores : ClsPaginas
{
private int CveChecador
{
get
{
return ViewState["CveChecador"].ToString().ToEntero();
}
set
{
ViewState["CveChecador"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaDatos();
CargaSubProyectos();
}
}
private void CargaDatos()
{
ClsRH ObjRH = new ClsRH();
if (ObjRH.GetChecadores(-1, UsuarioActual.CveEmpresa))
{
GvDatos.DataSource = ObjRH.DtResultados;
}
ObjRH.Dispose();
GvDatos.DataBind();
}
private void CargaSubProyectos()
{
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
DdlSubProyecto.DataBind();
}
protected void BtnAgregarChecador_Click(object sender, EventArgs e)
{
TxtChecador.Text = "";
DdlSubProyecto.SelectedValue = "-1";
DdlModelo.SelectedValue = "-1";
TxtIPLocal.Text = "";
TxtPuerto.Text = "";
BtnChecadorAgregar.Text = "Agregar";
divChkEstatus.Visible = false;
UpModalTiposD.Update();
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
}
protected void BtnChecadorAgregar_Click(object sender, EventArgs e)
{
ClsRH ObjRH = new ClsRH();
if (BtnChecadorAgregar.Text == "Agregar")
{
if (ObjRH.AddChecadores(TxtChecador.Text, DdlSubProyecto.SelectedValue.ToEntero(), TxtIPLocal.Text, TxtPuerto.Text, UsuarioActual.CveUsuario,CveModelo:DdlModelo.SelectedValue.ToEntero()))
{
Alert("Checador agregado correctamente");
}
}
else
{
if (ObjRH.UpdateChecadores(CveChecador,TxtChecador.Text,DdlSubProyecto.SelectedValue.ToEntero(),TxtIPLocal.Text,TxtPuerto.Text,Estatus: ChkEstatus.Checked, CveModelo: DdlModelo.SelectedValue.ToEntero()))
{
Alert("Checador actualizado correctamente");
}
}
ObjRH.Dispose();
CargaDatos();
UpDatos.Update();
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
}
protected void LnkEditar_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveChecador = GvRow.DataKey("CveChecador").ToEntero();
TxtChecador.Text = GvRow.DataKey("Checador");
DdlSubProyecto.SelectedValue = GvRow.DataKey("CveSubProyecto");
DdlModelo.SelectedValue = GvRow.DataKey("CveModelo");
TxtIPLocal.Text = GvRow.DataKey("IPLocal");
TxtPuerto.Text = GvRow.DataKey("Puerto");
BtnChecadorAgregar.Text = "Actualizar";
ChkEstatus.Checked = GvRow.DataKey("Estatus") == "Activo";
divChkEstatus.Visible = true;
UpModalTiposD.Update();
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
}
protected void LnkEliminar_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
ClsRH ObjRH = new ClsRH();
if (ObjRH.RemoveChecadores(GvRow.DataKey("CveChecador").ToEntero()))
{
Alert("Checador eliminado correctamente");
CargaDatos();
UpDatos.Update();
}
ObjRH.Dispose();
}
}

View File

@@ -273,188 +273,210 @@ public class TareasJam : IHttpHandler
if (!ErrorProceso)
{
//////////////////////////////////////////////////////////////
this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. ");
int count = 2;
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
var wsVentas = wbVentas.Worksheet(1);
foreach (DataRow DRow in DTVentas.Rows)
try
{
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString();
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
count++;
//////////////////////////////////////////////////////////////
this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. ");
int count = 2;
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
this.GuardaLog($"EjecutaThalamus: archivo excel ventas cargado. ");
this.GuardaLog($"EjecutaThalamus: archivo excel ventas creando sheet.");
var wsVentas = wbVentas.Worksheet(1);
this.GuardaLog($"EjecutaThalamus: archivo excel ventas sheet creada.");
foreach (DataRow DRow in DTVentas.Rows)
{
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString();
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
count++;
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " ");
wbVentas.SaveAs(RutaVentas);
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
var wsAlmacenes = wbAlmacenes.Worksheet(1);
count = 2;
this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. ");
foreach (DataRow DRow in DTAlmacenes.Rows)
{
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString();
count++;
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " ");
wbAlmacenes.SaveAs(RutaAlmacenes);
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
var wsClientes = wbAClientes.Worksheet(1);
count = 2;
this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. ");
foreach (DataRow DRow in DTClientes.Rows)
{
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString();
wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString();
wsClientes.Cell(count, 4).Value = DRow["email"].ToString();
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString();
wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString();
wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString();
count++;
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " ");
wbAClientes.SaveAs(RutaClientes);
var wbProductos = new ClosedXML.Excel.XLWorkbook(FormatoProductos);
var wsProductos = wbProductos.Worksheet(1);
count = 2;
this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. ");
foreach (DataRow DRow in DTProductos.Rows)
{
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString();
wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString();
count++;
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " ");
wbProductos.SaveAs(RutaProductos);
/////////////////////////////////////////////////////////////
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " ");
wbVentas.SaveAs(RutaVentas);
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
var wsAlmacenes = wbAlmacenes.Worksheet(1);
count = 2;
this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. ");
foreach (DataRow DRow in DTAlmacenes.Rows)
catch (Exception ex)
{
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString();
count++;
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " ");
wbAlmacenes.SaveAs(RutaAlmacenes);
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
var wsClientes = wbAClientes.Worksheet(1);
count = 2;
this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. ");
foreach (DataRow DRow in DTClientes.Rows)
{
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString();
wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString();
wsClientes.Cell(count, 4).Value = DRow["email"].ToString();
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString();
wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString();
wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString();
count++;
this.GuardaLog($"EjecutaThalamus: Error procesamiento archivos exel " + ex.StackTrace.ToString() + " ");
ErrorProceso = true;
Respuesta = false;
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " ");
wbAClientes.SaveAs(RutaClientes);
var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos);
var wsProductos = wbProductos.Worksheet(1);
count = 2;
this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. ");
foreach (DataRow DRow in DTProductos.Rows)
if (!ErrorProceso)
{
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString();
wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString();
var FInfoProductos = new FileInfo(RutaProductos);
var FInfoVentas = new FileInfo(RutaVentas);
var FInfoClientes = new FileInfo(RutaClientes);
var FInfoAlmacenes = new FileInfo(RutaAlmacenes);
count++;
}
this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " ");
wbProductos.SaveAs(RutaProductos);
/////////////////////////////////////////////////////////////
bool CargaProductos = false;
bool CargaVentas = false;
bool CargaClientes = false;
bool CargaAlmacenes = false;
var FInfoProductos = new FileInfo(RutaProductos);
var FInfoVentas = new FileInfo(RutaVentas);
var FInfoClientes = new FileInfo(RutaClientes);
var FInfoAlmacenes = new FileInfo(RutaAlmacenes);
bool CargaProductos = false;
bool CargaVentas = false;
bool CargaClientes = false;
bool CargaAlmacenes = false;
SBLog.AppendLine("<b>Cargas</b><br>");
SBLog.AppendLine("<table border='1'> <tr><th>Archivo</th><th>Estado</th></tr>");
SBLog.AppendLine("<b>Cargas</b><br>");
SBLog.AppendLine("<table border='1'> <tr><th>Archivo</th><th>Estado</th></tr>");
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. ");
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. ");
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
if (CargaProductos)
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. ");
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
}
if (CargaProductos)
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. ");
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
}
if (CargaProductos)
{
SBLog.AppendLine($"<tr><td>Productos</td><td>ok</td></tr>");
}
else
{
SBLog.AppendLine($"<tr><td>Productos</td><td>Error carga</td></tr>");
}
if (CargaProductos)
{
SBLog.AppendLine($"<tr><td>Productos</td><td>ok</td></tr>");
}
else
{
SBLog.AppendLine($"<tr><td>Productos</td><td>Error carga</td></tr>");
}
if (CargaProductos)
{
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. ");
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
if (CargaVentas)
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. ");
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
}
}
if (CargaProductos)
{
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. ");
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
if (CargaVentas)
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. ");
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>");
}
else
{
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>");
}
}
if (CargaVentas)
{
SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>");
}
else
{
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>");
}
if (CargaProductos & CargaVentas)
{
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. ");
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
if (CargaClientes)
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. ");
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
}
}
if (CargaProductos & CargaVentas)
{
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. ");
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
if (CargaClientes)
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. ");
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>");
}
}
if (CargaClientes)
{
SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>");
}
else
{
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error carga</td></tr>");
}
if (CargaProductos & CargaVentas & CargaClientes)
{
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. ");
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
if (CargaClientes)
else
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. ");
CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass);
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error carga</td></tr>");
}
}
if (CargaAlmacenes)
{
SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>");
}
else
{
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error carga</td></tr>");
}
if (CargaProductos & CargaVentas & CargaClientes)
{
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. ");
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
if (CargaClientes)
{
this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. ");
CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass);
}
}
if (CargaAlmacenes)
{
SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>");
}
else
{
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error carga</td></tr>");
}
if (CargaProductos & CargaVentas & CargaClientes & CargaAlmacenes)
{
Respuesta = true;
}
else
if (CargaProductos & CargaVentas & CargaClientes & CargaAlmacenes)
{
Respuesta = true;
}
else
{
Respuesta = false;
}
}else
{
Respuesta = false;
}
@@ -505,8 +527,8 @@ public class TareasJam : IHttpHandler
ClsSisMail Correo = new ClsSisMail();
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
// string Para = "oscar.irigoyen@adssistemas.mx";
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
// string Para = "oscar.irigoyen@adssistemas.mx";
string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}";
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);

View File

@@ -4155,61 +4155,7 @@
<ajax:TabPanel ID="TabUsados" runat="server" HeaderText="Usados" Visible="false">
<ContentTemplate>
<div class="row">
<div class="col-md-6 " id="DVusadosResumen" runat="server">
<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">Usados resumen</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel runat="server" ID="UpUsadosResumen" UpdateMode="Conditional">
<ContentTemplate>
<table style="width: 100%!important">
<tr>
<td style="width: 140px!important">Puntos</td>
<td style="text-align: right!important; width: 120px!important">
<asp:Label runat="server" ID="LblUsadosPuntos"></asp:Label></td>
<td style="text-align: right!important"></td>
</tr>
<tr>
<td>Importe Cargo</td>
<td style="text-align: right!important">$
<asp:Label runat="server" ID="LblUsadosImpCargo"></asp:Label></td>
<td style="text-align: right!important">
<asp:Button runat="server" Visible="false" Height="34px" Width="300px" ID="LnkFacturaUsadosCargos" CssClass="btn btn-primary" Text="Generar NC Cargo" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar generación de remisión de nota de crédito de cargos" data-btn-ok-label="si" OnClick="LnkFacturaUsadosCargos_Click"></asp:Button>
</td>
</tr>
<tr>
<td>Importe Bonificación</td>
<td style="text-align: right!important">$
<asp:Label runat="server" ID="LblusadosImpBonificacion"></asp:Label></td>
<td style="text-align: right!important">
<asp:Button runat="server" Height="34px" Width="300px" ID="LnkFacturaUsadosBonificacion" CssClass="btn btn-primary" Text="Generar RNC de Bonificación" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar generación de remisión de nota de crédito de bonificación" data-btn-ok-label="si" OnClick="LnkFacturaUsadosBonificacion_Click"></asp:Button>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-6" id="DivSaldoUsados" runat="server">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
@@ -4219,23 +4165,28 @@
</div>
<div class="actions">
<div class="btn-group">
<asp:Button runat="server" Width="250px" ID="LnkFacturaUsadosBonificacion" CssClass="btn btn-primary" Text="Generar RNC de Bonificación" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar generación de remisión de nota de crédito de bonificación" data-btn-ok-label="si" OnClick="LnkFacturaUsadosBonificacion_Click"></asp:Button>
</div>
</div>
</div>
<div class="portlet-body form">
<asp:UpdatePanel ID="UpGvUsadosResumen" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvUsadosResumen" Width="100%" runat="server" GridLines="None"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="SaldoCliente" HeaderText="" />
<asp:BoundField DataField="Puntos" HeaderText="Puntos" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
<asp:BoundField DataField="Valor" HeaderText="Valor $" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UpGvUsadosResumen" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvUsadosResumen" Width="100%" runat="server" GridLines="None" DataKeyNames="Puntos"
CssClass="table table-striped table-advance table-hover ScrollAD " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="SaldoCliente" HeaderText="" />
<asp:BoundField DataField="Puntos" HeaderText="Puntos" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
<asp:BoundField DataField="Valor" HeaderText="Valor $" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" ControlStyle-BorderWidth="150px" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>

View File

@@ -4783,7 +4783,7 @@ Partial Class Clientes
Exit Select
Case 6
TxtCuentaValor.Visible = True
TxtCuentaValor.TextMode = TextBoxMode.Number
TxtCuentaValor.TextMode = TextBoxMode.SingleLine
If Requerido = 1 Then
RFVCuentaValor1.Enabled = True
@@ -4893,7 +4893,7 @@ Partial Class Clientes
Exit Select
Case 6
TxtCuentaValor.Visible = True
TxtCuentaValor.TextMode = TextBoxMode.Number
TxtCuentaValor.TextMode = TextBoxMode.SingleLine
If Requerido = 1 Then
RFVCuentaValor2.Enabled = True
@@ -9135,45 +9135,27 @@ Partial Class Clientes
Dim ObjAcum As New ClsAcumuladores
Dim ImporteCargo As Decimal = 0D
Dim ImporteBonificacion As Decimal = 0D
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate, CveConcepto:=DdlConceptoUsado.SelectedValue.ToEntero()) Then
GvAcum.DataSource = ObjAcum.DtResultados
LblUsadosPuntos.Text = (ObjAcum.DtResultados.SUM("Puntos", " CveConcepto = 2 ") - ObjAcum.DtResultados.SUM("Puntos", " CveConcepto IN (1,3) ")).ToDecimal.FormatoNumero(2)
ImporteCargo = ObjAcum.DtResultados.SUM("ImporteCargo", "(FacturadoCargo = 0 OR FacturadoCargo IS NULL) AND CveConcepto = 1 ").ToDecimal
ImporteBonificacion = ObjAcum.DtResultados.SUM("ImporteBonificacion", "(FacturadoBonificacion = 0 OR FacturadoBonificacion IS NULL) AND CveConcepto = 1 ").ToDecimal
LblUsadosImpCargo.Text = ImporteCargo.FormatoNumero(2)
LblusadosImpBonificacion.Text = ImporteBonificacion.FormatoNumero(2)
Else
GvAcum.DataSource = Nothing
ImporteCargo = 0D
ImporteBonificacion = 0D
LblUsadosImpCargo.Text = ""
LblusadosImpBonificacion.Text = ""
LblUsadosPuntos.Text = ""
End If
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
End If
Dim ImporteBonificacion As Decimal = 0
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count > 0 Then
GvUsadosResumen.DataSource = ObjAcum.DtResultados
ImporteBonificacion = ObjAcum.DtResultados.Rows(4)("Valor").ToString().ToDecimal()
End If
GvUsadosResumen.DataBind()
'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
GvUsadosResumen.DataBind()
'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
ObjAcum.Dispose()
GvAcum.DataBind()
UpAcciones.Update()
UpUsadosResumen.Update()
'UpUsadosResumen.Update()
UpGvUsadosResumen.Update()
UpAcum.Update()
@@ -10187,7 +10169,7 @@ Partial Class Clientes
Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
Dim Acum As New ClsAcumuladores
Dim Puntos As Decimal = -LblUsadosPuntos.Text.ToDecimal
Dim Puntos As Decimal = -GvUsadosResumen.Rows.Cast(Of GridViewRow).Where(Function(x) x.RowType = DataControlRowType.DataRow).FirstOrDefault(Function(gvr) gvr.RowIndex = 3).DataKey("Puntos").ToEntero()
If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then
Alert("Puntuación Inicializada")
End If

View File

@@ -102,7 +102,7 @@
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server"
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS"
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS,PorcentajePrecioPublico,DiasPago"
EmptyDataText="No se han encontrado datos con los filtros especificados." data-sort="true" GridLines="None"
CssClass="table table-hover table-striped Widthall ScrollAD " Width="100%" AutoGenerateColumns="False"
OnRowDataBound="GvDatos_RowDataBound" OnPreRender="GvDatos_PreRender">

View File

@@ -113,28 +113,24 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
{
e.Row.CssClass = "SubTotales2";
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
}
else
{
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
{
e.Row.FCLinkButton("LnkInfo").Visible = true;
//if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0)
//{
// //if (UsuarioActual.TienePermisoProceso(201))
// //{
// // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// //}
// //else
// //{
// e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
// //}
//}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 )
//{
// e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
// e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
}
else
{
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
{
e.Row.FCLinkButton("LnkInfo").Visible = true;
if (!Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
}
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() > 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
}
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
}
else if (e.Row.DataKey("Comision").ToDouble() > 0)
{
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. El producto es: <b>{e.Row.DataKey("CodigoPS").ToString()}</b>. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
@@ -357,19 +353,19 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
}
protected void LnkInfo_Click(object sender, EventArgs e)
protected void LnkInfo_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
{
LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales.<br/> La categoria del producto es: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}</b>. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
}
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
{
LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> y esta dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
}
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
{
LblInfo.Text = $"El producto se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
}

View File

@@ -6273,12 +6273,21 @@
</div>
</div>
<div class="row">
<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="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</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="DivRNCCargo" runat="server">
<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>
<span class="caption-subject bold uppercase"><asp:Literal ID="LtlCargos" runat="server" Text=""></asp:Literal></span>
</div>
<div class="actions">
<div class="btn-group">
@@ -6305,7 +6314,7 @@
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" AutoPostBack="true" OnCheckedChanged="ChkAplicarNCBon_CheckedChanged" />
<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" />
@@ -8086,75 +8095,75 @@
function LimpiaModal() {
$('#<%= TxtDireccion.ClientID %>').val('');
$('#<%= TxtColonia.ClientID %>').val('');
$('#<%= TxtCiudad.ClientID %>').val('');
$('#<%= TxtEstado.ClientID %>').val('');
$('#<%= TxtCP.ClientID %>').val('');
}
$('#<%= TxtColonia.ClientID %>').val('');
$('#<%= TxtCiudad.ClientID %>').val('');
$('#<%= TxtEstado.ClientID %>').val('');
$('#<%= TxtCP.ClientID %>').val('');
}
function BtnMateriales() {
$('#BtnMateriales').click();
}
function BtnMateriales() {
$('#BtnMateriales').click();
}
function BtnEnviarMailCancelacion() {
$('#BtnEnviarMailCancelacion').click();
}
function BtnRefacturacionConfirmar() {
$('#BtnRefacturacionConfirmar').click();
}
function BtnRefacturacionConfirmarAceptacion(Liga) {
$('#BtnRefacturacionConfirmarAceptacion').click();
}
function BtnRefrescarPagina() {
$('#BtnRefrescarPagina').click();
}
function Recargar() {
$('#BtnRefrescarPagina').click();
}
function BtnAplicaNuevaNC() {
$('#BtnAplicaNuevaNC').click();
}
function BtnEnviarMailCancelacion() {
$('#BtnEnviarMailCancelacion').click();
}
function BtnRefacturacionConfirmar() {
$('#BtnRefacturacionConfirmar').click();
}
function BtnRefacturacionConfirmarAceptacion(Liga) {
$('#BtnRefacturacionConfirmarAceptacion').click();
}
function BtnRefrescarPagina() {
$('#BtnRefrescarPagina').click();
}
function Recargar() {
$('#BtnRefrescarPagina').click();
}
function BtnAplicaNuevaNC() {
$('#BtnAplicaNuevaNC').click();
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
var $this = $(this);
var ind = $this.index();
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
//log($this);
});
var scrollfuncion = function () {
var stop = this.scrollTop;
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
}
function CargaExistenciaAlmacenes(data, params) {
var div = $('<div class="select2anothertable" style=" max-width: 950px; overflow-x: auto;"></div>');
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
var table = $('<table id="TExistencias" ></table>'); div.append(table);
var tbody = $('<tbody></tbody>'); table.append(tbody);
$(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
$(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
var indexd = 0;
data.forEach(function (item) {
if (indexd == 0) {
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
var $this = $(this);
var ind = $this.index();
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr.active").removeClass('active');
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable tr:nth-child(" + (ind + 2) + ")").addClass('active');
//log($this);
});
var scrollfuncion = function () {
var stop = this.scrollTop;
$(".select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable").scrollTop(stop);
}
function CargaExistenciaAlmacenes(data, params) {
var div = $('<div class="select2anothertable" style=" max-width: 950px; overflow-x: auto;"></div>');
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown .select2anothertable').remove();
$('.select2-container.select2-container--default.select2-container--open .select2-dropdown').prepend(div);
var table = $('<table id="TExistencias" ></table>'); div.append(table);
var tbody = $('<tbody></tbody>'); table.append(tbody);
$(".select2-container--default .select2-results>.select2-results__options").off("scroll", scrollfuncion);
$(".select2-container--default .select2-results>.select2-results__options").scroll(scrollfuncion);
var indexd = 0;
data.forEach(function (item) {
if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); }
}
}
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); }
}
}
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
for (var key in item) {
if (!(key == "text" || key == "id")) {
if ((item[key] > 0)) {
td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
} else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
if (!(key == "text" || key == "id")) {
if ((item[key] > 0)) {
td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
} else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');"
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td);
} else {
@@ -8361,44 +8370,44 @@
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);
}
} 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('');
$('#divAgregarCliente').modal();
}
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 hideDivEC() {
$('#divAgregarCliente').modal('hide');
}
$('#divAgregarCliente').modal();
}
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 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) {

View File

@@ -3926,7 +3926,7 @@ Partial Class Ventas
LblAlertRefacInv.Visible = True
End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
If UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
@@ -14777,6 +14777,7 @@ Partial Class Ventas
If NuevaFactura = 1 AndAlso UsuarioActual.TienePermisoProceso(222) Then
If ObjVentas.GetVentaDetalle(ObjFacturaDevolucion.CveVenta) Then
TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
End If
ErrorCancelar = ProcesoPrepolizas(ObjConta, ObjFacturaDevolucion, -1, TmpDT, ObjAC, -1, ObjBancos, ObjVentas)
Else
@@ -20880,8 +20881,16 @@ Partial Class Ventas
RegistraScript("$('#ModalCancelarDocumento').modal();")
UpCancelarDocumento.Update()
sb.Clear()
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
Dim ObjVentas As New ClsVentas
If ObjVentas.UpdateEstatusVenta(CveVenta, 22, UsuarioActual.CveEmpresa) Then
Dim redirectString As String = String.Format("document.location.href=""/Ventas/Ventas.aspx?CveVenta={0}""", CveVenta)
Alert("Pedido cancelado.", JSBtnAceptar:=redirectString)
', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta
End If
ObjVentas.Dispose()
Else
CancelarDocumento()
CancelarDocumento()
End If
End Sub
@@ -23584,7 +23593,7 @@ Partial Class Ventas
End Sub
Protected Sub DdlVentaUsado_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero())
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
End Sub
Private Sub InicializaAplicarNCMasiva()
@@ -23605,7 +23614,9 @@ Partial Class Ventas
'LkNotaCredito.Visible = False
DivGvCxC.Visible = True
CargaCxC()
CargaRNC()
'CARGAR RNC
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNCMasivo();")
TxtNCImporte.Text = "0.00"
TxtNCImporte.Enabled = False
@@ -23624,6 +23635,28 @@ Partial Class Ventas
ObjMovtos.Dispose()
GvCxC.DataBind()
End Sub
Protected Sub RblRNCTipo_SelectedIndexChanged(sender As Object, e As EventArgs)
Select Case RblRNCTipo.SelectedValue
Case "1" 'CARGOS
LtlCargos.Text = "CARGOS"
DivRNCCargo.Visible = True
DivRNCBon.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero(), False, False)
Case "2" 'BONIFICACIONES
DivRNCCargo.Visible = False
DivRNCBon.Visible = True
CargaRNC(-1, True, False)
Case "3" 'AJUSTE/GARANTIAS
LtlCargos.Text = "AJUSTES/GARANTIAS"
DivRNCCargo.Visible = True
DivRNCBon.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero(), False, True)
End Select
End Sub
Protected Sub ChkMostarProductosRNC_CheckedChanged(sender As Object, e As EventArgs)
If ChkMostarProductosRNC.Checked Then
DivRNCCargos.Visible = False
@@ -23632,11 +23665,11 @@ Partial Class Ventas
Else
DivRNCCargos.Visible = True
DivRNCCargosDetalle.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero())
RblRNCTipo_SelectedIndexChanged(RblRNCTipo, EventArgs.Empty)
End If
UpModalRemisionesNC.Update()
End Sub
Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1)
Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1, Optional CargarBonificaciones As Boolean = False, Optional CargarSoloGarantias As Boolean = False)
Dim DtNC As DataTable = Nothing
Dim ObjMovtos As New ClsMovimientos()
@@ -23645,16 +23678,24 @@ Partial Class Ventas
End If
ObjMovtos.Dispose()
TmpDTRNCBonificacionesSeleccionadas = Nothing
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1")
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
Me.TmpDTRNCBonificacionesSeleccionadas = Nothing
Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
If CargarBonificaciones Then
Me.TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Copy()
End If
If CargarSoloGarantias Then
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = True")
Else
GvRemisionesNC.DataSource = DtNC.FiltraParametros("TipoRNC = 1 AND EsGarantia = False")
End If
GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNC.DataBind()
GvRemisionesNCBon.DataBind()
@@ -24121,12 +24162,18 @@ Partial Class Ventas
End If
Else
For Each RNC In ListaRemisionesNC
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
Next
For Each RNC In ListaNCBonificacion
DtImpuestosBonificacion.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
Next
If ListaRemisionesNC IsNot Nothing Then
For Each RNC In ListaRemisionesNC
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
Next
End If
If ListaNCBonificacion IsNot Nothing Then
For Each RNC In ListaNCBonificacion
DtImpuestosBonificacion.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True, AplicaImpuestosLocales:=AplicaImpuestosLocales, NivelTotal:=DdlNCNivelImporte.SelectedValue.ToEntero(), AplicaNCUsado:=(UsuarioActual.CveEmpresa = 140)), True, MissingSchemaAction.Ignore)
Next
End If
End If
@@ -24322,12 +24369,11 @@ Partial Class Ventas
For Each RNC In ListaNC
Dim UltimoRenglonRNC As Integer = 1
Dim TotalAcumuladoRNC As Decimal = 0
Dim Terminar As Boolean = False
For Each RowUsado As DataRow In RNC.DtDetalle.Rows
Dim PorcentajeAplicado = (RNC.TotalRemNCAplicado / RNC.Total)
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim Obs = RowUsado("CodigoPS").ToString()
@@ -24347,8 +24393,33 @@ Partial Class Ventas
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI EL IMPORTE ES MAYOR REALIZA EL AJUSTE
If TotalAcumuladoRNC > RNC.TotalRemNCAplicado Then
Terminar = True
'RESTA LO SUMANDO DEL ACUMULADO
TotalAcumuladoRNC -= (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim Diferencia As Decimal = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
Dim TotalPartida As Decimal = (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim PorcentajePorAplicar As Decimal = (Diferencia / TotalPartida)
Cantidad = Cantidad * PorcentajePorAplicar
TotalCalculableImpuestos = (Cantidad * ImportePU)
ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
ImporteIEPS = (TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
ImporteRetIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
ImporteRetISR = (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
End If
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count OrElse Terminar Then
Dim Ajuste As Decimal = 0
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
@@ -24363,6 +24434,10 @@ Partial Class Ventas
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
RowUsado("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalle").ToString().ToEntero())
If Terminar Then
Exit For
End If
Next
Next
@@ -24426,6 +24501,7 @@ Partial Class Ventas
For Each RNCBonificacion In ListaNCBonificacion
Dim UltimoRenglonRNC As Integer = 1
Dim TotalAcumuladoRNC As Decimal = 0
Dim Terminar As Boolean = False
Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault()
@@ -24433,7 +24509,7 @@ Partial Class Ventas
Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total)
Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() '* PorcentajeAplicado
Dim Obs = RowCargo("CodigoPS").ToString()
@@ -24453,6 +24529,31 @@ Partial Class Ventas
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI EL IMPORTE ES MAYOR REALIZA EL AJUSTE
If TotalAcumuladoRNC > RNCBonificacion.TotalRemNCAplicado Then
Terminar = True
'RESTA LO SUMANDO DEL ACUMULADO
TotalAcumuladoRNC -= (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim Diferencia As Decimal = RNCBonificacion.TotalRemNCAplicado - TotalAcumuladoRNC
Dim TotalPartida As Decimal = (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
Dim PorcentajePorAplicar As Decimal = (Diferencia / TotalPartida)
Cantidad = Cantidad * PorcentajePorAplicar
TotalCalculableImpuestos = (Cantidad * ImportePU)
ImporteIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
ImporteIEPS = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
ImporteRetIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
ImporteRetISR = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
End If
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNCCargo.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0
@@ -24493,6 +24594,7 @@ Partial Class Ventas
TmpDT = ObjVentas.DtResultados.Copy()
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
End If
If AplicaNCMasiva OrElse AplicaNCUsado Then
@@ -27478,6 +27580,18 @@ Partial Class Ventas
Dim TotalRemNCAplicado As Decimal = 0
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCConcepto As Integer = -1
Select Case RblRNCTipo.SelectedValue
Case "1" 'CARGOS
NCConcepto = ArrayNC(3).ToEntero()
Case "2" 'BONIFICACIONES
NCConcepto = ArrayNC(4).ToEntero()
Case "3" 'AJUSTE/GARANTIAS
NCConcepto = ArrayNC(1).ToEntero()
End Select
If ChkMostarProductosRNC.Checked Then
Me.AplicaRNCXDetalle = True
@@ -27560,24 +27674,18 @@ Partial Class Ventas
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1
Dim NCGarantiaTotal As Integer = -1
If ArrayNC.Length > 2 Then
NCAjuste = ArrayNC(1).ToEntero()
NCGarantiaTotal = ArrayNC(2).ToEntero()
End If
Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
'SI ES GARANTIA TOTAL
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
DdlNCPS.SelectedValueExist(NCGarantiaTotal)
DdlNCPS.Enabled = False
If ArrayNC.Length > 2 Then
NCConcepto = ArrayNC(2).ToEntero()
End If
Salir = True
Else
DdlNCPS.SelectedValueExist(NCAjuste)
DdlNCPS.Enabled = False
If ArrayNC.Length > 2 Then
NCConcepto = ArrayNC(1).ToEntero()
End If
End If
End If
End Using
@@ -27590,7 +27698,6 @@ Partial Class Ventas
DdlNCPS.Enabled = True
End If
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
@@ -27609,8 +27716,22 @@ Partial Class Ventas
End If
End If
Next
'SI SON SOLO BONIFICACIONES GENERA LA NC PRINCIPAL EN BASE A ESAS
If RblRNCTipo.SelectedValue.ToString() = "2" AndAlso ListaRemisionesNC.Count = 0 Then
ListaRemisionesNC.AddRange(ListaNCBonificacion)
ListaNCBonificacion.Clear()
End If
End If
Dim DrPSSeleccionado As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCConcepto).FiltroPrimero("")
If DrPSSeleccionado IsNot Nothing Then
DdlNCPS.SelectedValueExistInsert(NCConcepto, DrPSSeleccionado("PS").ToString())
DdlNCPS.Enabled = False
End If
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
@@ -28409,5 +28530,4 @@ Partial Class Ventas
Public ImporteBonificacion As Decimal = 0
Public IVABonificacion As Decimal = 0
End Class
End Class