This commit is contained in:
HECTOR RODRIGUEZ
2021-06-10 21:57:47 -07:00
57 changed files with 4735 additions and 6279 deletions

View File

@@ -87,7 +87,7 @@ Public Class ClsClientes
Public Property Codigo As String
Public Property LimiteCredito As Double
'Public Property NumCtaPago As String
'Public Property CveMetodoPago As Integer
Public Property CveMetodoPago As Integer
Public Property AplicaFEMSA As Boolean
Public Property FEMSA_NumSociedad As String
Public Property FEMSA_NumProveedor As String

View File

@@ -3225,7 +3225,7 @@ Public Class ClsContabilidad
#Region " CUENTAS "
Public Function GetCuentas(CveCuenta As Integer, Codigo As String, Afectable As Integer, CveEmpresa As Integer, Optional RowNum As Integer = 100000, Optional CvePadre As Integer = -1) As Boolean ', Codigo As String, Nombre As String, CveClasificacionCuenta As Integer, TipoCuenta As Integer, Afectable As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
Public Function GetCuentas(CveCuenta As Integer, Codigo As String, Afectable As Integer, CveEmpresa As Integer, Optional RowNum As Integer = 100000, Optional CvePadre As Integer = -1, Optional Nombre As String = "-1") As Boolean ', Codigo As String, Nombre As String, CveClasificacionCuenta As Integer, TipoCuenta As Integer, Afectable As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_CuentasGet")
@@ -3234,6 +3234,7 @@ Public Class ClsContabilidad
.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
.Add("@Afectable", SqlDbType.VarChar).Value = Afectable
.Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
.Add("@Nombre", SqlDbType.VarChar).Value = Nombre
.Add("@RowNum", SqlDbType.VarChar).Value = RowNum
.Add("@CvePadre", SqlDbType.Int).Value = CvePadre
End With

View File

@@ -2619,13 +2619,13 @@ Public Class ClsGenerales
#End Region
#Region "SAT PRODUCTOS SERVICIOS Y UNIDAD DE MEDIDA"
Public Function GetSATProductosServicios() As Boolean
Public Function GetSATProductosServicios(Optional SATClaveProductoServicio As String = "-1", Optional CveSATPS As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_SAT_ProductosServiciosGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@SATClaveProductoServicio", SqlDbType.VarChar).Value = SATClaveProductoServicio
.Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
End With
'SqlTypes.SqlDateTime.Null
Try

View File

@@ -130,7 +130,8 @@ Public Class ClsNominas
.CommandText = pStrSQL
.CommandType = TipoComando
End With
Data = New DataTable
Data = New DataTable()
DTSet = New DataSet()
If SqlTransacc IsNot Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
End Sub
#Region "Conexiones"
@@ -171,6 +172,47 @@ Public Class ClsNominas
#End Region
#Region "ClsNominas_Nominas"
Public Function NominaUpMetododepago(cveEmpresa As Integer, CvePersonal As Integer, CvePeriodo As Integer, MetodoPagoFijo As Boolean,
CveMetodoPago As Integer, CveSATBanco As Integer, BancoNumCuenta As String, CLABE As String) As Boolean
Dim retorno As Boolean = False
DTSet = New DataSet()
DataAdapter("PA_Nom_NominaUpMetododepago", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@MetodoPagoFijo", SqlDbType.Bit).Value = MetodoPagoFijo
.Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago
.Add("@CveSATBanco", SqlDbType.Int).Value = CveSATBanco
.Add("@BancoNumCuenta", SqlDbType.VarChar).Value = BancoNumCuenta
.Add("@CLABE", SqlDbType.VarChar).Value = CLABE
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
End With
Try
SqlAdapter.Fill(DTSetResultados)
retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar forma de pago.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function PersonalISRAnual(CvePersonal As Integer, cveEmpresa As Integer, Ejercicio As Integer) As Boolean
Dim retorno As Boolean = False
DTSet = New DataSet()
DataAdapter("PA_Nom_PersonalISRAnual", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio
End With
Try
SqlAdapter.Fill(DTSet)
retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function RemoveFiniquito(CvePersonal As Integer, cveEmpresa As Integer, CvePersonalAltas As Integer) As Boolean
Dim retorno As Boolean = False
DTSet = New DataSet()
@@ -270,7 +312,7 @@ Public Class ClsNominas
End Function
Public Function GetCalculoAguinaldo(ejercicio As Int32, cveEmpresa As Int32, importe As Double, CveTipoPeriodo As Integer, CvePeriodo As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_NomCalcularAguinaldo", CommandType.StoredProcedure)
DataAdapter("PA_Nom_CalcularAguinaldo", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@Ejercicio", SqlDbType.Int).Value = ejercicio
@@ -286,24 +328,28 @@ Public Class ClsNominas
End Try
Return retorno
End Function
Public Function Autorizaperiodoconta(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean
Public Function RegistraProvision(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_Autorizaperiodoconta", CommandType.StoredProcedure)
DataAdapter("PA_Nom_RegistraProvision", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
SqlAdapter.Fill(DTSet)
Data = New DataTable
If DTSet.Tables.Count > 0 Then
Data = DTSet.Tables(0)
End If
retorno = True
Catch ex As Exception
OnError("Ocurrió un error al autorizar periodo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
OnError("Ocurrió un error al registrar la provisión de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function GetDispersiondenomina(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean
Public Function GetDispersionnomina(CvePeriodo As Int32, CveEmpresa As Int32) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_PA_NomDispersiondenomina", CommandType.StoredProcedure)
DataAdapter("PA_Nom_Dispersionnomina", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
@@ -318,7 +364,7 @@ Public Class ClsNominas
End Function
Public Function GetCalculoUtilidades(ejercicio As Int32, cveEmpresa As Int32, importe As Double, importeA As Double) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_NomCalcularUtilidades", CommandType.StoredProcedure)
DataAdapter("PA_Nom_CalcularUtilidades", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
.Add("@Ejercicio", SqlDbType.Int).Value = ejercicio
@@ -542,8 +588,13 @@ Public Class ClsNominas
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al Guardar el Movimiento de Nomina.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
'
Catch sqlex As SqlException
If sqlex.Message.Contains("x5010") Then
Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina(Timbrada).", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
End Try
Return Retorno
@@ -786,6 +837,14 @@ Public Class ClsNominas
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch sqlex As SqlException
If sqlex.Message.Contains("Número: 50001x") Then
Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina(Timbrada).", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", sqlex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
Me.OnError("Ocurrió un error al eliminar el Movimiento de Nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
@@ -1930,12 +1989,13 @@ Public Class ClsNominas
End Function
#End Region
Public Function GetFiniquitosPersonal(CvePersonal As Integer, CveEmpresa As Integer, Optional Limpiar As Integer = 0) As Boolean
Public Function GetFiniquitosPersonal(CvePersonal As Integer, CveEmpresa As Integer, Optional Limpiar As Integer = 0, Optional diasindemnizacion As Integer = 90) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Nom_FiniquitosGET")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@diasindemnizacion", SqlDbType.Int).Value = diasindemnizacion
'.Add("@Limpiar", SqlDbType.Int).Value = Limpiar
End With
Try
@@ -2494,7 +2554,7 @@ Public Class ClsNominas
End Try
Return retorno
End Function
Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean) As Boolean
Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure)
@@ -2508,20 +2568,21 @@ Public Class ClsNominas
.Add("@montoLimite", SqlDbType.Decimal).Value = (montoLimite)
.Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion)
.Add("@estatus", SqlDbType.Bit).Value = (estatus)
.Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta)
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al agregar los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
OnError("Ocurrió un error al agregar los movimientos permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al agregar los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
OnError("Ocurrió un error al agregar los movimientos permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function UpMovtoPermanente(cveMovtoPermanente As Int32, cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean) As Boolean
Public Function UpMovtoPermanente(cveMovtoPermanente As Int32, cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_UpMovtoPermanente", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
@@ -2535,16 +2596,21 @@ Public Class ClsNominas
.Add("@montoLimite", SqlDbType.Decimal).Value = (montoLimite)
.Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion)
.Add("@estatus", SqlDbType.Bit).Value = (estatus)
.Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta)
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch sqEx As SqlException
retorno = False
OnError("Ocurrió un error al agregar los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
If (sqEx.Message.Contains("FK_Conta_CuentasAsignaciones_Conta_ConceptosContables")) Then
OnError("Es necesario asignar el concepto contable al concepto de nomina para poder realizar la vinculacion de la cuenta.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
OnError("Ocurrió un error al actualizar los movimientos permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
retorno = False
OnError("Ocurrió un error al agregar los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
OnError("Ocurrió un error al actualizar los movimientos permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function

View File

@@ -293,7 +293,7 @@ Public Class ClsPaginas
Application("Directorio") = value
End Set
End Property
Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String) As DataTable
Public Shared ReadOnly Property GlobalDTPSATPS(SATClaveProductoServicio As String, Optional CveSATPS As Integer = -1) As DataTable
Get
'If Application("GlobalDTPSATPS") Is Nothing Then
' Dim ObjGrales As New ClsGenerales
@@ -304,13 +304,13 @@ Public Class ClsPaginas
'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio) Then
If ObjGrales.GetSATProductosServicios(SATClaveProductoServicio, CveSATPS) Then
GlobalDTPSATPS = ObjGrales.DtResultados
Else
GlobalDTPSATPS = Nothing
End If
ObjGrales.Dispose()
'GlobalDTPSATPS = DirectCast(Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End Get
'Set(value As DataTable)
' Application("GlobalDTPSATPS") = value
@@ -647,7 +647,7 @@ Public Class ClsPaginas
End Property
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa)
'sino existe, recarga los datos
@@ -662,7 +662,6 @@ Public Class ClsPaginas
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion)
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion)
If Estatus <> -1 Then Str.AppendFormat(" AND Estatus = '{0}'", If(Estatus = 1, "Activo", "Inactivo"))
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones = Dv.ToTable
Dv.Dispose()
@@ -1759,7 +1758,7 @@ Public Class ClsPaginas
ObjProveedores.Dispose()
End If
If CveEmpresa <> -1 Then
If CveEmpresa <> -1 AndAlso Application(AppNombre) IsNot Nothing Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveProveedor >= 0 Then StrSQL.AppendFormat(" AND CveProveedor = {0} ", CveProveedor)
@@ -3076,6 +3075,8 @@ Public Class ClsPaginas
End Set
End Property
Property GlobalDTContaConceptosContables(CvePlantillaPoliza As Integer) As DataTable
Get
If CvePlantillaPoliza <> -1 Then
@@ -3848,6 +3849,7 @@ Public Class ClsPaginas
If Application("GlobalSIGAppPaginas") Is Nothing Then
PaginaDict = New System.Collections.Hashtable
PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918)
PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916)
PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915)
PaginaDict.Add("/Inicio.aspx".ToUpper(), -1)
@@ -4617,7 +4619,6 @@ Public Class ClsPaginas
PaginaDict.Add("/GPS/RepGastos.aspx".ToUpper(), 685)
PaginaDict.Add("/GPS/RecursoConfiableTracking.aspx".ToUpper(), 692)
PaginaDict.Add("/GPS/KimberlyClarkTracking.aspx".ToUpper(), -1)
PaginaDict.Add("/GPS/RepUnidades.aspx".ToUpper(), 780)
#End Region
'INVENTARIOS
#Region "Inventarios"
@@ -5951,19 +5952,6 @@ Public Class ClsPaginas
Dim TipoDocumentoRef As String = ""
Dim AplicaPagare As String = "1"
Dim RFCReceptor As String = ""
If String.IsNullOrEmpty(Vta.RFCReceptor) Then
RFCReceptor = Vta.Cliente.RFC
If Vta.FacturarSucursal Then
If Vta.ClienteSucursal IsNot Nothing Then
RFCReceptor = Vta.ClienteSucursal.RFC
End If
End If
Else
RFCReceptor = Vta.RFCReceptor
End If
Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio)
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
Dim ImgCBB As String '= String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
@@ -6093,7 +6081,7 @@ Public Class ClsPaginas
'Si no tiene CBB, SE GENERA
If Not ImagenCBB.Exists Then
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
End If
ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
@@ -6108,7 +6096,7 @@ Public Class ClsPaginas
'CLIENTE
params.Add(New CrystalParametro("ClienteCodigo", Vta.Cliente.Codigo))
params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso RFCReceptor = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
params.Add(New CrystalParametro("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
params.Add(New CrystalParametro("ClienteDireccion", ClienteDireccion))
params.Add(New CrystalParametro("ClienteLugar", ClienteLugar))
@@ -6140,7 +6128,7 @@ Public Class ClsPaginas
params.Add(New CrystalParametro("SelloSAT", Vta.SelloSAT))
params.Add(New CrystalParametro("QR", ImgCBB))
params.Add(New CrystalParametro("ClienteRFC", RFCReceptor))
params.Add(New CrystalParametro("ClienteRFC", Vta.Cliente.RFC))
params.Add(New CrystalParametro("FormaPago", Vta.FormaPagoText))
params.Add(New CrystalParametro("Moneda", Vta.Moneda))
params.Add(New CrystalParametro("TipoCambio", Vta.TipoCambio.ToString))
@@ -6475,18 +6463,7 @@ Public Class ClsPaginas
Dim NombreArchivoDescarga As String = ""
Dim TipoDocumento As String = ""
Dim TipoDocumentoRef As String = ""
Dim RFCReceptor As String = ""
If String.IsNullOrEmpty(Vta.RFCReceptor) Then
RFCReceptor = Vta.Cliente.RFC
If Vta.FacturarSucursal Then
If Vta.ClienteSucursal IsNot Nothing Then
RFCReceptor = Vta.ClienteSucursal.RFC
End If
End If
Else
RFCReceptor = Vta.RFCReceptor
End If
Dim RutaCBB As String = String.Format("{0}CBB\{1}.jpg", Ruta, Vta.SerieFolio)
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
@@ -6641,7 +6618,7 @@ Public Class ClsPaginas
'Si no tiene CBB, SE GENERA
If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, Vta.Cliente.RFC, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
End If
ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)
@@ -6662,14 +6639,14 @@ Public Class ClsPaginas
params.Add(New ReportParameter("ClienteNombre", If(Vta.ClienteSucursal.ImprimeNombreSucursal = "True", If(Vta.CveClienteSucursal > 0, Vta.ClienteSucursal.Sucursal, Vta.Cliente.Nombre), If(Vta.AtencionA <> "" AndAlso Vta.TipoDocto.Contiene("Ing", "Rem") AndAlso Vta.Cliente.RFC = "XAXX010101000", $"{Vta.Cliente.Nombre}({Vta.AtencionA})", Vta.Cliente.Nombre))))
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
params.Add(New ReportParameter("ClienteRFC", RFCReceptor))
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
End If
If Vta.CveEmpresaCRM.ToEntero > 0 Then
params.Add(New ReportParameter("ClienteCodigo", Vta.Cliente.Codigo))
params.Add(New ReportParameter("ClienteNombre", Vta.Cliente.Nombre))
params.Add(New ReportParameter("ClienteDireccion", ClienteDireccion))
params.Add(New ReportParameter("ClienteLugar", ClienteLugar))
params.Add(New ReportParameter("ClienteRFC", RFCReceptor))
params.Add(New ReportParameter("ClienteRFC", Vta.Cliente.RFC))
End If
'TOTALES

View File

@@ -5654,7 +5654,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Return Retorno
End Function
Public Function SolicitudVacacionesAdd(CvePersonal As Integer, Fecha As Date, FechaFin As Date, Estatus As Integer, CveUsuario As Integer, CveAutoriza As Integer, Folio As Integer, Optional Motivo As String = "", Optional FechaPago As String = "", Optional diasinabiles As Integer = 0, Optional PorcentajePrimaVac As Decimal = -1) As Boolean
Public Function SolicitudVacacionesAdd(CvePersonal As Integer, Fecha As Date, FechaFin As Date, Estatus As Integer, CveUsuario As Integer, CveAutoriza As Integer, Folio As Integer, Optional Motivo As String = "", Optional FechaPago As String = "", Optional diasinabiles As Integer = 0, Optional PorcentajePrimaVac As Decimal = -1, Optional CveTipoPago As Integer = 0, Optional diasExtras As Integer = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_SolicitudVacacionesAdd")
@@ -5670,6 +5670,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@diasinabiles", SqlDbType.Int).Value = diasinabiles
.Add("@PorcentajePrimaVac", SqlDbType.Money).Value = PorcentajePrimaVac
.Add("@FechaPago", SqlDbType.VarChar).Value = FechaPago
.Add("@CveTipoPago", SqlDbType.Int).Value = CveTipoPago
.Add("@diasExtras", SqlDbType.Int).Value = diasExtras
'.Add("@Motivo", SqlDbType.VarChar).Value = MotivoFechaPago As String = "", Optional diasinabiles
End With

View File

@@ -4388,6 +4388,134 @@ Public Class ClsVentas
End Function
#End Region
#Region " AUTORIZACION LIMITES "
Public Function AutorizacionLimitesGet(CveCliente As Integer, CveCveVendedor As Integer, CveEstatus As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveCveVendedor", SqlDbType.Int).Value = CveCveVendedor
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener las Autorizaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AutorizacionLimitesRemove(CveAutorizacion As Integer, CveCliente As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesRemove", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AutorizacionLimitesAdd(CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveUsuario As Integer, CveEstatus As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesAdd", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Importe", SqlDbType.Money).Value = Importe
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AutorizacionLimitesEstatusUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionlimitesEstatusUpdate", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AutorizacionLimitesUpdate(CveAutorizacion As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesUpdate", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveAutorizacion", SqlDbType.Int).Value = CveAutorizacion
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Importe", SqlDbType.Money).Value = Importe
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el Estatus de la Autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region "CANCELACION REMISION"
Public Function UpdateCancelaRemision(CveVenta As Integer, SeCancelaRemision As Boolean) As Boolean

View File

@@ -137,6 +137,7 @@ Public Class LogicNominas
Dim SDI As Double = 0
Dim SalarioDiarioSS As Double = 0
Dim ClaveEstado As String = ""
Dim MetodoPagoFijo As Boolean
Dim ObjIncapacidades As New List(Of CFDINominaIncapacidades)
'Conexiones a la Base de Datos
@@ -152,6 +153,12 @@ Public Class LogicNominas
cfdi.Nomina.UltimoSueldoOrdinario = drow("UltimoSueldoOrdinario").ToString().ToDecimal()
Serie = objNomina.Serie
Folio = objNomina.Folio.ToString()
MetodoPagoFijo = drow("MetodoPagoFijo").ToString().ToUpper().Contiene("1", "TRUE")
ClaveBanco = drow("ClaveBanco").ToString()
BancoNumCuenta = drow("BancoNumCuenta").ToString()
If TimbreIndemnizacion Then
cfdi.Timbrado = drow("SeTimbroFiniquitoVal").ToString().ToEntero() = 1
cfdi.IStimbreFiniquito = True
@@ -180,8 +187,11 @@ Public Class LogicNominas
Puesto = objPersonal.Puesto
CveSATRiesgoPuesto = objPersonal.CveSATRiesgoPuesto.ToString()
TipoPeriodoPago = objPersonal.TipoPeriodoPago
ClaveBanco = objPersonal.ClaveBanco
BancoNumCuenta = objPersonal.BancoNumCuenta
If Not MetodoPagoFijo Then
ClaveBanco = objPersonal.ClaveBanco
BancoNumCuenta = objPersonal.BancoNumCuenta
End If
SDI = objPersonal.SDI
SalarioDiarioSS = objPersonal.SalarioDiarioSS
ClaveEstado = objPersonal.ClaveEstado
@@ -332,7 +342,7 @@ Public Class LogicNominas
'subsidio al empleo
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo
.Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal, .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()})
.Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal, .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()})
End If
Next
End If
@@ -362,7 +372,7 @@ Public Class LogicNominas
'subsidio al empleo
If Row("SATCveConcepto").ToString().ToEntero().ToEntero() = 17 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "002", ' codigo fijo, por ser referente a subsidio al empleo
.Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal(), .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()})
.Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(), .Importe = Row("Importe").ToString().ToDecimal(), .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()})
End If
Next
End If
@@ -376,7 +386,7 @@ Public Class LogicNominas
If Row("CveSATConcepto").ToString() = "" Then cfdi.AddMsg(String.Format("Concepto No registrado ({0})", Row("Concepto").ToString())) : Exit For
Dim otrp = New CFDINominaOtrosPagos With {.TipoOtroPago = Row("SATCveConcepto").ToString(), .Clave = Row("Codigo").ToString(), .Concepto = Row("Concepto").ToString(),
.Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("Importe").ToString().ToDecimal().Abs()}
.Importe = Row("Importe").ToString().ToDecimal().Abs(), .Subsidiocausado = Row("ImporteValor").ToString().ToDecimal().Abs()}
If Row("SATCveConcepto").ToString().ToEntero() = 4 Then
otrp.ejercicio = DateTime.Now.Year - 1
otrp.SaldoAFavor = Row("ImporteValor").ToString().ToDecimal().Abs()

View File

@@ -406,6 +406,8 @@ Public Class E141 : Implements IHttpHandler
Else
retorno = "False"
End If
Case "ActualizarPreciosJson"
retorno = ActualizarPreciosJson(If(FiltrarTodos = "1", True, False))
Case "ActualizarExistencias"
respuesta = ActualizarExistencias()
If respuesta Then
@@ -413,6 +415,8 @@ Public Class E141 : Implements IHttpHandler
Else
retorno = "False"
End If
Case "ActualizarExistenciasJson"
retorno = ActualizarExistenciasJson(If(FiltrarTodos = "1", True, False))
Case "ActualizarVendedores"
respuesta = ActualizarVendedores(If(FiltrarTodos = "1", True, False))
If respuesta Then
@@ -2118,6 +2122,26 @@ Public Class E141 : Implements IHttpHandler
Return Retorno
End Function
Private Function ActualizarPreciosJson(Todos As Boolean) As String
Dim payload = New JObject()
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
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
payload.Add(New JProperty("products", GenerarPayloadPrecios(DtPS)))
End If
Return payload.ToString()
End Function
Private Function GenerarPayloadPrecios(DtPS As DataTable) As JArray
Dim ArrayPS As New JArray
For Each RowPS As DataRow In DtPS.Rows
@@ -2215,6 +2239,25 @@ Public Class E141 : Implements IHttpHandler
Return Retorno
End Function
Private Function ActualizarExistenciasJson(Todos As Boolean) As String
Dim payload = New JObject()
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
DtPS = ObjPS.DtResultados.Copy()
End If
End Using
If DtPS IsNot Nothing Then
payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS)))
End If
Return payload.ToString()
End Function
Private Function GenerarPayloadExistencias(DtPS As DataTable) As JArray
Dim ArrayPS As New JArray
For Each RowPS As DataRow In DtPS.Rows
@@ -2233,7 +2276,7 @@ Public Class E141 : Implements IHttpHandler
#End Region
#Region "A C T U A L I Z A R - E X I S T E N C I A S"
#Region "A C T U A L I Z A R - V E N D E D O R E S"
Private Function ActualizarVendedores(Todos As Boolean) As Boolean
Dim Retorno As Boolean = False

View File

@@ -35,11 +35,33 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
context.Response.Close()
context.Response.End()
Else
context.Response.ContentType = "text/plain"
If context.Request("metodo").Contiene("Contabilizapoliza", "RevisaConexion") Then
context.Response.ContentType = "text/json"
Else
context.Response.ContentType = "text/plain"
End If
End If
Try
Select Case context.Request("metodo")
Case "Contabilizapoliza"
Dim CvePrePoliza As Integer = context.Request("CvePrePoliza").ToString().ToEntero()
Dim CveUsuario As Integer = context.Request("CveUsuario").ToString().ToEntero()
Dim CveEmpresa As Integer = context.Request("CveEmpresa").ToString().ToEntero()
GuardaLog(String.Format("?metodo=Contabilizapoliza&CvePrePoliza={0}&CveUsuario={1}&CveEmpresa ={2}", CvePrePoliza, CveUsuario, CveEmpresa))
ActualizaPrePoliza(context)
Dim obj As New ADSNetLibrary.SIGAPI.Models.ResponseModel(Of Object)()
obj.Result = DateTime.Now.ToString()
Dim retorno = JsonConvert.SerializeObject(obj).ToString()
context.Response.Write(retorno)
context.Response.StatusCode = 200
Case "RevisaConexion"
Dim obj As New ADSNetLibrary.SIGAPI.Models.ResponseModel(Of Object)()
obj.Result = DateTime.Now.ToString()
Dim retorno = JsonConvert.SerializeObject(obj).ToString()
context.Response.Write(retorno)
context.Response.StatusCode = 200
Case "getps"
GETPS(context)
Case "getps2"
@@ -70,6 +92,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ActualizaPrePoliza(context)
Case "getpersonal"
getpersonal(context)
Case "getcuentascontables"
GetCuentasContables(context)
Case "getcontratos"
GetContratos(context)
Case "GettingCURP"
@@ -558,6 +582,15 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
'Dim i As Integer = 0 'limpieza de columnas
'While i < DtRetorno.Columns.Count
' If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
' DtRetorno.Columns.RemoveAt(i)
' Else
' i = i + 1
' End If
'End While
DtRetorno.Columns("CveCliente").ColumnName = "id"
DtRetorno.Columns(ColumnaNombre).ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
@@ -593,11 +626,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ObjProveedores.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
@@ -606,14 +634,24 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
Dim i As Integer = 0 'limpieza de columnas
While i < DtRetorno.Columns.Count
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveProveedor", "NombreCortoProveedor") Then
DtRetorno.Columns.RemoveAt(i)
Else
i = i + 1
End If
End While
DtRetorno.Columns("CveProveedor").ColumnName = "id"
DtRetorno.Columns("NombreCortoProveedor").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno)
DtRetorno.Dispose()
Else
context.Response.Write("[]")
End If
DtRetorno.Dispose()
Return retorno
End Function
#End Region
@@ -1147,11 +1185,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
ObjPersonal.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
@@ -1159,6 +1192,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
DtRetorno.Columns("CvePersonal").ColumnName = "id"
DtRetorno.Columns("NombreCompleto").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
@@ -1205,4 +1239,47 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Return retorno
End Function
#End Region
#Region "Get Cuentas"
Private Function GetCuentasContables(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim DtRetorno As DataTable = Nothing
Dim usuario As Usuario = UsuarioActual(context)
Dim CveEmpresa As String
If IsNothing(usuario) Then
context.Response.Write("")
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(-1, "-1", 1, CveEmpresa, Nombre:=Name) Then
DtRetorno = ObjConta.DtResultados
End If
ObjConta.Dispose()
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
Dim i As Integer = 0 'limpieza de columnas
While i < DtRetorno.Columns.Count
If Not DtRetorno.Columns(i).ColumnName.Contiene("CveCuenta", "CtaCodigo") Then
DtRetorno.Columns.RemoveAt(i)
Else
i = i + 1
End If
End While
DtRetorno.Columns("CveCuenta").ColumnName = "id"
DtRetorno.Columns("CtaCodigo").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
DtRetorno.Dispose()
Return retorno
End Function
#End Region
End Class

View File

@@ -715,7 +715,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas
TCDoc = get_GlobalTipoCambio(TxtFechaDocumento.Text.ToDate().AddMonths(-1).LastDayOfMonth()).ToDecimal();
}
Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal();
Importe = gvr.FCTextBox("TxtAbonar").Text.ToDecimal().RoundSQL();
ImporteMN = Importe;
ImporteComplementaria = 0;
@@ -756,8 +756,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas
}
}
ImporteMN = Math.Round(ImporteMN, 2, MidpointRounding.AwayFromZero);
ImporteComplementaria = Math.Round(ImporteComplementaria, 2, MidpointRounding.AwayFromZero);
ImporteMN = ImporteMN.RoundSQL();
ImporteComplementaria = ImporteComplementaria.RoundSQL();
if (tCveMoneda != 1)
{
@@ -825,7 +825,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas
}
else
{
ImporteMNBanco = ImporteBanco * TC;
ImporteMNBanco = (ImporteBanco * TC).RoundSQL();
ImporteComplementaria = 0;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4422,7 +4422,7 @@
<asp:UpdatePanel ID="UpIVA" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-3" id="divIVA" runat="server" visible="false">
<div class="col-md-3" id="divIVA" runat="server" visible="true">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlIVA" CssClass="form-control select2me" Style="width: 100%; display: inline-block;" runat="server" Enabled="false">
<asp:ListItem Selected="True" Value="1.08">8%</asp:ListItem>

View File

@@ -4621,6 +4621,13 @@ Partial Class Compras_Compras
'End If
End If
'Compra
Dim CveFactura As Integer = -1
If Request("CveFactura") IsNot Nothing Then
CveFactura = Request("CveFactura").ToString.ToEntero
End If
'si el registro es manual, toma el mismo dato
If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal
@@ -4637,14 +4644,13 @@ Partial Class Compras_Compras
'Compra
If ObjCompras.AddCompra(DdlTipoComprobante.SelectedValue, TxtDescripcion.Text.Trim, TxtSerie.Text.Trim, TxtFolio.Text.Trim, TxtFolioSecundario.Text.Trim, CveProveedor, TxtSubTotal.Text.ToDouble, TxtDescuento.Text.ToDouble,
LblAmortizacion.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtIEPS.Text.ToDouble, TxtOtrosImpuestos.Text.ToDouble,
TxtRedondeo.Text.ToDouble, TxtTotal.Text.ToDouble, TxtFecha.Text.Trim.ToDate, DdlMoneda.SelectedValue.ToEntero, TipoCambio, TxtFechaPago.Text.Trim.ToDate, ChkAplicaNotaCredito.Checked, TxtObsFact.Text.Trim, CveEstatusFactura,
CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, IdPoliza, CveCajaChica:=CveCajaChica, CvePersonal:=CvePersonal, NumeroReembolso:=NumeroReembolso, CveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero,
AplicoPromocion:=ChkOCPromocion.Checked, PorcentajeIVA:=PorcentajeIVA, CveMetodoPago:=CveMetodoPago, CveRetIVAConcepto:=If(DdlRetIVAConcepto.Items.Count > 0, DdlRetIVAConcepto.SelectedValue.ToEntero, -1), CveConceptoContableAlmacen:=CveConceptoContableAlmacen,
CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, EsImportacion:=EsImportacion) Then
CveRetISRConcepto:=If(DdlRetISRConcepto.Items.Count > 0, DdlRetISRConcepto.SelectedValue.ToEntero, -1), NoDeducible:=EsNoDeducible, CveTipoCompra:=DdlTipoCompra.SelectedValue.ToEntero, TotalOriginal:=TotalOriginal, CveTipoConcepto:=CveTipoConcepto, EsImportacion:=EsImportacion, CveFactura:=CveFactura) Then
ViewState("CveCompra") = ObjCompras.CveCompra
If ObjCompras.DtResultados.Rows.Count > 0 Then ViewState("CompraFolio") = ObjCompras.DtResultados.Rows(0)("vFolio").ToString
@@ -8424,16 +8430,20 @@ Partial Class Compras_Compras
Msg.Append("¿Desea realizar una evaluacion al proveedor?")
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Compras/EvaluacionProveedor.aspx?CveEvaluacionProveedor={CveEvaluacionProveedor}"">Evaluar Proveedor.</a>")
End If
BtnGuardar.Enabled = False
UpFacturar.Update()
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
Else
ObjCompras.RollBack()
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
Alert("Ocurrio un error al guardar la compra. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
BtnGuardar.Enabled = False
UpFacturar.Update()
Alert(Msg.ToString, TipoMensaje.MsgInformacion, MsgAccionAceptar)
End If
@@ -18225,12 +18235,12 @@ Partial Class Compras_Compras
If Version = "3.3" And CveSATPS > 0 Then
Dim DrPSSAT As DataRow = Nothing
If CargaXml Then
DrPSSAT = GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS))
DrPSSAT = GlobalDTPSATPS("-1", CveSATPS).FiltroPrimero("")
'If GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows.Count > 0 Then
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("SATClavePS={0}", CveSATPS)).Rows(0)
'End If
Else
DrPSSAT = GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS))
DrPSSAT = GlobalDTPSATPS("-1", CveSATPS).FiltroPrimero("") '= GlobalDTPSATPS().FiltroPrimero(String.Format("SATClavePS={0}", CveSATPS))
'If GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows.Count > 0 Then
' DrPSSAT = GlobalDTPSATPS().FiltraParametros(String.Format("CveSATPS={0}", CveSATPS)).Rows(0)
'End If

View File

@@ -857,9 +857,9 @@ Partial Class ContabilidadC_RegPrePoliza
Next
If CvePeriodo > 0 Then
If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
MsgError = "No se pudo actualizar el periodo de la nómina"
End If
'If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
' MsgError = "No se pudo actualizar el periodo de la nómina"
'End If
End If
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then

View File

@@ -453,8 +453,6 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
End If
divDatosPrincipales.Visible = False
divObservaciones.Visible = False
UPMovs.Visible = False
@@ -1958,7 +1956,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
ObjConta2.Dispose()
If CveCuenta <= 0 Then
If CveCuenta <= 0 AndAlso CveConceptoContable <> 30 Then ' concepto 30-Bancos, tomará la cuetna de las especificaciones que se hagan enel modal
Alert(String.Format("La cuenta <b>{0}</b> no se reconoció, favor de verificar el archivo.", Row("Cuenta").ToString))
DtMovimientos.Clear()
Exit For

View File

@@ -165,13 +165,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If LbAgregar.Text = "Agregar" Then
If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then
ErrorString = "Error al agregar"
End If
ElseIf LbAgregar.Text = "Actualizar" Then
If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero()) Then
ErrorString = "Error al actualizar"
End If
End If

View File

@@ -248,7 +248,7 @@ Partial Class AC_RepEstadoActividades
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
ElseIf e.Row.DBCampo("CtaMayor").ToString.Contiene("3", "4") Then
'e.Row.CssClass = "SubTotales3"
e.Row.ControlStyle.Font.Bold = True
End If
@@ -277,7 +277,7 @@ Partial Class AC_RepEstadoActividades
'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray
'e.Row.ControlStyle.ForeColor = Drawing.Color.White
e.Row.ControlStyle.Font.Bold = True
ElseIf e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
ElseIf e.Row.DBCampo("CtaMayor").ToString.Contiene("3", "4") Then
'e.Row.CssClass = "SubTotales"
e.Row.ControlStyle.Font.Bold = True
End If

View File

@@ -1233,14 +1233,14 @@ Partial Class General_SaldosIniciales
Dim Folio As Integer = Row("Folio").ToString.ToEntero
Dim Fecha As Date = Row("Fecha").ToString.ToDate
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString.ToDate
Dim ImpuestoLocal As Double = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDouble, 0.0)
Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0D)
Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString.ToDouble, 0.0)
Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal
Dim IVA As Decimal = Row("IVA").ToString.ToDecimal
Dim Total As Decimal = Row("Total").ToString.ToDecimal
Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal
Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
Dim RetIVA As Double = Row("Ret IVA").ToString.ToDouble
Dim RetIVA As Decimal = Row("Ret IVA").ToString.ToDecimal
Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble
Dim Moneda As String = Row("Moneda").ToString
Dim TipoCambio As String = Row("Tipo Cambio").ToString
@@ -1249,7 +1249,6 @@ Partial Class General_SaldosIniciales
Dim CveVendedor As Integer = 0
Dim IEPS As Decimal = 0 'Row("IEPS").ToString.ToDecimal
Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString.ToEntero
Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0)
Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString, "")
Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString.ToDecimal, 4), 0)
@@ -1300,7 +1299,7 @@ Partial Class General_SaldosIniciales
0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero,
CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS,
ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestosLocales) Then
ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestoLocal) Then
ErrorVentas = True
Exit For
End If
@@ -1329,14 +1328,22 @@ Partial Class General_SaldosIniciales
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True
'PrePólizaDetalle
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
If IVA > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
End If
'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString, 38, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For
If RetIVA > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio.ToString, 8, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=RetIVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
End If
If ImpuestoLocal > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, Folio.ToString, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImpuestoLocal, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For
End If
If UsaComplementaria Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Folio.ToString, 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal - Total, TipoCambio:=TipoCambio.ToDecimal) Then ErrorVentas = True : Exit For
End If

View File

@@ -1331,7 +1331,7 @@ Partial Class Inventarios_EntradasSalidas
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
End If
If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.Contiene(10276) Then
If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
FechaCaducidadVal = MinFecha
FechaCaducidad = MinFecha
Lote = ""
@@ -3845,16 +3845,16 @@ Partial Class Inventarios_EntradasSalidas
Dim ObjInventario As New ClsInventarios
Dim CveUM As Integer
Dim Mensaje As String = ""
Dim FechaCaducidad As Date
Dim lote As String
'Dim FechaCaducidad As Date
'Dim lote As String
If ObjProductosServicios.GetPS(DdlPSSalida.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
If ObjProductosServicios.DtResultados.Rows.Count > 0 Then
CveUM = ObjProductosServicios.CveUnidadMedida.ToString.ToEntero
End If
End If
FechaCaducidad = If(ObjProductosServicios.AplicaCaducidad, TxtCaducidadSalida.Text.ToDate, MinFecha)
lote = If(ObjProductosServicios.AplicaLote, TxtLoteSalida.Text.ToString, "-1")
Dim Lote As String = If(TxtLoteSalida.Text = "", "", TxtLoteSalida.Text)
Dim FechaCaducidad As Date = If(TxtCaducidadSalida.Text = "", MinFecha.ToShortDateString, TxtCaducidadSalida.Text).ToDate
If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then
If Not DdlPSSalida.SelectedValue.ToEntero > 0 Then

View File

@@ -973,8 +973,8 @@ Partial Class Inventarios_EntregaAlmacen
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
e.Row.FCTextBox("TxtCaducidad").ReadOnly = True
CType(e.Row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
e.Row.FCTextBox("TxtCaducidad").readonly = True
CType(e.row.FindControl("RFVCaducidad"), RequiredFieldValidator).Enabled = False
'si aplica caducidad y viene vacía (posible por venta anterior), que se active su registro
If e.Row.FCTextBox("TxtCaducidad").Text = "" OrElse e.Row.FCTextBox("TxtCaducidad").Text.ToDate <= MinFecha Then
@@ -2275,6 +2275,7 @@ Partial Class Inventarios_EntregaAlmacen
If ErrorMovInv Then Exit For
Else
ErrorMovInv = True
End If
@@ -2601,27 +2602,24 @@ Partial Class Inventarios_EntregaAlmacen
Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero())
Dim CveSeccionAlmacen As Integer = 0
Dim ValorTraspaso As Decimal = 0
'SI TIENE APARTADOS DEBE GENERAR LOS TRASPASOS
If DtTempApartados.Rows.Count > 0 Then
If DtTempApartados IsNot Nothing AndAlso DtTempApartados.Rows.Count > 0 Then
For Each Dr As DataRow In DtTempApartados.Rows
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString().ToEntero() Then
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
FolioSalida = ObjInventario.Folio
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente,
CveAlmacenDestino:=Dr("CveAlmacen").ToString().ToEntero(), Modulo:="RE/G9")
FolioSalida = ObjInventario.Folio
CveAlmacenApartado = Dr("CveAlmacen").ToString().ToEntero()
Dim DrMovto = DtTraspasos.NewRow
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
DrMovto("FolioSalida") = FolioSalida
DtTraspasos.Rows.Add(DrMovto)
End If
Dim DrMovto = DtTraspasos.NewRow
DrMovto("Almacen") = Dr("Almacen").ToString().ToEntero()
DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString().ToEntero()
DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado
DrMovto("FolioSalida") = FolioSalida
DtTraspasos.Rows.Add(DrMovto)
End If
If Not CveMovimientoSalidaApartado > 0 Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
@@ -2636,85 +2634,82 @@ Partial Class Inventarios_EntregaAlmacen
CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
Next
If Not ErrorMovInv Then
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaTraspaso > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
Next
For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
If Not ErrorMovInv Then
Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Apart", 53, 0, 0, 1, TxtFecha.Text.ToDate, "Traspaso Apartado", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaTraspaso > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoSalidaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
ErrorMovInv = True
End If
For Each Dr1 As DataRow In DtTraspasos.Rows
CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString().ToEntero()
CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString().ToEntero(), 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
-1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero(),
If Not CveMovimientoEntradaApartado > 0 Then
CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor,
CveCliente:=CveCliente, Modulo:="RE/G10")
FolioEntrada = ObjInventario.Folio
If Not CveMovimientoEntradaApartado > 0 Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
End If
TextoError.AppendFormat("Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
End If
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
Dr1("FolioEntrada") = FolioEntrada
Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado
Dr1("FolioEntrada") = FolioEntrada
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
ValorTraspaso = ObjInventario.DtResultados.SUMD("Total").RoundSQL
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
CveSeccionAlmacen = -3
CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
End If
Next
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), Lote:=Dr("Lote").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
End If
Next
End If
If ErrorMovInv Then Exit For
If ErrorMovInv Then Exit For
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
ErrorMovInv = True
End If
Next
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, ValorTraspaso, TxtObservaciones.Text, 68, TxtObservaciones.Text, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimientoEntradaApartado, Contabilizable:=False, ImporteMX:=ValorTraspaso) Then
ErrorMovInv = True
End If
Next
Else
ErrorMovInv = True
Else
ErrorMovInv = True
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'QUEMAR REMISIONES
'CARGA REMISIONES DE LA VENTA DEVUELTA
'CARGA REMISIONES DE LA VENTA DEVUELTA
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0")
Else
ErrorMovInv = True
End If
If Not ErrorMovInv Then
'QUEMAR REMISIONES
If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
Dim DtDevRem As New DataTable
'CARGA REMISIONES DE LA VENTA DEVUELTA
If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0")
Else
ErrorMovInv = True
End If
If Not ErrorMovInv Then
If DtDevRem.Rows.Count > 0 Then
For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem"}).Rows
If Not ObjInventario.ActualizarEsDevolucionVenta(DrMovtos("CveRem").ToString().ToEntero(), 2) Then
@@ -3280,10 +3275,10 @@ Partial Class Inventarios_EntregaAlmacen
'sino es transitorio, los transitorios, ya no se hace otro movimiento
ConceptoMovimiento = If(ChkTransitorio.Checked, 2, 27)
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino,
Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP)
Almacen2 = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero(), CveAlmacenTraspasoDestino)
CveMovimientoEntrada = ObjInventario.AddMovimiento(Almacen2, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim,
Guia:="", CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenTraspasoDestino,
Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""), Modulo:="RE/GT1", CveOP:=CveOP)
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then

View File

@@ -605,14 +605,14 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
Dim Drp As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePaqueteDesarmado).FiltroPrimero("")
Dim CveUMTemp As Integer = Drp("CveUM").ToString.ToEntero
Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
If AplicaSeccion Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
End If
'Dim AplicaSeccion As Boolean = CBool(Drp("AplicaSeccion"))
'If AplicaSeccion Then
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDesarmado, CvePaqueteDesarmado).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
'End If
If AplicaSerie Then
For Each Gvr As GridViewRow In GvSeriesPaqueteDesarmado.Rows
'AGREGA MOVTO DETALLE DE LA SALIDA DEL PAQUETE
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Gvr.DataKey("Serie").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, CveUMTemp, CvePSTemp, 0, CveSeccionAlmacen:=-3, Serie:=Gvr.DataKey("Serie").ToString) Then
TieneError = True
MensajeError = "Ocurrió un error al guardar los detalles con serie del movimiento de salida"
Exit For

View File

@@ -3009,10 +3009,8 @@ Partial Class Inventarios_RecepcionAlmacen
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
DtPSVirtual.Rows.Add(Row)
End If
End If
Next
End If
Next
@@ -3065,36 +3063,32 @@ Partial Class Inventarios_RecepcionAlmacen
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero()).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD")
If CveMovimientoVirtual > 0 Then
FolioVirtual = ObjInventario.Folio
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, 13, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoRef, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/VD")
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If CveMovimientoVirtual > 0 Then
FolioVirtual = ObjInventario.Folio
For Each RowUsado As DataRow In DtPSVirtual.Rows
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
Dim CantidadUsado As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
If SumarImporteUsados Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
Else
ErrorMovInv = True
If SumarImporteUsados Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtual, UsuarioActual.CveEmpresa) Then
ImporteIngresoAdicional = ObjInventario.DtResultados.SUMD("TotalOriginal")
End If
End If
End If
Else
ErrorMovInv = True
End If
Else
ErrorMovInv = True
End If

View File

@@ -2761,7 +2761,7 @@ Partial Class Inventarios_RecepcionUsados
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
Dim Arr = PS.Split("-"c)
If Arr.Count > 0 Then
If Arr.Count > 1 Then
If (DdlBCIAjuste.Items.FindByText(Arr(1).ToString) IsNot Nothing) Then
DdlBCIAjuste.SelectedValueExist(DdlBCIAjuste.Items.FindByText(Arr(1).ToString).Value)
End If

View File

@@ -37,10 +37,9 @@ Partial Class Inventario_ReconstruirCostos
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarca.DataSource = ObjPS.DtResultados
DdlMarca.DataBind()
End If
ObjPS.Dispose()
DdlMarca.DataBind()
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()

View File

@@ -331,7 +331,7 @@
<div class="row">
<label id="lblCompraRef" runat="server" class="col-md-2">Referencia:</label>
<div class="col-md-3">
<asp:HyperLink runat="server" Target="_blank" ID="hplRef" CssClass="Texto">Ver Compra</asp:HyperLink>
<asp:HyperLink runat="server" Target="_blank" ID="hplRef" CssClass="Texto">VerCompra</asp:HyperLink>
</div>
</div>
</div>
@@ -454,7 +454,7 @@
<div style="max-height: 300px; overflow-y: auto;">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
<Columns>
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign ="Right">

View File

@@ -344,7 +344,7 @@ Partial Class Inventarios_TraspasoAlmacen
'End If
If Mov.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, Serie, CveClasificacion, EstatusExistencia")
DtMovimientos = Mov.DtResultados.DefaultView.ToTable("Cantidad, CveUM, CvePS, CveAF, PS, Serie, CveSeccionAlmacen, CveClasificacion, EstatusExistencia")
CargaGvDatos()
End If

View File

@@ -203,7 +203,7 @@
<div class="col-md-6">
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
<asp:Label runat="server" Text="Cuenta contable" AssociatedControlID="DdlCtaContable"></asp:Label>
<asp:DropDownList ID="DdlCtaContable" runat="server" AppendDataBoundItems="True" DataTextField="CtaCodigo" DataValueField="Id" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
<asp:DropDownList ID="DdlCtaContable" runat="server" AppendDataBoundItems="True" DataTextField="CtaCodigo" DataValueField="CveCuenta" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
</div>
</div>
<div class="col-md-6">

View File

@@ -271,6 +271,21 @@ public partial class Nomina_CatConcepto : ClsPaginas
DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlCtaContable.SelectedValueExist("-1");
}
else
{
using (ClsContabilidad ObjConta = new ClsContabilidad())
{
if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa))
{
DdlCtaContable.DataSource = ObjConta.DtResultados;
DdlCtaContable.DataBind();
}
}
DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlCtaContable.SelectedValueExist("-1");
}
}
@@ -453,7 +468,14 @@ public partial class Nomina_CatConcepto : ClsPaginas
DdlClasificacion.SelectedValueExist(drow["CveClasificacion"]);
DdlTipoGasto.SelectedValueExist(drow["CveTipoGasto"]);
DdlCtaContable.SelectedValueExist(drow["IdCtaContable"]);
DdlCtaContable.SelectedValueExist(drow["CveCuenta"]);
//if (UsuarioActual.Empresa.TipoContabilidad == 1)
//{
//}
//else
//{
// DdlCtaContable.SelectedValueExist(drow["IdCtaContable"]);
//}
DdlConceptoSAT.SelectedValueExist(drow["CveSATConcepto"]);
}
ObjNomina.Dispose();

View File

@@ -242,6 +242,13 @@
Indemnización
<br />
<asp:CheckBox ID="chkIndemnizacion" CssClass="chksino" Text=" " runat="server" />
<div style="display:inline-block;width:30px;">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="Txtdiasindemnizacion" Text="90" runat="server" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="días" AssociatedControlID="Txtdiasindemnizacion"></asp:Label>
</div>
</div>
</div>
<div class="col-md-4 text-center">
Separación unica

View File

@@ -1062,16 +1062,15 @@ public partial class Nomina_Finiquito : ClsPaginas
using (ClsRH ObjPersonal = new ClsRH())
using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL()))
{
if (ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked,chkIndemnizacion.Checked ,chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
if (continuar =ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked,chkIndemnizacion.Checked ,chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
{
DataRow da = ObjPersonal.DtResultados.Rows[0];
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero();
continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa);
CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero();
}
if (continuar)
{
continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa);
continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa,diasindemnizacion:Txtdiasindemnizacion.Text.ToEntero());
}
if (continuar)
{
@@ -1311,16 +1310,15 @@ public partial class Nomina_Finiquito : ClsPaginas
using (ClsRH ObjPersonal = new ClsRH())
using (ClsNominas onom = new ClsNominas(ObjPersonal.IniciaTransacSQL()))
{
if (ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
if (continuar =ObjPersonal.UpPersonalAltas(CvePersonal, "", TxtFechaBaja.Text.ToDateTime().ToString("yyyy/MM/dd"), -1, DdlMotivoBaja.SelectedValue.ToEntero(), ChkesLiquidacion.Checked, chkIndemnizacion.Checked, chkSeparacionUnica.Checked, chkPrimaantiguedad.Checked) && ObjPersonal.GetPersonalAltas(CvePersonal) && ObjPersonal.DtResultados.Rows.Count > 0)
{
DataRow da = ObjPersonal.DtResultados.Rows[0];
CvePeriodoIndemnizacion = da["CvePeriodoIndemnizacion"].ToString().ToEntero();
CvePeriodoFiniquito = da["CvePeriodoFiniquito"].ToString().ToEntero();
continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa);
}
if (continuar)
{
continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa);
continuar = onom.GetFiniquitosPersonal(CvePersonal, UsuarioActual.CveEmpresa, diasindemnizacion: Txtdiasindemnizacion.Text.ToEntero());
}
if (continuar)
{ loadsobrerecibo(onom); }

128
Nomina/ISRCalculoAnual.aspx Normal file
View File

@@ -0,0 +1,128 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ISRCalculoAnual.aspx.cs" Inherits="Nomina_ISCalculoAnual" %>
<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">
Calculo anual de ISR
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1">Ejercicio: </label>
<div class="col-md-1">
<asp:DropDownList ID="DdlEjercicios" runat="server" Style="width: 100% !important;" CssClass="select2me" DataValueField="Ejercicio" DataTextField="Ejercicio"></asp:DropDownList>
</div>
<div class="col-md-1">
<asp:LinkButton ID="LnkConsultar" OnClick="LnkConsultar_Click" runat="server" Text="Calcular" class="btn btn-primary" />
</div>
</div>
</div>
<div class="tools">
<%--<a href="javascript:;" class="expand" data-original-title="" title=""></a>--%>
</div>
</div>
<div class="portlet-body" style="display: none">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="upDatosPers" runat ="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:GridView ID="GVPersonalISRAnual" runat="server" GridLines="None" CssClass ="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
datakeynames="Codigo,NombreCompleto,CodigoNombreCompleto,CveEmpresa,Estatus,FechaFin,FechaInicio,Ingresos,IngresosG,Art152,Subsidio,Impuestoanual,ImpuestoRetenido,ACargo,ACompensar,Saldo">
<Columns>
<asp:TemplateField HeaderText="Nombre ">
<ItemTemplate>
<asp:Label ID="lblcodigoNombreCompleto" runat="server" Text='<%# Eval("CodigoNombreCompleto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Centro de costos">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("Subproyecto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha ingreso">
<ItemTemplate>
<asp:Label ID="lblfechaInicio" runat="server" Text='<%# Eval("FechaInicio","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha fin">
<ItemTemplate>
<asp:Label ID="lblfechaFin" runat="server" Text='<%# Eval("FechaFin","{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ingresos totales" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblingresos" runat="server" Text='<%# Eval("Ingresos","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Base gravada" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblingresosG" runat="server" Text='<%# Eval("IngresosG","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Art. 152" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblart152" runat="server" Text='<%# Eval("Art152","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Subsidio" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblsubsidio" runat="server" Text='<%# Eval("Subsidio","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto anual" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblimpuestoanual" runat="server" Text='<%# Eval("Impuestoanual","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Impuesto retenido" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblimpuestoRetenido" runat="server" Text='<%# Eval("ImpuestoRetenido","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="A cargo" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblaCargo" runat="server" Text='<%# Eval("ACargo","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="A compensar" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblaCompensar" runat="server" Text='<%# Eval("ACompensar","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Saldo" ItemStyle-HorizontalAlign ="Right">
<ItemTemplate>
<asp:Label ID="lblsaldo" runat="server" Text='<%# Eval("Saldo","{0:N2}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class Nomina_ISCalculoAnual : ClsPaginas
{
protected void Page_Load(object sender, EventArgs e)
{
DataTable dtejercicio = new DataTable();
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetEjercicios(UsuarioActual.CveEmpresa))
{
dtejercicio = objnom.DtResultados;
}
}
DdlEjercicios.DataSource = dtejercicio;
DdlEjercicios.DataBind();
}
protected void LnkConsultar_Click(object sender, EventArgs e)
{
CargaPersonalISRAnual();
}
protected void CargaPersonalISRAnual()
{
DataTable dtdatos = new DataTable();
int ejercicio = DdlEjercicios.SelectedValue.ToEntero();
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.PersonalISRAnual(-1, UsuarioActual.CveEmpresa, ejercicio))
{
dtdatos = objnom.DTSetResultados.Tables[0];
}
}
GVPersonalISRAnual.DataSource = dtdatos;
GVPersonalISRAnual.DataBind();
upDatosPers.Update();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -189,6 +189,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
cargaPeriodos();
DdlTurno.DataSource = GlobalDTTurno.FiltraParametros($"CveEmpresa = { UsuarioActual.CveEmpresa}");
DdlTurno.DataBind();
DdlMetodoPago.DataSource = GlobalDTMetodosPago;
DdlMetodoPago.DataBind();
DdlBanco.DataSource = GlobalDTNomSatBancos;
DdlBanco.DataBind();
//Permisos
if (UsuarioActual.TienePermisoProceso(82))
{
@@ -231,7 +237,16 @@ public partial class Nomina_Nomina2 : ClsPaginas
DdlSRINCcveControlIncapacidad.DataBind();
}
}
if (GvVacaciones.Rows.Count > 0)
{
foreach (GridViewRow item in GvVacaciones.Rows)
{
LinkButton lnkDescargaFormato = item.FCLinkButton("ImgDescargaFormato");
LinkButton lnkDescargaAutorizacion = item.FCLinkButton("ImgDescargaAutorizacion");
if (lnkDescargaAutorizacion != null && lnkDescargaAutorizacion.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaAutorizacion); }
if (lnkDescargaFormato != null && lnkDescargaFormato.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaFormato); }
}
}
}
#region Filtros
private void cargaEjercicios()
@@ -381,7 +396,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
int CvePrePolizaProvision = drow["CvePrePolizaProvision"].ToString().ToEntero();
int CvePrePolizaProvisionAsimilados = drow["CvePrePolizaAsimilables"].ToString().ToEntero();
LnkConceptoEmpleado.Visible = (Estatus == 1);
LnkRegistrarProvision.Visible = (Estatus >= 2) && CvePrePolizaProvision <= 0;
LnkRegistrarProvision.Visible = (Estatus >= 2);// && CvePrePolizaProvision <= 0;
LnkConceptoEmpleado.Visible = (Estatus < 2);
LnkCargaAsistenciaMasiva.Visible = (Estatus < 2);
LnkModalPlantillaNomina.Visible = (Estatus < 2);
@@ -390,7 +405,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
LnkLayoutContable.Visible = (Estatus > 2);
LnkProvisionNomina.Visible = CvePrePolizaProvision > 0;
LnkProvisionNomina.NavigateUrl = $"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={CvePrePolizaProvision}";
LnkProvisionNominaAsimilados.Visible = CvePrePolizaProvision > 0;
LnkProvisionNominaAsimilados.Visible = CvePrePolizaProvisionAsimilados > 0;
LnkProvisionNominaAsimilados.NavigateUrl = $"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={CvePrePolizaProvisionAsimilados}";
UpAccciones.Update();
}
@@ -410,7 +425,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
continuar = true;
}
LnkTimbrarTodos.Visible = dtempleados.Rows.Count > 0 && dtempleados.COUNT("CvePersonal", "SeTimbro=0 AND CvePersonal >0") > 0;
LnkTimbrarTodos.Visible = dtempleados.Rows.Count > 0 && dtempleados.COUNT("CvePersonal", "SeTimbro=0 AND CvePersonal >0 AND NomAutorizado =1") > 0;
}
}
@@ -464,6 +479,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
foreach (DataRow row in dtConceptos.FiltraParametros("Tipo IN ('D') AND EsPadre = 1 ").Rows)
{
int CveConcepto = row["CveConcepto"].ToString().ToEntero();
int CveSistema = row["CveSistema"].ToString().ToEntero();
int SoloVisible = row["SoloVisible"].ToString().ToEntero();
string Concepto = row["Concepto"].ToString();
GvNominas.Columns[CurrentColumn].ItemStyle.BackColor = System.Drawing.Color.Transparent;
@@ -473,7 +489,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
GvNominas.Columns[CurrentColumn].HeaderStyle.CssClass = "isOnlyVisible ";
}
GvNominas.Columns[CurrentColumn].Visible = (dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0);
GvNominas.Columns[CurrentColumn].Visible = (dtempleados.SUM(string.Format("[V_{0}]", CveConcepto)) != 0) && CveSistema != 101;
bf = (BoundField)GvNominas.Columns[CurrentColumn];
bf.DataField = string.Format("V_{0}", CveConcepto);
bf.HeaderText = Concepto;
@@ -819,7 +835,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
#endregion
UpDatos.Update();
LnkAutorizar.Visible = dtempleados.COUNT("CvePersonal", " CvePersonal > 0 AND NomAutorizado =0")>0 ;
LnkAutorizar.Visible = dtempleados.COUNT("CvePersonal", " CvePersonal > 0 AND NomAutorizado =0") > 0;
}
private void setGVNominas()
{
@@ -946,9 +962,22 @@ public partial class Nomina_Nomina2 : ClsPaginas
e.Row.CssClass = "success";
if (EsRenuncia.ToUpper().Contiene("TRUE", "1") && !SeTimbroFiniquito.ToUpper().Contiene("TRUE", "1"))
{
LnkTimbrar.Visible = true;
e.Row.CssClass = "danger";
e.Row.ToolTip = "sin timbrar conceptos de indemnización";
// cvePersonal
bool isfiniquito = false;
foreach (DataRow drow in dtConceptos.FiltraParametros("CveSistema IN(10, 11, 32, 47)").Rows)
{
if (dtempleados.SUM(string.Format("V_{0}", drow["CveConcepto"]), string.Format("CvePersonal ={0}", cvePersonal)) > 0)
{
isfiniquito = true;
}
}
if (isfiniquito)
{
LnkTimbrar.Visible = true;
e.Row.CssClass = "danger";
e.Row.ToolTip = "sin timbrar conceptos de indemnización";
}
}
}
@@ -1012,8 +1041,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
ObjPeriodo.CambiaEstatusPeriodo(CvePeriodo, (int)enumNominasEstatus.Timbrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
ObjPeriodo.Dispose();
LnkTimbrar.Visible = false;
gvRow.CssClass = "success";
gvRow.FindControl("ImgDelete").Visible = false;
gvRow.FindControl("LnkCancelar").Visible = false;
gvRow.FindControl("LnkCancelar").Visible = true;
gvRow.FindControl("HypXml").Visible = true;
gvRow.FindControl("HypPDF").Visible = true;
@@ -1050,7 +1080,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
ObjPeriodo.Dispose();
Alert("Se ha timbrado correctamente");
gvRow.FindControl("ImgDelete").Visible = false;
gvRow.FindControl("LnkCancelar").Visible = false;
gvRow.FindControl("LnkCancelar").Visible = true;
gvRow.FindControl("HypXml").Visible = true;
gvRow.FindControl("HypPDF").Visible = true;
gvRow.ForeColor = Color.Green;
@@ -1061,14 +1091,22 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void ImgDelete_Click(object sender, EventArgs e)
{
int Cve = ((LinkButton)sender).CommandArgument.ToEntero();
//LinkButton lnk = (LinkButton)sender;
//GridViewRow gvRow = (GridViewRow)lnk.NamingContainer;
//int CvePeriodo = gvRow.DataKey("CvePeriodo").ToEntero();
//int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
bool continuar = true;
ClsNominas Nom = new ClsNominas();
if (Nom.RemoveNom_Nominas(Cve))
using (ClsNominas Nom = new ClsNominas())
{
Alert("Los movimientos de la nómina fueron eliminados", TipoMensaje.MsgInformacion); cargaDatos();
Nom.IniciaTransacSQL();
//AutorizaNom_Nominas
if (continuar && (continuar = Nom.RemoveNom_Nominas(Cve)))
{
Alert("Los movimientos de la nómina fueron eliminados", TipoMensaje.MsgInformacion); cargaDatos();
Nom.Commit();
}
}
Nom.Dispose();
}
protected void LnkCancelar_Click(object sender, EventArgs e)
@@ -1495,24 +1533,48 @@ public partial class Nomina_Nomina2 : ClsPaginas
set { ViewState["SRTipoConcepto"] = value; }
}
#endregion
protected bool NomAutorizado
{
get
{
if (ViewState["NomAutorizado"] == null) { return false; }
else { return (bool)ViewState["NomAutorizado"]; }
}
set { ViewState["NomAutorizado"] = value; }
}
#endregion
protected void LnkSobreRecibo_Click(object sender, EventArgs e)
{
GridViewRow gvrow = (GridViewRow)(((LinkButton)sender).NamingContainer);
LnkSRVacacionesADD.Visible = false;
if (DdlCtaContable.Items.Count == 0)
{
using (ClsContPAQi ObjConta = new ClsContPAQi(UsuarioActual.Empresa))
if (UsuarioActual.Empresa.TipoContabilidad == 1)
{
if (ObjConta.Conectado && ObjConta.GetCuentas(-1, "-1", 1))
using (ClsContabilidad ObjConta = new ClsContabilidad())
{
DdlCtaContable.DataSource = ObjConta.DtResultados;
DdlCtaContable.DataBind();
if (ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa))
{
DdlCtaContable.DataSource = ObjConta.DtResultados;
DdlCtaContable.DataBind();
}
}
}
else
{
using (ClsContPAQi ObjConta = new ClsContPAQi(UsuarioActual.Empresa))
{
if (ObjConta.Conectado && ObjConta.GetCuentas(-1, "-1", 1))
{
DdlCtaContable.DataSource = ObjConta.DtResultados;
DdlCtaContable.DataBind();
}
}
}
DdlCtaContable.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlCtaContable.SelectedValueExist("-1");
@@ -1521,7 +1583,21 @@ public partial class Nomina_Nomina2 : ClsPaginas
SRCvePersonal = gvrow.DataKey("CvePersonal").ToEntero();
SRCvePeriodo = gvrow.DataKey("CvePeriodo").ToEntero();
int CveNomina = gvrow.DataKey("CveNomina").ToEntero();
NomAutorizado = gvrow.DataKey("NomAutorizado").ToUpper().Contiene(new string[] { "1", "TRUE" });
using (ClsNominas nom = new ClsNominas())
{
if (nom.GetNom_Nominas(CveNomina, SRCvePersonal, SRCvePeriodo, -1, UsuarioActual.CveEmpresa) && nom.DtResultados.Rows.Count > 0)
{
DataRow drow = nom.DtResultados.Rows[0];
ChkMetodoPago.Checked = drow["MetodoPagoFijo"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
DdlMetodoPago.SelectedValueExist(drow["CveMetodoPago"].ToString());
DdlBanco.SelectedValueExist(drow["CveSATBanco"].ToString());
TxtBancoNumCuenta.Text = drow["BancoNumCuenta"].ToString();
TxtCLABE.Text = drow["CLABE"].ToString();
}
}
LblEmpleado.Text = Nombre;
LblEmpleado.NavigateUrl = string.Format("/RH/Personal.aspx?CvePersonal={0}", SRCvePersonal);
TabPersonal.ActiveTabIndex = 0;
mostrarConceptos();
CargaVacaciones();
@@ -1553,16 +1629,28 @@ public partial class Nomina_Nomina2 : ClsPaginas
SRCveConcepto = ((LinkButton)sender).CommandArgument.ToEntero();
//CvePeriodoSeleccionado
//SRCvePersonal
bool continuar = true;
if (SRCveConcepto > 0)
{
using (ClsNominas onom = new ClsNominas())
{
if (onom.DeleteNom_NominasDetalles(SRCveConcepto, SRCvePersonal, CvePeriodoSeleccionado))
if (continuar = onom.DeleteNom_NominasDetalles(SRCveConcepto, SRCvePersonal, CvePeriodoSeleccionado))
{
Alert("el importe sera tomado del calculo y no del valor fijo");
}
}
}
if (continuar)
{
cargaDatos();
cargasobrericiboconceptos();
UpModalConceptos.Update();
RegistraScript("$('#ModalUpConcepto').modal('hide');");
Alert("el importe sera tomado del calculo y no del valor fijo");
}
}
protected void LnkConcepto_Click(object sender, EventArgs e)
{
@@ -1957,6 +2045,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
nConcepto.ValorP = dtempleados.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
nConcepto.isOnlyBisibleP = row["SoloVisible"].ToString().ToEntero();
nConcepto.isSavedP = dtempleadosConceptos.COUNT("CveConcepto", string.Format("CveConcepto={0} AND CvePersonal ={1} AND Estatus >0", CveConcepto, SRCvePersonal));
nConcepto.isEditedP = dtempleadosConceptos.COUNT("CveConcepto", string.Format("CveConcepto={0} AND CvePersonal ={1} AND Estatus =2", CveConcepto, SRCvePersonal));
}
if (maxded > i)
@@ -1973,6 +2063,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
nConcepto.ImporteD = Importe;
nConcepto.ValorD = dtempleados.SUM(string.Format("[VAL_{0}]", CveConcepto), string.Format("CvePersonal = {0}", SRCvePersonal));
nConcepto.isOnlyBisibleD = row["SoloVisible"].ToString().ToEntero();
nConcepto.isSavedD = dtempleadosConceptos.COUNT("CveConcepto", string.Format("CveConcepto={0} AND CvePersonal ={1} AND Estatus >0", CveConcepto, SRCvePersonal));
nConcepto.isEditedD = dtempleadosConceptos.COUNT("CveConcepto", string.Format("CveConcepto={0} AND CvePersonal ={1} AND Estatus =2", CveConcepto, SRCvePersonal));
}
lconc.Add(nConcepto);
@@ -2258,6 +2349,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
public double ImporteP { get; set; }
public double ValorP { get; set; }
public int EstatusP { get; set; }
public int isSavedP { get; set; }
public int isEditedP { get; set; }
public int isOnlyBisibleP { get; set; }
@@ -2269,6 +2361,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
public double ImporteD { get; set; }
public double ValorD { get; set; }
public int EstatusD { get; set; }
public int isSavedD { get; set; }
public int isEditedD { get; set; }
public int isOnlyBisibleD { get; set; }
@@ -2289,6 +2382,139 @@ public partial class Nomina_Nomina2 : ClsPaginas
int CveConceptoPolgvc, CveConceptoDolgvc;
protected void GvConceptos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == 0)
{
CveConceptoPolgvc = 1;
CveConceptoDolgvc = 1;
}
// Datakeys
// Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD
int CveConcepto = e.Row.DataKey("CveConceptoP").ToEntero();
int CveConceptoD = e.Row.DataKey("CveConceptoD").ToEntero();
// Dim Importe As Decimal = e.Row.DataKey("Importe").ToDecimal()
// Dim ImporteD As Decimal = e.Row.DataKey("ImporteD").ToDecimal()
int Estatus = e.Row.DataKey("EstatusP").ToEntero();
int EstatusD = e.Row.DataKey("EstatusD").ToEntero();
int isOnlyBisibleP = e.Row.DataKey("isOnlyBisibleP").ToEntero();
int isOnlyBisibleD = e.Row.DataKey("isOnlyBisibleD").ToEntero();
bool isEditedP = e.Row.DataKey("isEditedP").ToEntero() > 0;
bool isEditedD = e.Row.DataKey("isEditedD").ToEntero() > 0;
bool isSavedP = e.Row.DataKey("isSavedP").ToEntero() > 0;
bool isSavedD = e.Row.DataKey("isSavedD").ToEntero() > 0;
//isEditedD
// Controles
Label LtlConcepto = e.Row.FCLabel("LtlConcepto");
LinkButton LnkConcepto = e.Row.FCLinkButton("LnkConcepto");
Label LtlConceptoD = e.Row.FCLabel("LtlConceptoD");
LinkButton LnkConceptoD = e.Row.FCLinkButton("LnkConceptod");
Label LtlImporte = e.Row.FCLabel("LtlImporte");
LinkButton LnkImporte = e.Row.FCLinkButton("LnkImporte");
Label LtlImporteD = e.Row.FCLabel("LtlImporteD");
LinkButton LnkImporteD = e.Row.FCLinkButton("LnkImporteD");
LinkButton LnkImportexCalculo = e.Row.FCLinkButton("LnkImportexCalculo");
LinkButton LnkImporteDxCalculo = e.Row.FCLinkButton("LnkImporteDxCalculo");
//isEditedD
if (isOnlyBisibleP == 1)
{
e.Row.CssClass = string.Format("{0} isOnlyBisibleP", e.Row.CssClass);
}
if (isOnlyBisibleD == 1)
{
e.Row.CssClass = string.Format("{0} isOnlyBisibleD", e.Row.CssClass);
}
if (isEditedP)
{
e.Row.CssClass = string.Format("{0} isEditedP", e.Row.CssClass);
}
if (isEditedD)
{
e.Row.CssClass = string.Format("{0} isEditedD", e.Row.CssClass);
}
if (Estatus == -1) { LtlConcepto.Visible = false; }
else if (Estatus > 0) { LtlImporte.Visible = false; }
if (EstatusD == -1) { LtlConceptoD.Visible = false; }
else if (EstatusD > 0) { LtlImporteD.Visible = false; }
LtlImporte.Visible = false;
LtlImporteD.Visible = false;
if (Estatus < -1 | EstatusD < -1)
{
e.Row.CssClass = "ConceptosTotales";
LtlImporte.Visible = true;
LtlImporteD.Visible = true;
}
LnkImporte.CommandArgument = (CveConcepto > 0 ? CveConcepto.ToString() : "P");
LnkImporteD.CommandArgument = (CveConceptoD > 0 ? CveConceptoD.ToString() : "D");
if (LnkImportexCalculo != null)
{
LnkImportexCalculo.CommandArgument = LnkImporte.CommandArgument;
LnkImporteDxCalculo.CommandArgument = LnkImporteD.CommandArgument;
}
LnkImporte.Text = (CveConcepto > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteP").ToDecimal()) : (CveConceptoPolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : ""));
LnkImporteD.Text = (CveConceptoD > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteD").ToDecimal()) : (CveConceptoDolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : ""));
if (NomAutorizado)
{
LtlImporte.Visible = true;
LtlImporteD.Visible = true;
LtlImporte.Text = (CveConcepto > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteP").ToDecimal()) : (CveConceptoPolgvc > 0 ? "" : ""));
LtlImporte.Text = (CveConceptoD > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteD").ToDecimal()) : (CveConceptoDolgvc > 0 ? "" : ""));
LnkImporte.Visible = false;
LnkImporteD.Visible = false;
LnkImportexCalculo.Visible = false;
LnkImporteDxCalculo.Visible = false;
}
else
{
LnkImportexCalculo.Visible = isSavedP;
LnkImporteDxCalculo.Visible = isSavedD;
}
if (CveConcepto == 0 && (Estatus == 0 || Estatus == -1 || Estatus == -3)) { LtlImporte.Text = ""; }
if (CveConceptoD == 0 && (EstatusD == 0 || EstatusD == -1)) { LtlImporteD.Text = ""; }
LnkConcepto.Visible = !LtlConcepto.Visible;
LnkConceptoD.Visible = !LtlConceptoD.Visible;
LnkImporte.Visible = !LtlImporte.Visible;
LnkImporteD.Visible = !LtlImporteD.Visible;
LinkButton LnkConceptoO = e.Row.FCLinkButton("LnkConceptoO");
LinkButton LnkImporteO = e.Row.FCLinkButton("LnkImporteO");
if (LnkConceptoO != null)
{
LnkConceptoO.Visible = false;
LnkImporteO.Visible = false;
if (e.Row.DBCampo("ImporteO").ToDecimal() == 0)
{
e.Row.FCLabel("LtlConceptoO").Visible = false;
e.Row.FCLabel("LtlImporteO").Visible = false;
if (e.Row.DataKey("isOnlyBisibleO").ToEntero() == 1)
{
e.Row.CssClass = string.Format("{0} isOnlyBisibleO", e.Row.CssClass);
}
}
}
CveConceptoPolgvc = CveConcepto;
CveConceptoDolgvc = CveConceptoD;
}
}
protected void GvConceptosSimula_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
@@ -2366,8 +2592,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
LnkImporte.Text = (CveConcepto > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteP").ToDecimal()) : (CveConceptoPolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : ""));
LnkImporteD.Text = (CveConceptoD > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteD").ToDecimal()) : (CveConceptoDolgvc > 0 ? "<i class=\"fa fa-plus\"></i>" : ""));
LnkImporte.Text = (CveConcepto > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteP").ToDecimal()) : (CveConceptoPolgvc > 0 ? "" : ""));
LnkImporteD.Text = (CveConceptoD > 0 ? string.Format("${0:N2}", e.Row.DataKey("ImporteD").ToDecimal()) : (CveConceptoDolgvc > 0 ? "" : ""));
@@ -2379,6 +2605,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
LnkConcepto.Visible = !LtlConcepto.Visible;
LnkConceptoD.Visible = !LtlConceptoD.Visible;
LtlImporte.Visible = true;
LtlImporteD.Visible = true;
LtlImporte.Text = LnkImporte.Text;
LtlImporteD.Text = LtlImporteD.Text;
LnkImporte.Visible = !LtlImporte.Visible;
LnkImporteD.Visible = !LtlImporteD.Visible;
@@ -2403,6 +2635,22 @@ public partial class Nomina_Nomina2 : ClsPaginas
CveConceptoDolgvc = CveConceptoD;
}
}
protected void BtnGuardarMetododepago_Click(object sender, EventArgs e)
{
using (ClsNominas nom = new ClsNominas())
{
if (nom.NominaUpMetododepago(UsuarioActual.CveEmpresa, SRCvePersonal, SRCvePeriodo, ChkMetodoPago.Checked,
DdlMetodoPago.SelectedValue.ToEntero(), DdlBanco.SelectedValue.ToEntero(), TxtBancoNumCuenta.Text, TxtCLABE.Text))
{
Alert("La informacion se ha actualizado correctamente");
}
else
{
}
}
}
#endregion
protected void LnkFormatoTabular_Click(object sender, EventArgs e)
@@ -2741,15 +2989,15 @@ public partial class Nomina_Nomina2 : ClsPaginas
DataTable dt = dtempleados.FiltraParametros("CvePersonal >0", "", new string[] { "CvePersonal", "Nombre", "Codigo", "SumaPercepcionesG" });
//dt.Columns.Add("SumaPercepcionesG");
dt.Columns.Add("LimiteInferior");
dt.Columns.Add("ExedenteLI");
dt.Columns.Add("PorcentajeSE");
dt.Columns.Add("ImpuestoMarginal");
dt.Columns.Add("cuotafija");
dt.Columns.Add("LimiteInferior", typeof(decimal));
dt.Columns.Add("ExedenteLI", typeof(decimal));
dt.Columns.Add("PorcentajeSE", typeof(decimal));
dt.Columns.Add("ImpuestoMarginal", typeof(decimal));
dt.Columns.Add("cuotafija", typeof(decimal));
dt.Columns.Add("Impuestoantessubs");
dt.Columns.Add("subsidio");
dt.Columns.Add("Impuesto");
dt.Columns.Add("Impuestoantessubs", typeof(decimal));
dt.Columns.Add("subsidio", typeof(decimal));
dt.Columns.Add("Impuesto", typeof(decimal));
DataTable dtquin = null;
using (ClsNominas objnom = new ClsNominas())
@@ -2787,8 +3035,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
decimal Porcentaje = 0;
foreach (DataRow drow in dtquin.Rows)
{
decimal limite = drow["Limite inferior"].ToString().ToDecimal();
if (limite > SumaPercepcionesG) {
decimal limite = drow["Limite inferior"].ToString().ToDecimal();
if (limite > SumaPercepcionesG)
{
break;
}
else
@@ -2801,15 +3050,15 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
decimal Impuestomarginal = (SumaPercepcionesG - Limiteinferior) * (Porcentaje / 100);
decimal Impuestoantessubs= Impuestomarginal+ CuotaFija;
decimal Impuestoantessubs = Impuestomarginal + CuotaFija;
item["LimiteInferior"] = Limiteinferior;
item["ExedenteLI"] = SumaPercepcionesG - Limiteinferior;
item["PorcentajeSE"] = Porcentaje;
item["ImpuestoMarginal"] = Impuestomarginal;
item["cuotafija"] = CuotaFija;
item["Impuestoantessubs"] = Impuestoantessubs;
item["subsidio"] =0;
item["Impuesto"] = Impuestoantessubs;
item["subsidio"] = 0;
item["Impuesto"] = Impuestoantessubs;
//[Limite inferior],FORMAT(CuotaFija,'###,####,###0.00') [Cuota fija],FORMAT(Porcentaje,'###,####,###0.00') Porcentaje
}
dt.AcceptChanges();
@@ -4260,10 +4509,11 @@ public partial class Nomina_Nomina2 : ClsPaginas
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
bool estatus = ChkEstatus.Checked;
int CveCuenta =DdlCtaContable.SelectedValue.ToEntero();
bool Continuar;
using (ClsNominas ObjMovt = new ClsNominas())
{
Continuar = ObjMovt.AddMovtoPermanente(cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus);
Continuar = ObjMovt.AddMovtoPermanente(cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta);
}
if (Continuar)
@@ -4271,7 +4521,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
this.RegistraScript("$('#DModalMovtoPermanente').modal('hide');");
CargaMovtoPermanente();
UpMovtosPermanentes.Update();
this.Alert("El Movto_Permanente Se ha agregado");
this.Alert("Se ha agregado el movimiento permanente");
}
}
@@ -4286,10 +4536,11 @@ public partial class Nomina_Nomina2 : ClsPaginas
decimal montoLimite = TxtMontoLimite.Text.ToDecimal();
string fechaInicioAplicacion = TxtFechaAplicacion.Text.ToDate().ToString("yyyy/MM/dd");
bool estatus = ChkEstatus.Checked;
int CveCuenta = DdlCtaContable.SelectedValue.ToEntero();
bool Continuar;
using (ClsNominas ObjMovt = new ClsNominas())
{
Continuar = ObjMovt.UpMovtoPermanente(CcveMovtoPermanente, cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus);
Continuar = ObjMovt.UpMovtoPermanente(CcveMovtoPermanente, cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta);
}
if (Continuar)
@@ -4297,7 +4548,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
this.RegistraScript("$('#DModalMovtoPermanente').modal('hide');");
CargaMovtoPermanente();
UpMovtosPermanentes.Update();
this.Alert("El Movto_Permanente Se ha agregado");
this.Alert("Se ha actualizado el movimiento permanente");
}
}
@@ -4315,6 +4566,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
CcveMovtoPermanente = gvRow.DataKey("CveMovtoPermanente").ToEntero();
int cveConcepto = gvRow.DataKey("CveConcepto").ToEntero();
int cvePersonal = gvRow.DataKey("CvePersonal").ToEntero();
int CveCuenta = gvRow.DataKey("CveCuenta").ToEntero();
string descripcion = gvRow.DataKey("Descripcion");
int tipoDescuento = gvRow.DataKey("TipoDescuento").ToEntero();
double valor = gvRow.DataKey("Valor").ToDouble();
@@ -4341,6 +4593,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
TxtVecesAplicar.Text = vecesAplicar.ToString();
TxtMontoLimite.Text = montoLimite.ToString();
TxtFechaAplicacion.Text = $"{fechaInicioAplicacion:dd/MM/yyyy}";
DdlCtaContable.SelectedValueExist("-1");
DdlCtaContable.SelectedValueExist(CveCuenta);
ChkEstatus.Checked = estatus;
this.RegistraScript("$('#DModalMovtoPermanente').modal();");
@@ -5362,7 +5616,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
VacFolioActual = VacFolioActual + 1;
ClsRH objRH = new ClsRH();
// Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones)
bool continuar = objRH.SolicitudVacacionesAdd(SRCvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago: fechapago, diasinabiles: diasinhabil);
bool continuar = objRH.SolicitudVacacionesAdd(SRCvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago: fechapago, diasinabiles: diasinhabil, CveTipoPago: DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras: TxtVacDiasExtra.Text.ToEntero());//
if (objRH.DtResultados.Rows.Count > 0)
{
string ShowError = objRH.DtResultados.Rows[0]["ShowError"].ToString();
@@ -5384,7 +5638,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
CargaVacaciones();
//CargaVacacionesResumenPeriodoActual();
//VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " + NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin);
Alert("Las vacaciones se han actualizodo");
Alert("Las vacaciones se han solicitado");
}
}
else { Alert("La fecha Inicial debe ser inferior a la fecha final.", TipoMensaje.MsgAdvertencia); }
@@ -5400,14 +5654,22 @@ public partial class Nomina_Nomina2 : ClsPaginas
LinkButton lnkDescargaFormato = e.Row.FCLinkButton("ImgDescargaFormato");
LinkButton lnkDescargaAutorizacion = e.Row.FCLinkButton("ImgDescargaAutorizacion");
LinkButton lnkEditar = e.Row.FCLinkButton("ImgEditar");
if (_CveAutoriza > 0 | !_Estatus)
lnkEditar.Visible = false;
lnkEditar.Visible = true;
lnkDescargaFormato.Visible = true;
if (_CveAutoriza > 0 | !_Estatus)
{
lnkEditar.Visible = false;
lnkDescargaFormato.Visible = false;
}
// ScriptManager.GetCurrent(Me).RegisterAsyncPostBackControl(lnkDescargaFormato)
if (File.Exists(RutaDocuemntoAutorizacion) & _Estatus)
lnkDescargaAutorizacion.Visible = true;
else
lnkDescargaAutorizacion.Visible = false;
if (File.Exists(RutaDocuemntoAutorizacion) & _Estatus) { lnkDescargaAutorizacion.Visible = true; }
else { lnkDescargaAutorizacion.Visible = false; }
if (lnkDescargaAutorizacion != null && lnkDescargaAutorizacion.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaAutorizacion); }
if (lnkDescargaFormato != null && lnkDescargaFormato.Visible) { ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkDescargaFormato); }
}
}
protected void LnkEliminarSolicitud_Click(object sender, EventArgs e)
@@ -5423,20 +5685,81 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
objRH.Dispose();
}
protected int CvePersonalVacaciones
{
get
{
if (ViewState["CvePersonalVacaciones"] == null) { return 0; }
else { return ViewState["CvePersonalVacaciones"].ToString().ToEntero(); }
}
set { ViewState["CvePersonalVacaciones"] = value; }
}
public void Edit_ClickVacacionDia(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
//CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero;
CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero();
//VacFolio = GvRow.DataKey("Folio").ToString().ToEntero;
TxtvacFechaInicio.Text = GvRow.DataKey("FechaInicio").ToString().ToDate().ToString("dd/MM/yyyy");
TxtvacFechaFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate().ToString("dd/MM/yyyy");
TxtFechaDiaVacacion.Text = GvRow.DataKey("FechaInicio").ToString().ToDate().ToString("dd/MM/yyyy");
TxtFechaDiaVacacionFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate().ToString("dd/MM/yyyy");
RegistraScript("$('#divEditarDiaVacacion').modal({ backdrop: 'static', keyboard: false});");
UpModalEditarDiaVacacion.Update();
}
protected void BtnEditarDiaVacacionModal_Click(object sender, EventArgs e)
{
using (ClsRH objRH = new ClsRH())
{
string FileExtension = "-1";
List<Archivo> Filesgral = TxtFileFormatoVacaciones.getfiles().Archivos;
string Documento = "";
foreach (Archivo fileItem in Filesgral)
{
try
{
FileExtension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}";
string[] tempArray;
tempArray = fileItem.filename.ToString().Split("-".ToCharArray());
string rutaDestino = $@"{UsuarioActual.Empresa.Ruta}Personal\{SRCvePersonal}\Vacaciones\{Documento}";
if (!System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta + @"Personal\" + SRCvePersonal + @"\Vacaciones\"))
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + @"Personal\" + SRCvePersonal + @"\Vacaciones\");
if (System.IO.File.Exists(rutaDestino))
System.IO.File.Delete(rutaDestino);
System.IO.File.Move(fileItem.FileUrl, rutaDestino);
TxtFileFormatoVacaciones.Text = "";
}
catch (Exception ex)
{
// OnError("Error al cargar Formato vacaciones", ex);
}
}
if (Documento.Length > 0)
{
if (objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, SRCvePersonal, UsuarioActual.CveUsuario, Documento))
Alert("Las vacaciones se han autorizado.");
UpModalEditarDiaVacacion.Update();
CargaVacaciones();
// CargaVacacionesResumenPeriodoActual();
RegistraScript("$('#divEditarDiaVacacion').modal('hide');");
}
else { Alert("debe ingresar un documento para poder autorizar la solicitud", TipoMensaje.MsgAdvertencia); }
}
}
public void DownLoad_ClickSolicitudVacaciones(object sender, EventArgs e)
{
/*
@@ -5512,65 +5835,129 @@ public partial class Nomina_Nomina2 : ClsPaginas
else
Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia);*/
}
private List<TagsDocumentos> GetDatosTagsDocumentos()
{
var ListaTagsDocumentost = new List<TagsDocumentos>();
if (SRCvePersonal != -1)
{
using (ClsRH objRH = new ClsRH())
{
if (objRH.PersonalReclutamientoGet(SRCvePersonal, UsuarioActual.Empresa.CveEmpresa))
{
DataRow drow = objRH.DtResultados.Rows[0];
ListaTagsDocumentost.Add(new TagsDocumentos("{Nombres}", drow["Nombres"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{APaterno}", drow["APaterno"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{AMaterno}", drow["AMaterno"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{RFC}", drow["RFC"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{NombreCompleto}", LblEmpleado.Text));
ListaTagsDocumentost.Add(new TagsDocumentos("{Estatura}", drow["Estatura"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Peso}", drow["Peso"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{LugarNacimiento}", drow["LugarNacimiento"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Edad}", drow["Edad"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{NombreTelEmergencia}", drow["NombreTelEmergencia"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{TipoSangre}", drow["TipoSangre"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Vivienda}", drow["Vivienda"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{ViviendaDueno}", drow["ViviendaDueno"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{CreditoInfonavit}", drow["CreditoInfonavit"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{RentaMensual}", drow["RentaMensual"].ToString().ToDecimal().ToString("###,###,###.00")));
ListaTagsDocumentost.Add(new TagsDocumentos("{TransportePublico}", drow["TransportePublico"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{TrabajadoAnteriormente}", drow["TrabajadoAnteriormente"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{TrabajadoAnteriormenteObservaciones}", drow["TrabajadoAnteriormenteObservaciones"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{ParientesEmpresa}", drow["ParientesEmpresa"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{AcusadoDelito}", drow["AcusadoDelito"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{AcusadoDelitoObservaciones}", drow["AcusadoDelitoObservaciones"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Direccion}", drow["Direccion"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Calle}", drow["Calle"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Colonia}", drow["Colonia"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{CP}", drow["CP"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Telefono}", drow["Telefono"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Celular}", drow["Celular"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Correo}", drow["Correo"].ToString()));
// If Not IsDBNull(drow["CveSucursal"]) Then
// ListaTagsDocumentost.Add(New TagsDocumentos("{CveSucursal}", DDLSucursal4.Text))
// End If
ListaTagsDocumentost.Add(new TagsDocumentos("{NumeroSS}", drow["NumeroSS"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Licencia}", drow["Licencia"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{CartillaMilitar}", drow["CartillaMilitar"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{CURP}", drow["CURP"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{AutorizaAntidoping}", drow["AutorizaAntidoping"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Observaciones}", drow["Observaciones"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Direccion}", drow["Direccion"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{FechaIngreso}", drow["FechaIngreso"].ToString().ToDate().ToShortDateString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{Puesto}", drow["Puesto"].ToString()));
ListaTagsDocumentost.Add(new TagsDocumentos("{CUIP}", ""));
ListaTagsDocumentost.Add(new TagsDocumentos("{Denominacion}", ""));
ListaTagsDocumentost.Add(new TagsDocumentos("{FechaNacimiento}", drow["FechaNacimiento"].ToString().ToDate().ToString("dd/MM/yyyy")));
string fechaActual = " " + DateTime.Now.Day + " del mes " + DateTime.Now.Month + " del año " + DateTime.Now.Year;
string FechaActualDF = DateTime.Now.ToString("dd/MM/yyyy");
ListaTagsDocumentost.Add(new TagsDocumentos("{FechaActual}", fechaActual));
ListaTagsDocumentost.Add(new TagsDocumentos("{FechaActualDF}", FechaActualDF));
}
}
}
return ListaTagsDocumentost;
}
public void DownLoad_ClickSolicitudPermiso(object sender, EventArgs e)
{
/* GridViewRow GvRow = (GridViewRow)(LinkButton)sender.NamingContainer;
// Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
// DescarSolicitudVacaciones(Folio)
string RutaFormato = string.Format(@"{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta);
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
// Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
// DescarSolicitudVacaciones(Folio)
string RutaFormato = string.Format(@"{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta);
string NombreEmpleado = string.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text);
string Codigo = TxtCodigo.Text;
string Departamento = DdlDepartamento.SelectedItem.Text;
string JefeInmediato = DdlSupervisorOrganigrama.SelectedItem.Text;
string FechaInicio = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy");
string FechaFin = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy");
string diasPermiso = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}";
string HorasPermiso = ""; // String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
string MotivoPermiso = string.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"));
if (File.Exists(RutaFormato))
{
clsGemBoxDocument objGemDocument = new clsGemBoxDocument(RutaFormato);
List<TagsDocumentos> ListaTags = new List<TagsDocumentos>();
string NombreEmpleado = LblEmpleado.Text;
string Codigo = LblCodigoEmpleado.Text;
string Departamento = LblSRDepartamento.Text;
string JefeInmediato = "";
string FechaInicio = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy");
string FechaFin = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy");
string diasPermiso = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}";
string HorasPermiso = ""; // String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
string MotivoPermiso = string.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"));
if (File.Exists(RutaFormato))
{
clsGemBoxDocument objGemDocument = new clsGemBoxDocument(RutaFormato);
List<TagsDocumentos> ListaTags = new List<TagsDocumentos>();
ListaTags = GetDatosTagsDocumentos();
ListaTags = GetDatosTagsDocumentos();
ListaTags.Add(new TagsDocumentos("{NombreEmpleado}", NombreEmpleado));
ListaTags.Add(new TagsDocumentos("{Codigo}", Codigo));
ListaTags.Add(new TagsDocumentos("{Departamento}", Departamento));
ListaTags.Add(new TagsDocumentos("{JefeInmediato}", JefeInmediato));
ListaTags.Add(new TagsDocumentos("{FechaInicio}", FechaInicio));
ListaTags.Add(new TagsDocumentos("{FechaFin}", FechaFin));
ListaTags.Add(new TagsDocumentos("{diasPermiso}", diasPermiso));
ListaTags.Add(new TagsDocumentos("{HorasPermiso}", HorasPermiso));
ListaTags.Add(new TagsDocumentos("{MotivoPermiso}", MotivoPermiso));
ListaTags.Add(new TagsDocumentos("{NombreEmpleado}", NombreEmpleado));
ListaTags.Add(new TagsDocumentos("{Codigo}", Codigo));
ListaTags.Add(new TagsDocumentos("{Departamento}", Departamento));
ListaTags.Add(new TagsDocumentos("{JefeInmediato}", JefeInmediato));
ListaTags.Add(new TagsDocumentos("{FechaInicio}", FechaInicio));
ListaTags.Add(new TagsDocumentos("{FechaFin}", FechaFin));
ListaTags.Add(new TagsDocumentos("{diasPermiso}", diasPermiso));
ListaTags.Add(new TagsDocumentos("{HorasPermiso}", HorasPermiso));
ListaTags.Add(new TagsDocumentos("{MotivoPermiso}", MotivoPermiso));
objGemDocument.SustituirTags(ListaTags);
objGemDocument.SustituirTags(ListaTags);
// objGemDocument.GuardarStream()
objGemDocument.GuardarStreamPDF();
byte[] bytesInStream = objGemDocument.GetBytesDocumento();
// Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
objGemDocument.Dispose();
// objGemDocument.GuardarStream()
objGemDocument.GuardarStreamPDF();
byte[] bytesInStream = objGemDocument.GetBytesDocumento();
// Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
objGemDocument.Dispose();
Response.Clear();
Response.ContentType = "application/force-download";
Response.AddHeader("content-disposition", "attachment; filename=" + SRCvePersonal + "_Solicituddepermiso_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
Response.BinaryWrite(bytesInStream);
Response.End();
}
else { Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia); }
Response.Clear();
Response.ContentType = "application/force-download";
Response.AddHeader("content-disposition", "attachment; filename=" + CvePersonal + "_Solicituddepermiso_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
Response.BinaryWrite(bytesInStream);
Response.End();
}
else
Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia);
*/
}
public void DownLoad_ClickSolicitudAutorizacion(object sender, EventArgs e)
{
/*
GridViewRow GvRow = (GridViewRow)(LinkButton)sender.NamingContainer;
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
string _Documento = GvRow.DataKey("Documento");
string RutaDocuemntoAutorizacion = string.Format(@"{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento);
string RutaDocuemntoAutorizacion = string.Format(@"{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, SRCvePersonal, _Documento);
if (File.Exists(RutaDocuemntoAutorizacion))
{
@@ -5583,9 +5970,10 @@ public partial class Nomina_Nomina2 : ClsPaginas
Response.End();
}
else
{
Alert("No se encontro el documento que intenta descargar.");
}
*/
}
}
@@ -5800,16 +6188,65 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.Autorizaperiodoconta(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
if (objnom.RegistraProvision(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
int CvePrePolizaProvision = 0; int CvePrePolizaasmilidos = 0;
if (objnom.DtResultados.Rows.Count > 0)
if (objnom.DTSetResultados.Tables.Count > 1 && objnom.DTSetResultados.Tables[1].Rows.Count == 0)
{
CvePrePolizaProvision = objnom.DtResultados.Rows[0]["CvePrePoliza"].ToString().ToEntero();
CvePrePolizaasmilidos = objnom.DtResultados.Rows[0]["CvePrePolizaAsimilables"].ToString().ToEntero();
if (objnom.DtResultados.Rows.Count > 0)
{
CvePrePolizaProvision = objnom.DtResultados.Rows[0]["CvePrePoliza"].ToString().ToEntero();
CvePrePolizaasmilidos = objnom.DtResultados.Rows[0]["CvePrePolizaAsimilables"].ToString().ToEntero();
}
string mensaje = string.Format("La provision a sido autorizada.<br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\">Provision </a><br/>", CvePrePolizaProvision );
if (CvePrePolizaasmilidos>0)
{
mensaje = string.Format("{0} <a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={1}&Tipo=NOMPROV\"> Asimilados</a>", mensaje, CvePrePolizaasmilidos);
}
Alert(mensaje);
}
else
{
if (objnom.DTSetResultados.Tables.Count > 1)
{
StringBuilder str = new StringBuilder();
str.Append("<table>");
str.Append("<tbody>");
//ConceptoContable ConceptoNomina CodigoNombreCompleto
str.Append("<tr>");
str.Append("<th>");
str.Append("Concepto Contable");
str.Append("</th>");
str.Append("<th>");
str.Append("Concepto Nomina");
str.Append("</th>");
str.Append("<th>");
str.Append("Personal");
str.Append("</th>");
str.Append("</tr>");
foreach (DataRow item in objnom.DTSetResultados.Tables[1].Rows)
{
str.Append("<tr>");
str.Append("<td>");
str.Append(item["ConceptoContable"]);
str.Append("</td>");
str.Append("<td>");
str.Append(item["ConceptoNomina"]);
str.Append("</td>");
str.Append("<td>");
str.Append(item["CodigoNombreCompleto"]);
str.Append("</td>");
str.Append("</tr>");
}
str.Append("</tbody>");
str.Append("</table>");
Alert(string.Format("<div>no se pudo registrar la provisión, existen cuentas sin vincular.</div> {0}", str));
}
}
string mensaje = string.Format("La provision a sido autorizada.<br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\">Provision </a><br/><a href=\"../Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}&Tipo=NOMPROV\"> Asimilados</a>", CvePrePolizaProvision, CvePrePolizaasmilidos);
Alert(mensaje);
}
}
}
@@ -5923,7 +6360,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetDispersiondenomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
if (objnom.GetDispersionnomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
CrearLayout(objnom.DtResultados);
}
@@ -6183,4 +6620,5 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
LnkSRVacacionesADD.Visible = true;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -605,8 +605,8 @@ public partial class Nomina_ReportedeAcumulados : ClsPaginas
if (true)
{
Fila++;
oldcveSupProyecto = cveSupProyecto; newsubproyecto = true;
Fila += 4;
oldcveSupProyecto = cveSupProyecto; newsubproyecto = true;
column = 1;
column++;
libro.Cell(Fila - 3, column).Value = string.Format("Total {0}", subproyectoold);

View File

@@ -88,10 +88,8 @@
</td>
<td class="text-right"><b>Proveedor:</b></td>
<td>
<asp:DropDownList ID="DdlProveedor" AutoPostBack="false" runat="server" CssClass="form-control input-sm select2me" DataTextField="RazonSocial" DataValueField="CveProveedor" Style="width: 200px !important;"></asp:DropDownList></td>
<ADS:Dropdownlost runat="server" ID="DdlProveedor" CssStyle="width: 100%;" CssClassDdl="select2me " DataTextField="NombreCortoProveedor" DataValueField="CveProveedor" />
</td>
</tr>
<tr>
<td colspan="4" class="text-center">

View File

@@ -84,10 +84,14 @@ Partial Class OC_PopUpBuscarReq
' DdlProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
'End If
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlProveedor.DataBind()
'DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
'DdlProveedor.DataBind()
DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlProveedor.Items.Insert(0, New ListItem("Todos", "-1"))
DdlProveedor.setEsWebService(True)
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
DdlProveedor.SelectedText = "Todos"
DdlProveedor.SelectedValue = "-1"
'DdlSubProyectos.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveSubProyecto", "SubProyecto"}) 'GlobalDTSubProyectos(DdlProyectos.SelectedValue.ToEntero).FiltraParametros(String.Format("CveEmpresa = {0}", UsuarioActual.CveEmpresa))
DdlSubProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110),
@@ -174,8 +178,10 @@ Partial Class OC_PopUpBuscarReq
'Cargar Datos
If ValidarFiltrosSeleccionado() Then
Dim CveProveedor As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
Dim ObjOC As New ClsOC
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, DdlProveedor.SelectedValue.ToEntero,
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, CveProveedor,
If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100)
Dim DtOC = ObjOC.DtResultados ' tipotermino, esattus inicial

Binary file not shown.

View File

@@ -241,7 +241,7 @@ public partial class RH_CalculoSBC : ClsPaginas
{
string titulo = HttpUtility.HtmlDecode(Extensiones.ModExtensiones.TextoCelda(cell)).Trim();
titulo = limpiarcelda( titulo);
if (GridView.Columns[i].Visible && titulo.Length > 0)
if (GridView.Columns.Count > i && GridView.Columns[i].Visible && titulo.Length > 0)
{
if (dt.Columns.Contains(titulo))
titulo = titulo + i;

View File

@@ -2394,6 +2394,25 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" AssociatedControlID="DdlFormapagovacaciones">Forma de pago</asp:Label><br />
<asp:DropDownList ID="DdlFormapagovacaciones" DataValueField="Cve" DataTextField="Texto" Width="100%" CssClass="form-control select2me " runat="server">
<asp:ListItem Text="Pagadas por anticipado" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Por pagar" Value="2"></asp:ListItem>
<asp:ListItem Text="Trabajadas" Value="3"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtVacDiasExtra" CssClass="form-control input-sm " runat="server"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtVacDiasExtra">Días extras</asp:Label>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>

View File

@@ -4514,7 +4514,7 @@ Partial Class RH_Personal
VacFolioActual = VacFolioActual + 1
Dim objRH As New ClsRH
'Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones)
Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil)
Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, FechaPago:=fechapago, diasinabiles:=diasinhabil, CveTipoPago:=DdlFormapagovacaciones.SelectedValue.ToEntero(), diasExtras:=TxtVacDiasExtra.Text.ToEntero())
If objRH.DtResultados.Rows.Count > 0 Then
Dim ShowError As String = objRH.DtResultados.Rows(0)("ShowError").ToString()
If ShowError.Length > 0 Then
@@ -4768,11 +4768,6 @@ Partial Class RH_Personal
Protected Sub BtnEditarDiaVacacionModal_Click(sender As Object, e As EventArgs) Handles BtnEditarDiaVacacionModal.Click
Dim objRH As New ClsRH()
Dim FileExtension As String = "-1"
Dim Filesgral As List(Of Archivo) = TxtFileFormatoVacaciones.getfiles().Archivos
Dim Filename As String = ""
@@ -4784,36 +4779,27 @@ Partial Class RH_Personal
Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}"
Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
Dim rutaDestino As String = $"{UsuarioActual.Empresa.Ruta}Personal\{CvePersonal}\Vacaciones\{Documento}"
If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\") Then
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\")
End If
If System.IO.File.Exists(rutaDestino) Then
System.IO.File.Delete(rutaDestino)
End If
System.IO.File.Move(fileItem.FileUrl, rutaDestino)
TxtFileFormatoVacaciones.Text = ""
Catch ex As Exception
OnError("Error al cargar Formato vacaciones", ex)
End Try
Next
If Documento.Length > 0 Then
Dim objRH As New ClsRH()
If objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, CvePersonal, UsuarioActual.CveUsuario, Documento) Then
Alert("La fecha se actualizo correctamente")
End If
UpModalEditarDiaVacacion.Update()
objRH.Dispose()
CargaVacaciones()
CargaVacacionesResumenPeriodoActual()
RegistraScript("$('#divEditarDiaVacacion').modal('hide');")
@@ -5304,38 +5290,14 @@ Partial Class RH_Personal
Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble()
Dim Serie As String = TxtLiberarSerie.Text.Trim
Dim MsgError As String = ""
Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme)
If CveResultadoSalida > 0 Then
If CveSeccionAlmacenUniforme = 0 Then CveSeccionAlmacenUniforme = -3 'que lo tome por default
Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme)
Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero
If ResultadoDetalleSalida Then
Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme)
Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero
Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme)
Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie)
Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme)
If CveResultadoEntrada > 0 Then
Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie)
If ResultadoDetalleSalida And ResultadoDetalleEntrada Then
MsgError = ""
Else
Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError)
MsgError = "Error1"
End If
Else
MsgError = "Error1"
End If
Else
MsgError = "Error1"
End If
Else
MsgError = "Error"
End If
If MsgError = "" Then
If ResultadoDetalleSalida And ResultadoDetalleEntrada Then
ObjInventario.Commit()
Alert("El resguardo se liberó correctamente")
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalUniforme"))
@@ -5344,7 +5306,6 @@ Partial Class RH_Personal
Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError)
ObjInventario.RollBack()
End If
ObjInventario.Dispose()
End Sub

View File

@@ -53,29 +53,30 @@ Partial Class Sistemas_PopUpCambiaUsuario
End If
If splitedtext.Length > 0 Then
Select Case splitedtext(0).ToUpper()
Case "VSH" : CveEmpresa = "7"
Case "JAM" : CveEmpresa = "119"
Case "COMPUPROVEEDORES" : CveEmpresa = "72"
Case "DNDIFUSA" : CveEmpresa = "80"
Case "SOGO" : CveEmpresa = "8"
Case "BDH" : CveEmpresa = "140"
Case "ECONOLLANTAS" : CveEmpresa = "141"
End Select
End If
DdlEmpresa.DataBind()
DdlEmpresa.SelectedValue = CveEmpresa
'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero)
'DdlRol.DataBind()
'DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID)
CargaUsuarios()
'LblUsuario.Text = usuarioactual.
Select Case splitedtext(0).ToUpper()
Case "VSH" : CveEmpresa = "7"
Case "JAM" : CveEmpresa = "119"
Case "COMPUPROVEEDORES" : CveEmpresa = "72"
Case "DNDIFUSA" : CveEmpresa = "80"
Case "SOGO" : CveEmpresa = "8"
Case "BDH" : CveEmpresa = "140"
Case "ECONOLLANTAS" : CveEmpresa = "141"
Case "SERVEC" : CveEmpresa = "153"
End Select
End If
DdlEmpresa.DataBind()
DdlEmpresa.SelectedValue = CveEmpresa
'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero)
'DdlRol.DataBind()
'DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID)
CargaUsuarios()
'LblUsuario.Text = usuarioactual.
End If
End Sub

View File

@@ -320,7 +320,7 @@ Partial Class Site
Dim ClassActive As String
CveModuloPadreSeleccionado = 0 : CveModuloHijoSeleccionado = 0 : CveModuloNietoSeleccionado = 0
Dim strdomain = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, "")
Dim strdomain = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, "").Replace("https://", "http://")
If Request.Url.Port <> 80 Then
strdomain = strdomain.Replace(String.Format(":{0}", Request.Url.Port), "")
End If

View File

@@ -118,7 +118,7 @@ Partial Class CatClasificaciones
'End If
'Cuenta.Dispose()
Else
If UsuarioActual.Empresa.TipoContabilizacion = 2 Then
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
DivCuentaIngresos.Visible = False
DivCuentaCostos.Visible = False
DivCuentaGasto.Visible = False
@@ -224,17 +224,26 @@ Partial Class CatClasificaciones
Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1)
Dim ObjEmpresa As New ClsSisEmpresas
Dim Empresa As Empresa = Nothing
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
Empresa = ObjEmpresa.Empresa
Dim ObjContabilidad As New ClsContPAQi(Empresa)
If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then
DtCuentasContables = ObjContabilidad.DtResultados
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
Dim ObjEmpresa As New ClsSisEmpresas
Dim Empresa As Empresa = Nothing
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
Empresa = ObjEmpresa.Empresa
Dim ObjContabilidad As New ClsContPAQi(Empresa)
If ObjContabilidad.GetCuentas(-1, "-1", 1, 20000) Then
DtCuentasContables = ObjContabilidad.DtResultados
End If
ObjContabilidad.Dispose()
End If
ObjContabilidad.Dispose()
ObjEmpresa.Dispose()
ElseIf UsuarioActual.Empresa.TipoContabilizacion = 2 Then
DdlCuentaGasto.DataValueField = "CveCuenta"
DdlCuentaGasto.DataTextField = "Cuenta"
End If
ObjEmpresa.Dispose()
End Sub
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click

View File

@@ -68,7 +68,7 @@
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkRepDiario" runat="server" Visible="false" OnClick="LnkRepDiario_Click"> <i class="fa fa-file-o" style="font-weight:bold;"></i> Reporte Diario</asp:LinkButton>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivReporteDiario" ID="HLReporteDiario" runat="server"> <i class="fa fa-file-o"></i> Reporte Diario</asp:HyperLink>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
@@ -222,6 +222,53 @@
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivReporteDiario" class="modal 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">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Descargar Reporte Diario"></asp:Label></h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover Widthall">
<tbody>
<tr>
<td style="text-align: left;">Fecha Consulta
</td>
<td style="text-align: left;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="TxtFechaConsulta" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaConsulta" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaConsulta" runat="server" TargetControlID="TxtFechaConsulta" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaConsulta" TargetControlID="TxtFechaConsulta" PopupButtonID="LnkFechaConsulta" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaConsulta" runat="server" ControlToValidate="TxtFechaConsulta" Display="None" ErrorMessage="El campo <b>''Fecha Consulta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaConsulta" runat="server" ControlToValidate="TxtFechaConsulta" Display="None" ErrorMessage="El campo <b>''Fecha Consulta''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaConsulta" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaConsulta" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="BtnDescargar" runat="server" Text="Descargar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargar" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -37,7 +37,7 @@ Partial Class Ventas_RepPS
End If
If UsuarioActual.TienePermisoProceso(320) OrElse UsuarioActual.CveRol = 1 Then
LnkRepDiario.Visible = True
HLReporteDiario.Visible = True
End If
@@ -49,6 +49,8 @@ Partial Class Ventas_RepPS
Private Sub CargaDatosIniciales()
txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
TxtFechaConsulta.Text = Now.ToString("dd/MM/yyyy")
End Sub
Private Sub CargaCombos()
@@ -237,12 +239,12 @@ Partial Class Ventas_RepPS
#End Region
Protected Sub LnkRepDiario_Click(sender As Object, e As EventArgs)
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
Dim CveMoneda As Integer = -1
Dim TC As Integer = 1
Dim TCEspecifico As Decimal = -1
Dim FechaConsulta As DateTime = Now
Dim FechaConsulta As DateTime = TxtFechaConsulta.Text.ToDateTime()
Dim DataSet As DataSet = New DataSet
Dim ObjVentas As New ClsVentas()
@@ -276,6 +278,8 @@ Partial Class Ventas_RepPS
CellRangeTitulo.Style.HorizontalAlignment = HorizontalAlignmentStyle.Center
#Region "V E N T A S - L L A N T A S, R I N E S, A L I N E A C I O N E S"
Dim CeldaTotalVentaAcumulada As ExcelCell = Nothing
worksheet.Cells(2, 0).Value = "Sucursal"
'TITULO DE LLANTAS
worksheet.Cells.GetSubrangeAbsolute(1, 1, 1, 3).Merged = True
@@ -322,7 +326,9 @@ Partial Class Ventas_RepPS
'INICIA DESDE LA CUARTA FILA
Dim IdxSucursalesLlantasAlin As Integer = 3
Dim idxTabla As Integer = 0
For Each Row As DataRow In DtSucursalesLLantasAlin.Rows
idxTabla += 1
worksheet.Cells(IdxSucursalesLlantasAlin, 0).Value = Row("SubProyecto")
worksheet.Cells(IdxSucursalesLlantasAlin, 1).Value = Row("LlantasCantidadAnterior")
@@ -345,6 +351,10 @@ Partial Class Ventas_RepPS
'worksheet.Cells(IdxSucursalesLlantasAlin, 12).Value = Row("VentaAcumulada")
worksheet.Cells(IdxSucursalesLlantasAlin, 12).Formula = $"=SUM({worksheet.Cells(IdxSucursalesLlantasAlin, 10).Name}:{worksheet.Cells(IdxSucursalesLlantasAlin, 11).Name})"
If idxTabla = DtSucursalesLLantasAlin.Rows.Count Then
CeldaTotalVentaAcumulada = worksheet.Cells(IdxSucursalesLlantasAlin, 12)
End If
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin, 0, IdxSucursalesLlantasAlin, 12).Style
StyleData.Font.Weight = ExcelFont.BoldWeight
StyleData.Font.Name = "Calibri"
@@ -368,11 +378,336 @@ Partial Class Ventas_RepPS
'LA FILA DE LOS TOTALES DEBE ESTAR EN NEGITAS
worksheet.Cells.GetSubrangeAbsolute(IdxSucursalesLlantasAlin - 1, 0, IdxSucursalesLlantasAlin - 1, 12).Style.Font.Weight = ExcelFont.BoldWeight
#End Region
#Region "L L A N T A S M E S A Ñ O A N T E R I O R R E S U M E N"
Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxSucursalesLlantasAlin + 1
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes"
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1))
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year))
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS"
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %"
Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style
StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight
StyleTitleTable6.Font.Name = "Calibri"
StyleTitleTable6.Font.Size = 8 * 20
StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5)
'INICIA DESDE LA CUARTA FILA
Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1
For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() + " - LLANTAS"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas")
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
StyleData.Font.Weight = ExcelFont.NormalWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
IdxMesAnioAnteriorLlantasResumen += 1
Next
IdxMesAnioAnteriorLlantasResumen += 1
'RESUMEN DE METAS
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = "Mes"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = "Meta"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year - 1))
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Value = "DIF %"
Dim StyleTitleTableMeta = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
StyleTitleTableMeta.Font.Weight = ExcelFont.BoldWeight
StyleTitleTableMeta.Font.Name = "Calibri"
StyleTitleTableMeta.Font.Size = 8 * 20
StyleTitleTableMeta.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTableMeta.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTableMeta.HorizontalAlignment = HorizontalAlignmentStyle.Center
IdxMesAnioAnteriorLlantasResumen += 1
For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper() + " - LLANTAS"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = 0
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})"
Dim StyleDataMeta = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
StyleDataMeta.Font.Weight = ExcelFont.NormalWeight
StyleDataMeta.Font.Name = "Calibri"
StyleDataMeta.Font.Size = 8 * 20
StyleDataMeta.VerticalAlignment = VerticalAlignmentStyle.Center
StyleDataMeta.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleDataMeta.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleDataMeta.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
IdxMesAnioAnteriorLlantasResumen += 1
Next
DtMesAnioAnteriorLLantasResumen.Dispose()
#End Region
#Region "F R A N Q U I C I A S R E S U M E N"
Dim TotalFranquicias As Decimal = DtSucursalesLLantasAlin.FiltroPrimeroValor("LlantasCantidadAcumulada", "CveSubProyecto=11842").ToDecimal()
DtSucursalesLLantasAlin.Dispose()
Dim IdxRefFranquiciasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen
Dim columnRefFranquiciasResumen As Integer = 6
'PRM 19
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen).Value = $"PRM {Now.Year - 1}"
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 1).Value = "ALM PS"
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 2).Value = ""
worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Value = TotalFranquicias
'TOMA EL VALOR DE DIF LLANTAS
worksheet.Cells(IdxRefFranquiciasResumen + 1, columnRefFranquiciasResumen).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen - 4, 3).Name})"
worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 1).Value = $"FRANQ {Now.Year}"
worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Value = 4988
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen).Value = $"PRM {Now.Year}"
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 1).Value = ""
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2).Formula = $"=({worksheet.Cells(IdxRefFranquiciasResumen, columnRefFranquiciasResumen + 3).Name} - {worksheet.Cells(IdxRefFranquiciasResumen + 2, columnRefFranquiciasResumen + 2).Name})"
worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 3).Formula = $"+({worksheet.Cells(IdxRefFranquiciasResumen + 3, columnRefFranquiciasResumen + 2)})"
'TOMA EL VALOR DE DIF LLANTAS METAS
worksheet.Cells(IdxRefFranquiciasResumen + 4, columnRefFranquiciasResumen).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen - 1, 3).Name})"
Dim StyleTitleTableFR = worksheet.Cells.GetSubrangeAbsolute(IdxRefFranquiciasResumen, columnRefFranquiciasResumen, IdxRefFranquiciasResumen + 4, columnRefFranquiciasResumen + 3).Style
StyleTitleTableFR.Font.Weight = ExcelFont.BoldWeight
StyleTitleTableFR.Font.Name = "Calibri"
StyleTitleTableFR.Font.Size = 8 * 20
StyleTitleTableFR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTableFR.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTableFR.HorizontalAlignment = HorizontalAlignmentStyle.Center
'Dim StyleDataFranquicias = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
'StyleData.Font.Weight = ExcelFont.NormalWeight
'StyleData.Font.Name = "Calibri"
'StyleData.Font.Size = 8 * 20
'StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
'StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
'StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
'StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
IdxRefFranquiciasResumen += 1
#End Region
#Region "A Ñ O R E S U M E N"
Dim IdxRefAnioResumen As Integer = IdxRefFranquiciasResumen - 1
Dim columnRefAnioResumen As Integer = columnRefFranquiciasResumen + 5
'AÑO ANTERIOR
worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen).Value = Now.Year - 1
Dim CellAnioAnterior = worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1)
CellAnioAnterior.Value = 0
'AÑO ACTUAL
worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen).Value = Now.Year
Dim CellAnioActual = worksheet.Cells(IdxRefAnioResumen + 1, columnRefAnioResumen + 1)
CellAnioActual.Value = 0
worksheet.Cells(IdxRefAnioResumen + 2, columnRefAnioResumen + 1).Formula = $"=({CeldaTotalVentaAcumulada.Name} - {worksheet.Cells(IdxRefAnioResumen, columnRefAnioResumen + 1).Name})"
worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen).Value = $"X DIA {Now.Year - 1}"
worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen).Value = $"X DIA {Now.Year}"
Dim DiasFinMes As Integer = 0
Dim Day As Integer = Now.Day
Dim DaysMonth As Integer = DateTime.DaysInMonth(Now.Year, Now.Month)
Dim Month As Integer = Now.Month
Dim Year As Integer = Now.Year
For i = Day To DaysMonth
Dim DayRef As DateTime = New DateTime(Year, Month, i)
If DayRef.DayOfWeek <> DayOfWeek.Sunday Then
DiasFinMes += 1
End If
Next
worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen + 1).Formula = $"=({CellAnioAnterior.Name} - {CeldaTotalVentaAcumulada.Name})/{If(DiasFinMes > 0, DiasFinMes, 1)}"
worksheet.Cells(IdxRefAnioResumen + 3, columnRefAnioResumen + 2).Formula = $"=({CeldaTotalVentaAcumulada.Name}/{CellAnioAnterior.Name})"
worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen + 1).Formula = $"=({CellAnioActual.Name} - {CeldaTotalVentaAcumulada.Name})/{If(DiasFinMes > 0, DiasFinMes, 1)}"
worksheet.Cells(IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Formula = $"=({CeldaTotalVentaAcumulada.Name}/{CellAnioActual.Name})"
Dim StyleTitleTableAR = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioResumen, columnRefAnioResumen, IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Style
StyleTitleTableAR.Font.Weight = ExcelFont.BoldWeight
StyleTitleTableAR.Font.Name = "Calibri"
StyleTitleTableAR.Font.Size = 8 * 20
StyleTitleTableAR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTableAR.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTableAR.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim StyleDataAR = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioResumen, columnRefAnioResumen + 1, IdxRefAnioResumen + 4, columnRefAnioResumen + 2).Style
StyleDataAR.Font.Weight = ExcelFont.NormalWeight
StyleDataAR.Font.Name = "Calibri"
StyleDataAR.Font.Size = 8 * 20
StyleDataAR.VerticalAlignment = VerticalAlignmentStyle.Center
StyleDataAR.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleDataAR.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleDataAR.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
IdxRefAnioResumen += 1
#End Region
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxSucursalesLlantasAlin + 8
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %"
Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style
StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight
StyleTitleTable5.Font.Name = "Calibri"
StyleTitleTable5.Font.Size = 8 * 20
StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style
StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight
StyleSubTitleTable5.Font.Name = "Calibri"
StyleSubTitleTable5.Font.Size = 8 * 20
StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4)
'INICIA DESDE LA CUARTA FILA
Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1
For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows
worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal")
worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas")
worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})"
worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style
StyleData.Font.Weight = ExcelFont.NormalWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
IdxMesAnioAnteriorLlantas += 1
Next
DtMesAnioAnteriorLLantas.Dispose()
#End Region
#Region "A Ñ O A N T E R I O R"
Dim IdxRefAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas
Dim columnRefAnioAnterior As Integer = 9
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior).Value = "Sucursal"
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = (FechaConsulta.Year - 1).ToString()
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = FechaConsulta.Year.ToString()
worksheet.Cells(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 3).Value = "Dif"
Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, columnRefAnioAnterior, IdxRefAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style
StyleTitleTable4.Font.Weight = ExcelFont.BoldWeight
StyleTitleTable4.Font.Name = "Calibri"
StyleTitleTable4.Font.Size = 8 * 20
StyleTitleTable4.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTable4.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTable4.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim DtAnioAnteriorLLantas As DataTable = DataSet.Tables(3)
'INICIA DESDE LA CUARTA FILA
Dim IdxAnioAnteriorLlantas As Integer = IdxRefAnioAnteriorLlantas + 1
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila > 1").Rows
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior).Value = Row("Grupo")
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = Row("LLantas")
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Formula = $"=({worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Name})"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, columnRefAnioAnterior, IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style
StyleData.Font.Weight = ExcelFont.NormalWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
If Row("TipoFila").ToString() = "2" Then
StyleData.Font.Weight = ExcelFont.BoldWeight
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
End If
IdxAnioAnteriorLlantas += 1
Next
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila = 1").Rows
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior).Value = Row("Grupo")
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Value = Row("LLantas")
worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Formula = $"=(+{worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, columnRefAnioAnterior + 2).Name})"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, columnRefAnioAnterior, IdxAnioAnteriorLlantas, columnRefAnioAnterior + 3).Style
StyleData.Font.Weight = ExcelFont.BoldWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
IdxAnioAnteriorLlantas += 1
Next
DtAnioAnteriorLLantas.Dispose()
#End Region
#Region "V E N T A S - S E R V I C I O S D E I N S T A L A C I O N, A M O R T I G U A D O R E S, P O L I Z A S"
Dim IdxRefSucursalesServiciosAmortPolizas As Integer = IdxSucursalesLlantasAlin + 3
Dim IdxRefSucursalesServiciosAmortPolizas As Integer = IdxMesAnioAnteriorLlantas + 3
worksheet.Cells(IdxRefSucursalesServiciosAmortPolizas, 0).Value = "Sucursal"
'TITULO SERVICIOS DE INSTALACION
@@ -550,176 +885,6 @@ Partial Class Ventas_RepPS
DtPorcentajes.Dispose()
#End Region
#Region "A Ñ O A N T E R I O R"
Dim IdxRefAnioAnteriorLlantas As Integer = IdxPorcentajes + 3
worksheet.Cells(IdxRefAnioAnteriorLlantas, 0).Value = "Sucursal"
worksheet.Cells(IdxRefAnioAnteriorLlantas, 1).Value = (FechaConsulta.Year - 1).ToString()
worksheet.Cells(IdxRefAnioAnteriorLlantas, 2).Value = FechaConsulta.Year.ToString()
worksheet.Cells(IdxRefAnioAnteriorLlantas, 3).Value = "Dif"
Dim StyleTitleTable4 = worksheet.Cells.GetSubrangeAbsolute(IdxRefAnioAnteriorLlantas, 0, IdxRefAnioAnteriorLlantas, 3).Style
StyleTitleTable4.Font.Weight = ExcelFont.BoldWeight
StyleTitleTable4.Font.Name = "Calibri"
StyleTitleTable4.Font.Size = 8 * 20
StyleTitleTable4.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTable4.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTable4.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim DtAnioAnteriorLLantas As DataTable = DataSet.Tables(3)
'INICIA DESDE LA CUARTA FILA
Dim IdxAnioAnteriorLlantas As Integer = IdxRefAnioAnteriorLlantas + 1
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila > 1").Rows
worksheet.Cells(IdxAnioAnteriorLlantas, 0).Value = Row("Grupo")
worksheet.Cells(IdxAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxAnioAnteriorLlantas, 2).Value = Row("LLantas")
worksheet.Cells(IdxAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxAnioAnteriorLlantas, 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, 2).Name})"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, 0, IdxAnioAnteriorLlantas, 3).Style
StyleData.Font.Weight = ExcelFont.NormalWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
If Row("TipoFila").ToString() = "2" Then
StyleData.Font.Weight = ExcelFont.BoldWeight
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
End If
IdxAnioAnteriorLlantas += 1
Next
For Each Row As DataRow In DtAnioAnteriorLLantas.FiltraParametros("TipoFila = 1").Rows
worksheet.Cells(IdxAnioAnteriorLlantas, 0).Value = Row("Grupo")
worksheet.Cells(IdxAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxAnioAnteriorLlantas, 2).Value = Row("LLantas")
worksheet.Cells(IdxAnioAnteriorLlantas, 3).Formula = $"=(+{worksheet.Cells(IdxAnioAnteriorLlantas, 1).Name} - {worksheet.Cells(IdxAnioAnteriorLlantas, 2).Name})"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxAnioAnteriorLlantas, 0, IdxAnioAnteriorLlantas, 3).Style
StyleData.Font.Weight = ExcelFont.BoldWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
StyleData.FillPattern.SetPattern(FillPatternStyle.Solid, SpreadsheetColor.FromArgb(255, 215, 0), SpreadsheetColor.FromArgb(255, 255, 255))
IdxAnioAnteriorLlantas += 1
Next
DtAnioAnteriorLLantas.Dispose()
#End Region
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
Dim IdxRefMesAnioAnteriorLlantas As Integer = IdxAnioAnteriorLlantas + 3
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 1, IdxRefMesAnioAnteriorLlantas - 1, 3).Merged = True
worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 4, IdxRefMesAnioAnteriorLlantas - 1, 6).Merged = True
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 1).Value = "LLANTAS"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas - 1, 4).Value = "%"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 0).Value = "Sucursal"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 1).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year - 1))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 2).Value = String.Format("{0} {1}", ToShortMonthName(FechaConsulta).ToUpper(), (FechaConsulta.Year))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 3).Value = "DIF %"
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 4).Value = String.Format("{0} - %", (FechaConsulta.Year - 1))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 5).Value = String.Format("{0} - %", (FechaConsulta.Year))
worksheet.Cells(IdxRefMesAnioAnteriorLlantas, 6).Value = "DIF %"
Dim StyleTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas - 1, 0, IdxRefMesAnioAnteriorLlantas - 1, 6).Style
StyleTitleTable5.Font.Weight = ExcelFont.BoldWeight
StyleTitleTable5.Font.Name = "Calibri"
StyleTitleTable5.Font.Size = 8 * 20
StyleTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim StyleSubTitleTable5 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantas, 0, IdxRefMesAnioAnteriorLlantas, 6).Style
StyleSubTitleTable5.Font.Weight = ExcelFont.BoldWeight
StyleSubTitleTable5.Font.Name = "Calibri"
StyleSubTitleTable5.Font.Size = 8 * 20
StyleSubTitleTable5.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleSubTitleTable5.VerticalAlignment = VerticalAlignmentStyle.Center
StyleSubTitleTable5.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim DtMesAnioAnteriorLLantas As DataTable = DataSet.Tables(4)
'INICIA DESDE LA CUARTA FILA
Dim IdxMesAnioAnteriorLlantas As Integer = IdxRefMesAnioAnteriorLlantas + 1
For Each Row As DataRow In DtMesAnioAnteriorLLantas.Rows
worksheet.Cells(IdxMesAnioAnteriorLlantas, 0).Value = Row("Sucursal")
worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Value = Row("LLantas")
worksheet.Cells(IdxMesAnioAnteriorLlantas, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name})"
worksheet.Cells(IdxMesAnioAnteriorLlantas, 4).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1.07) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
worksheet.Cells(IdxMesAnioAnteriorLlantas, 5).Formula = $"=+(({worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name} * 1) - {worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name}) /12"
worksheet.Cells(IdxMesAnioAnteriorLlantas, 6).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantas, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantas, 1).Name}) - 1"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantas, 0, IdxMesAnioAnteriorLlantas, 6).Style
StyleData.Font.Weight = ExcelFont.NormalWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
IdxMesAnioAnteriorLlantas += 1
Next
DtMesAnioAnteriorLLantas.Dispose()
#End Region
#Region "L L A N T A S M E S A Ñ O A N T E R I O R"
Dim IdxRefMesAnioAnteriorLlantasResumen As Integer = IdxMesAnioAnteriorLlantas + 2
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 0).Value = "Mes"
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 1).Value = String.Format("{0}", (FechaConsulta.Year - 1))
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 2).Value = String.Format("{0}", (FechaConsulta.Year))
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 3).Value = "DIF UDS"
worksheet.Cells(IdxRefMesAnioAnteriorLlantasResumen, 4).Value = "DIF %"
Dim StyleTitleTable6 = worksheet.Cells.GetSubrangeAbsolute(IdxRefMesAnioAnteriorLlantasResumen, 0, IdxRefMesAnioAnteriorLlantasResumen, 4).Style
StyleTitleTable6.Font.Weight = ExcelFont.BoldWeight
StyleTitleTable6.Font.Name = "Calibri"
StyleTitleTable6.Font.Size = 8 * 20
StyleTitleTable6.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleTitleTable6.VerticalAlignment = VerticalAlignmentStyle.Center
StyleTitleTable6.HorizontalAlignment = HorizontalAlignmentStyle.Center
Dim DtMesAnioAnteriorLLantasResumen As DataTable = DataSet.Tables(5)
'INICIA DESDE LA CUARTA FILA
Dim IdxMesAnioAnteriorLlantasResumen As Integer = IdxRefMesAnioAnteriorLlantasResumen + 1
For Each Row As DataRow In DtMesAnioAnteriorLLantasResumen.Rows
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 0).Value = ToMonthName(FechaConsulta).ToUpper()
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Value = Row("LLantasAnioAnterior")
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Value = Row("LLantas")
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 3).Formula = $"=({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name} - {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name})"
worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 4).Formula = $"=+({worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 2).Name} / {worksheet.Cells(IdxMesAnioAnteriorLlantasResumen, 1).Name})"
Dim StyleData = worksheet.Cells.GetSubrangeAbsolute(IdxMesAnioAnteriorLlantasResumen, 0, IdxMesAnioAnteriorLlantasResumen, 4).Style
StyleData.Font.Weight = ExcelFont.NormalWeight
StyleData.Font.Name = "Calibri"
StyleData.Font.Size = 8 * 20
StyleData.VerticalAlignment = VerticalAlignmentStyle.Center
StyleData.HorizontalAlignment = HorizontalAlignmentStyle.Center
StyleData.Borders.SetBorders(MultipleBorders.All, SpreadsheetColor.FromName(ColorName.Black), LineStyle.Thin)
StyleData.NumberFormat = "_-* #,##0.00_-;-* #,##0.00_-;_-* ""-""??_-;_-@_-"
IdxMesAnioAnteriorLlantasResumen += 1
Next
DtMesAnioAnteriorLLantasResumen.Dispose()
#End Region
Dim columnCount = worksheet.CalculateMaxUsedColumns()
For i = 0 To columnCount

BIN
WEB.zip

Binary file not shown.

View File

@@ -1867,7 +1867,7 @@ Public Class WSSIGApp
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, UsuarioActual.CveEmpresa) Then
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, CveCliente, ObjFactura.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
ObjFactura.DtPromociones = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
@@ -1951,13 +1951,13 @@ Public Class WSSIGApp
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {ObjCliente.CveUsoCFDI}")
ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows.Count > 0 Then
ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows(0)("MetodoPago").ToString
Else
ObjFactura.CveMetodoPago = 1
ObjFactura.MetodoPago = "Efectivo"
End If
'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
'If GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows.Count > 0 Then
' ObjFactura.MetodoPago = GlobalDTMetodosPago.FiltraParametros($"CveMetodoPago = {ObjCliente.CveMetodoPago}").Rows(0)("MetodoPago").ToString
'Else
' ObjFactura.CveMetodoPago = 1
' ObjFactura.MetodoPago = "Efectivo"
'End If
ObjFactura.CveClienteSucursal = -1
End If

View File

@@ -250,6 +250,10 @@