This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2023-08-04 07:43:26 -07:00
47 changed files with 5356 additions and 360 deletions

View File

@@ -241,7 +241,7 @@ Public Class CFDIComprobante
Public Property MetodoPago As String = ""
Public Property Exportacion As String = "01" '01-No Aplica
Public Property LugarExpedicion As String = ""
Public Property NumCuentaPago As String = ""
'Public Property NumCuentaPago As String = ""
Public Property Confirmacion As String = ""
End Class
@@ -305,7 +305,7 @@ Public Class CFDINominaReceptor
Public Property Departamento As String = ""
Public Property Puesto As String = ""
Public Property CodigoRiesgoPuesto As String = ""
Public Property TipoPeriodo As String = ""
Public Property PeriodicidadPago As String = ""
Public Property CodigoBanco As String = ""
Public Property NumeroCuenta As String = ""
Public Property SDI As Decimal = 0

View File

@@ -3374,8 +3374,8 @@ Public Class ClsContPAQi
StrSQL.Append(" ELSE 'Otras' ")
StrSQL.Append(" END AS Clasificacion, CAST (C.Id AS varCHAR(10)) + '||' + C.Nombre AS IdNombre, CASE WHEN ISNUMERIC (C.Codigo) = 1 THEN FORMAT (CAST (C.Codigo AS DECIMAL(35,0)),REPLACE (Mascarilla, 'X', '0') ) ELSE C.Codigo END CuentaFormato, ")
StrSQL.Append(" CFad.Id AS IdPadre, CFad.Codigo AS CodigoPadre, CFad.Nombre AS NombrePadre, CASE WHEN ISNUMERIC (C.Codigo) = 1 THEN FORMAT (CAST (C.Codigo AS DECIMAL(35,0)), REPLACE (Mascarilla, 'X', '0') ) ELSE C.Codigo END + ' - ' + C.Nombre + ' ' + CASE WHEN C.Afectable = 1 THEN '(Afec)' ELSE '(No Afect)' END AS CtaCodigoPadre ")
StrSQL.Append(" , CASE WHEN CtaSup IN ('_ACTIVO','_BPASIVO','_CAPITAL','_UTILIDAD','_RACREEDOR','_RDEUDOR','_CUADRE','_ORDEN') ")
StrSQL.Append(" AND NOT SubCtade IN ('_ACTIVO','_BPASIVO','_CAPITAL','_UTILIDAD','_RACREEDOR','_RDEUDOR','_CUADRE') THEN 1 ELSE 0 END AS CtaInicial,")
StrSQL.Append(" , CASE WHEN CtaSup IN ('_ACTIVO','_BPASIVO','_PASIVO','_CAPITAL','_UTILIDAD','_RACREEDOR','_RDEUDOR','_CUADRE','_ORDEN') ")
StrSQL.Append(" AND NOT SubCtade IN ('_ACTIVO','_BPASIVO','_PASIVO','_CAPITAL','_UTILIDAD','_RACREEDOR','_RDEUDOR','_CUADRE') THEN 1 ELSE 0 END AS CtaInicial,")
StrSQL.Append(" E.Nivel, E.Orden")
StrSQL.Append(" FROM Estructura E")
StrSQL.Append(" INNER JOIN Cuentas C ON C.Id = E.IdSubCtade ")

View File

@@ -1537,7 +1537,7 @@ Public Class ClsMovimientos
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1,
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = MinFecha, Optional FechaAplicadoF As Date = MaxFecha,
Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1) As Boolean
Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1, Optional CveMoneda As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepRecuperacion")
With SqlAdapter.SelectCommand.Parameters
@@ -1569,6 +1569,7 @@ Public Class ClsMovimientos
.Add("@FechaRegistroIEI", SqlDbType.Date).Value = FechaRegistroIEI.ToShortDateString
.Add("@FechaRegistroIEF", SqlDbType.Date).Value = FechaRegistroIEF.ToShortDateString
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -6873,26 +6873,26 @@ Public Class ClsPaginas
RptParametro.Add(New ReportParameter("Puesto", Puesto))
'DATOS NOMINA
If ObjNomina.GetNom_Nominas(CveNomina, CvePersonal, CvePeriodo, 1, CveEmpresa) Then
RptParametro.Add(New ReportParameter("ReciboNomina", ObjNomina.Folio.ToString))
RptParametro.Add(New ReportParameter("Serie", ObjNomina.Serie))
RptParametro.Add(New ReportParameter("Fecha", ObjNomina.Fecha.ToString))
RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo))
RptParametro.Add(New ReportParameter("DiasPagados", ObjNomina.DiasPagados.ToString))
RptParametro.Add(New ReportParameter("MetodoPago", ObjNomina.MetodoPago)) '"""PUE"" (Pago en una sola exhibición)"
RptParametro.Add(New ReportParameter("FormaPago", """99"" (Por definir)"))
RptParametro.Add(New ReportParameter("Cantidad", "1"))
RptParametro.Add(New ReportParameter("Unidad", "ACT"))
RptParametro.Add(New ReportParameter("Descripcion", "PAGO DE NÓMINA"))
RptParametro.Add(New ReportParameter("Total", If(indemnizacion, ajusteindemnizacion, ObjNomina.Total - ajusteindemnizacion).ToString()))
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
cQr = CBB.GenerarCBBBytes(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString().ToDecimal(), FolioFiscal)
RptParametro.Add(New ReportParameter("ImporteLetra", ObjNomina.Total.ToString.ToDouble.Texto2Letras))
RptParametro.Add(New ReportParameter("Clave", "84111505"))
Else
TieneError = True
End If
RptParametro.Add(New ReportParameter("ReciboNomina", ObjNomina.Folio.ToString))
RptParametro.Add(New ReportParameter("Serie", ObjNomina.Serie))
RptParametro.Add(New ReportParameter("Fecha", ObjNomina.Fecha.ToString))
RptParametro.Add(New ReportParameter("Periodo", ObjNomina.TipoPeriodo))
RptParametro.Add(New ReportParameter("DiasPagados", ObjNomina.DiasPagados.ToString))
RptParametro.Add(New ReportParameter("MetodoPago", ObjNomina.MetodoPago)) '"""PUE"" (Pago en una sola exhibición)"
RptParametro.Add(New ReportParameter("FormaPago", """99"" (Por definir)"))
RptParametro.Add(New ReportParameter("Cantidad", "1"))
RptParametro.Add(New ReportParameter("Unidad", "ACT"))
RptParametro.Add(New ReportParameter("Descripcion", "PAGO DE NÓMINA"))
RptParametro.Add(New ReportParameter("Total", If(indemnizacion, ajusteindemnizacion, ObjNomina.Total - ajusteindemnizacion).ToString()))
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
cQr = CBB.GenerarCBBBytes(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString().ToDecimal(), FolioFiscal)
RptParametro.Add(New ReportParameter("ImporteLetra", ObjNomina.Total.ToString.ToDouble.Texto2Letras))
RptParametro.Add(New ReportParameter("Clave", "84111505"))
Else
TieneError = True
End If
Else
TieneError = True
End If
If Not TieneError Then
If ObjNomina.GetPeriodos(-1, CveEmpresa, -1, -1, CvePeriodo) Then
@@ -9207,6 +9207,7 @@ Public Class ClsPaginas
'PaginaDict.Add("/Sistemas/CatEmpresas.aspx".ToUpper(), 2)
PaginaDict.Add("/Sistemas/CatEmpresas.aspx".ToUpper(), 24)
PaginaDict.Add("/Sistemas/Empresa.aspx".ToUpper(), 2)
PaginaDict.Add("/Sistemas/Empresa2.aspx".ToUpper(), -1)
PaginaDict.Add("/Sistemas/CatUsuarios.aspx".ToUpper(), 20)
PaginaDict.Add("/Sistemas/Usuarios.aspx".ToUpper(), 20)
PaginaDict.Add("/Sistemas/UsuarioDetalle.aspx".ToUpper(), 20)
@@ -9325,7 +9326,15 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/RepCancelacionesVentas.aspx".ToUpper(), 1325)
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx".ToUpper(), 1331)
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=OP".ToUpper(), 1332)
PaginaDict.Add("/Ventas/FacturacionAcarreos.aspx".ToUpper(), 774)
PaginaDict.Add("/Ventas/RepIndicadoresPorProyecto.aspx".ToUpper(), 617)
#End Region
#Region "Varios"
'Portal Cliente/Proveedor

View File

@@ -443,6 +443,10 @@ Public Class ClsSisEmpresas
_Empresa.GrupoEmpresa = Data.Rows(0)("GrupoEmpresa").ToString.ToEntero
_Empresa.PlantillaMailVenta = Data.Rows(0)("PlantillaMailVenta").ToString
_Empresa.AsuntoPlantillaMailVenta = Data.Rows(0)("AsuntoPlantillaMailVenta").ToString
_Empresa.PlantillaMailVentaCotizacion = Data.Rows(0)("PlantillaMailVentaCotizacion").ToString
_Empresa.AsuntoPlantillaMailVentaCotizacion = Data.Rows(0)("AsuntoPlantillaMailVentaCotizacion").ToString
_Empresa.CvePlataforma = Data.Rows(0)("CvePlataforma").ToString.ToEntero
_Empresa.CveDistribuidor = Data.Rows(0)("CveDistribuidor").ToString.ToEntero
_Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero

View File

@@ -33,7 +33,7 @@ Public Class ClsSisMail
Return Resultado
End Function
Public Function SendMail(ObjEmpresa As Empresa, Para As String, Asunto As String, Body As String, Optional CCP As String = "", Optional Archivos As List(Of ArchivoMail) = Nothing, Optional Displayname As String = "") As Boolean
Public Function SendMail(ObjEmpresa As Empresa, Para As String, Asunto As String, Body As String, Optional CCP As String = "", Optional Archivos As List(Of ArchivoMail) = Nothing, Optional Displayname As String = "", Optional CCO As String = "") As Boolean
Dim ObjMail As New Mail
ObjMail.ObjEmpresa = ObjEmpresa
ObjMail.De = If(Displayname.Trim = String.Empty, "", Displayname)
@@ -41,6 +41,7 @@ Public Class ClsSisMail
ObjMail.CCP = CCP
ObjMail.Asunto = Asunto
ObjMail.Body = Body
ObjMail.CCO = CCO
If Archivos IsNot Nothing AndAlso Archivos.Count > 0 Then ' si tiene adjuntos, me crea el objeto
ObjMail.Archivos = New List(Of ArchivoMail)
@@ -85,6 +86,7 @@ Public Class ClsSisMail
Dim Mensaje As String = String.Empty
Dim ArrayPara() As String = ObjMail.Para.Replace(",", ";").Split(";"c)
Dim ArrayCCP() As String = ObjMail.CCP.Replace(",", ";").Split(";"c)
Dim ArrayBCC() As String = ObjMail.CCO.Replace(",", ";").Split(";"c)
'"sgd.facturacion@adsistemas.mx"
If ObjMail.De = String.Empty Then
@@ -103,6 +105,12 @@ Public Class ClsSisMail
For Each CorreoCCPPara As String In ArrayCCP.Distinct
If IsMail(CorreoCCPPara.Trim) Then Correo.To.Add(CorreoCCPPara.Trim)
Next
End If
If ArrayBCC IsNot Nothing AndAlso ArrayBCC.Length > 0 Then
For Each CorreoCCOPara As String In ArrayBCC.Distinct
If IsMail(CorreoCCOPara.Trim) Then Correo.Bcc.Add(CorreoCCOPara.Trim)
Next
End If
Correo.Subject = ObjMail.Asunto
@@ -120,7 +128,6 @@ Public Class ClsSisMail
Correo.Body = Mensaje & ObjMail.Body
Correo.IsBodyHtml = True
Correo.Priority = Net.Mail.MailPriority.Normal
If ObjMail.Archivos IsNot Nothing Then
For Each Item As ArchivoMail In ObjMail.Archivos
If Item.ArchivoBinario IsNot Nothing Then
@@ -190,6 +197,7 @@ Public Class ClsSisMail
Public Property Para As String
Public Property Asunto As String
Public Property CCP As String
Public Property CCO As String
Public Property Body As String
Public Property Archivos As List(Of ArchivoMail)
End Class

View File

@@ -301,7 +301,7 @@ Public Class ClsSisUsuarios
Retorno.CveTipoDocumento = "-1"
End If
Retorno.ListaPersonalizacion = CargaPersonalizacionUsuario(Retorno.CveUsuario)
End If
@@ -313,6 +313,21 @@ Public Class ClsSisUsuarios
Return Retorno
End Function
Public Function CargaPersonalizacionUsuario(CveUsuarioParamerto As Integer) As Hashtable
Dim Retorno As New Hashtable
If GetUsuariosPersonalizaciones(CveUsuarioParamerto) Then
For Each drow As DataRow In Data.Rows
Retorno.Add(drow("PersonalizacionNombre").ToString, drow("PersonalizacionValor").ToString)
Next
End If
Return Retorno
End Function
Public Function ValidaUsuarioAsignacion(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
Dim Retorno As Usuario = Nothing
@@ -2951,6 +2966,56 @@ Public Class ClsSisUsuarios
#End Region
#Region "PERSONALIZACIÓN COLUMNAS USUARIO"
Public Function GetUsuariosPersonalizaciones(ByVal CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_UsuariosPersonalizacionesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener la personalización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Retorno = False
End Try
Return Retorno
End Function
Public Function AddUsuariosPersonalizaciones(ByRef UsuarioActual As Usuario, PersonalizacionNombre As String, PersonalizacionValor As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_UsuariosPersonalizacionesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveUsuario", SqlDbType.Int).Value = UsuarioActual.CveUsuario
.Add("@PersonalizacionNombre", SqlDbType.VarChar).Value = PersonalizacionNombre
.Add("@PersonalizacionValor", SqlDbType.VarChar).Value = PersonalizacionValor
End With
Try
SqlAdapter.Fill(Data)
UsuarioActual.ListaPersonalizacion = CargaPersonalizacionUsuario(UsuarioActual.CveUsuario)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al guardar la personalización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Retorno = False
End Try
Return Retorno
End Function
#End Region
#Region "IDisposable Support"
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then

View File

@@ -5850,7 +5850,7 @@ Public Class ClsVentas
.Add("@CamionRemolque2", SqlDbType.VarChar).Value = CamionRemolque2
.Add("@Distancia", SqlDbType.Decimal).Value = Distancia
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@ErrorMSG", SqlDbType.VarChar, 300).Direction = ParameterDirection.Output
.Add("@ErrorMSG", SqlDbType.VarChar, 5000).Direction = ParameterDirection.Output
End With
Try

View File

@@ -140,8 +140,9 @@ Public Class Empresa
Public Property CveEncuestaCRM As Integer
Public Property FielPassword As String
Public Property FielPFX As String
Public Property FielPFX As String
Public Property AsuntoPlantillaMailVentaCotizacion As String
Public Property PlantillaMailVentaCotizacion As String
Dim Funcionalidades As HybridDictionary
'HybridDictionary, no se puede serializar, por eso no es propiedad, y se utilizar el setfuncionalidad, para asignarle valor
Public Sub SetFuncionalidades(HD As HybridDictionary)

View File

@@ -137,7 +137,7 @@ Public Class LogicNominas
Dim Departamento As String = ""
Dim Puesto As String = ""
Dim CveSATRiesgoPuesto As String = ""
Dim TipoPeriodoPago As String = ""
Dim PeriodicidadPago As String = ""
Dim ClaveBanco As String = ""
Dim BancoNumCuenta As String = ""
Dim SDI As Decimal = 0
@@ -203,17 +203,16 @@ Public Class LogicNominas
Departamento = objPersonal.Departamento
Puesto = objPersonal.Puesto
CveSATRiesgoPuesto = objPersonal.CveSATRiesgoPuesto.ToString()
TipoPeriodoPago = objPersonal.TipoPeriodoPago
If Not MetodoPagoFijo Then
ClaveBanco = objPersonal.ClaveBanco
BancoNumCuenta = objPersonal.BancoNumCuenta
End If
'If Not MetodoPagoFijo Then
' ClaveBanco = objPersonal.ClaveBanco
' BancoNumCuenta = objPersonal.BancoNumCuenta
'End If
SDI = objPersonal.SDI
SalarioDiarioSS = objPersonal.SalarioDiarioSS
ClaveEstado = objPersonal.ClaveEstado
AntiguedadSemanas = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero()
FormatoReciboCFDi = objPersonal.FormatoReciboCFDi
Else
If continuar Then GetError = "No se pudo obtener la información del empleado" 'si continuar= true el error se origino en este nodo y le asigno el error
@@ -266,6 +265,8 @@ Public Class LogicNominas
FechaFin = DrPeriodo("FechaFin").ToString().ToDate()
FechaPago = DrPeriodo("FechaPago").ToString().ToDate()
PeriodicidadPago = DrPeriodo("ClavePerioricidadPago").ToString()
AntiguedadSemanas = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, FechaFin).ToEntero()
If Not TimbreIndemnizacion Then
FechaInicio = DrPeriodo("FechaInicio").ToString().ToDate()
@@ -474,7 +475,7 @@ Public Class LogicNominas
cfdi.Comprobante.CondicionesdePago = "" '"CONTADO"
cfdi.Comprobante.FormadePago = If(versionTimbre = VersionTimbradoEnum.Version4_0, "", "99")
cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString() ' AHORITA SOLO SE REQUIERE ESPECIFICAR EL CODIGO POSTAL
cfdi.Comprobante.NumCuentaPago = "" 'objPersonal.BancoNumCuenta
'cfdi.Comprobante.NumCuentaPago = "" 'objPersonal.BancoNumCuenta
'4.0
cfdi.Receptor.DomicilioFiscalReceptor = CodigoPostal
cfdi.Receptor.RegimenFiscalReceptor = "605"
@@ -491,7 +492,7 @@ Public Class LogicNominas
cfdi.Nomina.Receptor.Departamento = Departamento
cfdi.Nomina.Receptor.Puesto = Puesto
cfdi.Nomina.Receptor.CodigoRiesgoPuesto = CveSATRiesgoPuesto.ToString()
cfdi.Nomina.Receptor.TipoPeriodo = TipoPeriodoPago
cfdi.Nomina.Receptor.PeriodicidadPago = PeriodicidadPago
cfdi.Nomina.Receptor.CodigoBanco = ClaveBanco
cfdi.Nomina.Receptor.NumeroCuenta = BancoNumCuenta
cfdi.Nomina.Receptor.SDI = SDI

View File

@@ -516,7 +516,7 @@ Public Class Timbrado
Dim UrlServicio As String = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL"
Dim AmbienteProductivo As Boolean = True
If Not Empresa.FacturaProduccion OrElse Empresa.CveEmpresa = 1 Then
If Not Empresa.FacturaProduccion OrElse Empresa.CveEmpresa = 1 OrElse Not ClsPaginas.EsProduccion Then
UsuarioServicio = "fgomez"
ClaveServicio = "12121212"
Clave = "12345678a"
@@ -713,12 +713,15 @@ Public Class Timbrado
Dim UsuarioServicio As String = "rene.molina@adssistemas.mx"
Dim ClaveServicio As String = "Facturacion2021#"
If Not Empresa.FacturaProduccion OrElse Empresa.CveEmpresa = 1 Then
EmisorRFC = "ZUÑ920208KL4"
ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key"
ArchivoCertificado = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer"
If Not Empresa.FacturaProduccion OrElse Empresa.CveEmpresa = 1 OrElse Not ClsPaginas.EsProduccion Then
EmisorRFC = "EKU9003173C9"
ArchivoLLave = $"{Extensiones.ModExtensiones.DirectorioEmpresas}1\Certificados\EKU9003173C9.key"
ArchivoCertificado = $"{Extensiones.ModExtensiones.DirectorioEmpresas}1\Certificados\EKU9003173C9.cer"
Clave = "12345678a"
TimbraProduccion = False
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
End If
Dim llaveByte As Byte(), certByte As Byte()
@@ -1325,7 +1328,7 @@ Public Class Timbrado
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 OrElse Not ClsPaginas.EsProduccion Then
AmbienteProductivo = False
Clave = "12345678a"
EmisorRFC = "EKU9003173C9"
@@ -1362,7 +1365,7 @@ Public Class Timbrado
Dim cfdi As New Profact.TimbraCFDI40.Conector(AmbienteProductivo)
Dim comprobante As New Profact.TimbraCFDI40.Comprobante()
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 OrElse Not ClsPaginas.EsProduccion Then
cfdi.EstableceCredenciales("mvpNUXmQfK8=")
Else
cfdi.EstableceCredenciales($"vSGxMFWnNRy/nDoowxqrqw==|Sia123654")
@@ -2326,8 +2329,8 @@ Public Class Timbrado
Nom.Receptor.Puesto = ObjCFDITimbre.Nomina.Receptor.Puesto
Nom.Receptor.RiesgoPuestoSpecified = True
Nom.Receptor.RiesgoPuesto = ObjCFDITimbre.Nomina.Receptor.CodigoRiesgoPuesto
Nom.Receptor.PeriodicidadPago = ObjCFDITimbre.Nomina.Receptor.TipoPeriodo
If ObjCFDITimbre.Nomina.Receptor.CodigoBanco <> "" Then
Nom.Receptor.PeriodicidadPago = ObjCFDITimbre.Nomina.Receptor.PeriodicidadPago
If ObjCFDITimbre.Nomina.Receptor.CodigoBanco <> "" AndAlso ObjCFDITimbre.Nomina.Receptor.NumeroCuenta <> "" Then
Nom.Receptor.BancoSpecified = True
Nom.Receptor.Banco = ObjCFDITimbre.Nomina.Receptor.CodigoBanco
Nom.Receptor.CuentaBancaria = ObjCFDITimbre.Nomina.Receptor.NumeroCuenta
@@ -2403,30 +2406,62 @@ Public Class Timbrado
FolioFiscal = resultadoTimbre.FolioUUID
If FolioFiscal <> "" Then
resultadoTimbre.GuardaXml(RutaArchivo, NombreArchivoXML)
'----------------------
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then
Select Case ObjCFDITimbre.Comprobante.TipoComprobante
Case "N"
Using ObjNomina2 As New ClsNominas()
'Actualiza Estatus Factura
If Ventas.CveVenta > 0 Then
If ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0, isFiniquito:=Ventas.Timbre.IStimbreFiniquito) Then
Retorno = ""
Else
Retorno = "Error"
End If
End Using
Dim ObjVentas As New ClsVentas()
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", Now, Ventas.CveVenta, CvePAC:=UsuarioActual.Empresa.CvePAC, RFCReceptor:=ObjCFDITimbre.Receptor.RFC, CFDIVersion:="4.0") Then
Case "T"
Dim objGrales As New ClsGenerales
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC, "4.0") Then
Retorno = ""
Else
Retorno = "Error"
End If
ObjVentas.Dispose()
objGrales.Dispose()
Using ObjInv As New ClsInventarios()
If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then
Retorno = ""
Else
Retorno = "Error"
End If
End Using
Case Else
''Actualiza Cliente (NumeroCuenta)
'If Not UsuarioActual.CveEmpresa.Contiene(72, 80) Then
' Dim Hilo2 As New System.Threading.Thread(Sub() ActualizaCliente(UsuarioActual.CveUsuario, Ventas.Cliente.NumCtaPago, Ventas.CveMetodoPago, Ventas.CveCliente))
' Hilo2.Start()
'End If
'Actualiza Estatus Factura
If Ventas.CveVenta > 0 Then
End If
End If
Using ObjVentas As New ClsVentas()
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=UsuarioActual.Empresa.CvePAC, RFCReceptor:=ObjCFDITimbre.Receptor.RFC, CFDIVersion:="4.0") Then
Retorno = ""
Else
Retorno = "Error"
End If
End Using
'Genero la addenda Ford
If Ventas.Cliente.Ford_GSDB <> "" Then
Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML) 'If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))
Dim FolioFactura As String = ""
If UsuarioActual.CveEmpresa = 8 Then FolioFactura = Ventas.Folio.ToString ' sogo, pordefault manda el folio de la factura
GeneraAddendaFord(RutaCadena, FolioFactura, Ventas.FordASN, Ventas.FordGSDB)
End If
End If
End Select
'----------------------
If Not IO.Directory.Exists($"{UsuarioActual.Empresa.Ruta}CBB\") Then IO.Directory.CreateDirectory($"{UsuarioActual.Empresa.Ruta}CBB\")
@@ -2445,25 +2480,6 @@ Public Class Timbrado
End If
If ObjCFDITimbre.Comprobante.TipoComprobante = "T" Then
Dim objGrales As New ClsGenerales
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC, "4.0") Then
Retorno = ""
Else
Retorno = "Error"
End If
objGrales.Dispose()
Using ObjInv As New ClsInventarios()
If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then
Retorno = ""
Else
Retorno = "Error"
End If
End Using
End If
'Pendiente. Ruta guardar archivos
sw.Stop()
swTiempo.AppendFormat("Actualizado: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)
@@ -2950,7 +2966,7 @@ Public Class Timbrado
ObjCFDITimbre.Nomina.Receptor.Departamento,
ObjCFDITimbre.Nomina.Receptor.Puesto,
ObjCFDITimbre.Nomina.Receptor.CodigoRiesgoPuesto,
If(ObjCFDITimbre.Nomina.TipoNomina = "E", "99", ObjCFDITimbre.Nomina.Receptor.TipoPeriodo),
ObjCFDITimbre.Nomina.Receptor.PeriodicidadPago,
ObjCFDITimbre.Nomina.Receptor.CodigoBanco,
ObjCFDITimbre.Nomina.Receptor.NumeroCuenta,
ObjCFDITimbre.Nomina.Receptor.SBC,
@@ -3075,18 +3091,18 @@ Public Class Timbrado
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 OrElse Not ClsPaginas.EsProduccion Then
EmisorRFC = "EKU9003173C9"
UsuarioActual.Empresa.Empresa = "ESCUELA KEMPER URGATE"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\EKU9003173C9.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\EKU9003173C9.cer"
ArchivoLLave = $"{Extensiones.ModExtensiones.DirectorioEmpresas}1\Certificados\EKU9003173C9.key"
ArchivoCertificado = $"{Extensiones.ModExtensiones.DirectorioEmpresas}1\Certificados\EKU9003173C9.cer"
Clave = "12345678a"
TimbraProduccion = False
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
UsuarioActual.Empresa.CodigoRegimenFiscal = "601"
End If
#Region "Valida"
@@ -3298,15 +3314,18 @@ Public Class Timbrado
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 Then
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 OrElse Not ClsPaginas.EsProduccion Then
EmisorRFC = "EKU9003173C9"
UsuarioActual.Empresa.Empresa = "ESCUELA KEMPER URGATE"
ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\EKU9003173C9.key"
ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\EKU9003173C9.cer"
ArchivoLLave = $"{Extensiones.ModExtensiones.DirectorioEmpresas}1\Certificados\EKU9003173C9.key"
ArchivoCertificado = $"{Extensiones.ModExtensiones.DirectorioEmpresas}1\Certificados\EKU9003173C9.cer"
Clave = "12345678a"
TimbraProduccion = False
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
End If
#Region "Valida"

View File

@@ -46,7 +46,8 @@ Public Class Usuario
Public Property ModoSimulacion As Boolean = False
Public Property NombreAbreviatura As String
Public Property SessionId As String
Private Property ListaSesion As Hashtable
Private Property ListaSesion As Hashtable
Public Property ListaPersonalizacion As Hashtable
Public Property Acceso As Integer
Public Property TipoControl As Integer
@@ -100,6 +101,18 @@ Public Class Usuario
End Set
End Property
Public Property Personalizaciones(NombrePersonalizacion As String) As String
Get
If ListaPersonalizacion Is Nothing Then ListaPersonalizacion = New Hashtable
Personalizaciones = If(ListaPersonalizacion.Item(NombrePersonalizacion) IsNot Nothing, ListaPersonalizacion.Item(NombrePersonalizacion).ToString, "")
End Get
Set(value As String)
If ListaPersonalizacion Is Nothing Then ListaPersonalizacion = New Hashtable
'Sino existe el valor, se crea.
If ListaPersonalizacion.Item(NombrePersonalizacion) IsNot Nothing Then ListaPersonalizacion.Item(NombrePersonalizacion) = value Else ListaPersonalizacion.Add(NombrePersonalizacion, value)
End Set
End Property
#End Region

View File

@@ -130,7 +130,7 @@ Public Class E141 : Implements IHttpHandler
End If
Catch ex As Exception
GuardaLogAD("Ocurrió un error al descargar el pdf. " + ex.ToString() + ".parametros: " + Params, "LogE141")
GuardaLogAD("Ocurrió un error al descargar el pdf. " + ex.ToString() + ".parametros: " + Params, "LogE141Descargas")
End Try
Else
@@ -250,6 +250,16 @@ Public Class E141 : Implements IHttpHandler
Else
retorno = "False"
End If
Case "EnviarCorreoAltasSemanal"
GuardaLogAD("CA-Inicia envio de correo semanal", "LogE141")
respuesta = EnviarCorreoActualizarProductos()
GuardaLogAD("CA-Finaliza envio de correo semanal", "LogE141")
If respuesta Then
retorno = "True"
Else
retorno = "False"
End If
End Select
End If
@@ -268,6 +278,27 @@ Public Class E141 : Implements IHttpHandler
End Try
End Sub
Private Sub EnviarCorreoNotificacion(TareaNotificar As String, Cuerpo As String)
Dim ResultadoMail As Integer = 0
Dim CorreoDestino As String = "atencion@fidelityapps.mx"
Dim MailCC As String = "citas@econollantas.com;sixrogs@hotmail.com;ffelix@econollantas.com"
Dim MailCCO As String = "jonathan.perez@adssistemas.mx;rene.molina@adsistemas.mx"
If Not EsProduccion Then
CorreoDestino = "jonathan.perez@adssistemas.mx"
MailCC = "rene.molina@adsistemas.mx"
MailCCO = "japmx95@gmail.com"
End If
Dim ObjMail As New ClsSisMail
If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, TareaNotificar, Cuerpo, CCP:=MailCC, CCO:=MailCCO) Then
GuardaLogAD($"EC-Envio de correo exitoso. Tarea: {TareaNotificar}", "LogE141")
Else
GuardaLogAD($"EC-No se pudo enviar el correo. Tarea: {TareaNotificar}", "LogE141")
End If
End Sub
Private Function ValidarSolicitud(ByVal context As HttpContext) As AuthMessage
Dim unauthorized As Boolean = True
Dim respuesta As New AuthMessage
@@ -1729,6 +1760,38 @@ Public Class E141 : Implements IHttpHandler
'End Function
#Region "C R E A C I Ó N / A C T U A L I Z A C I Ó N - P R O D U C T O S"
Private Function EnviarCorreoActualizarProductos() As Boolean
Dim Retorno As Boolean = True
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTENER LOS PRODUCTOS NUEVOS EN LA ULTIMA SEMANA
If ObjPS.GetProductosModificados(CveEmpresa, 44, HorasDiferencia:=(24 * 7)) Then
DtPS = ObjPS.DtResultados
End If
End Using
If DtPS IsNot Nothing Then
Dim sb As New StringBuilder
For Each Row As DataRow In DtPS.Rows
sb.AppendFormat("- {0}. <br/>", Row("CodigoPS"))
Next
Dim msg As String = ""
If sb.Length > 0 Then
msg = $"Se enviaron los siguientes productos: <br/> {sb.ToString()} <br/> Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}"
Else
msg = $"No se enviaron productos esta semana <br/> Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}"
End If
EnviarCorreoNotificacion("SIG - Productos enviados en la semana", msg)
End If
Return Retorno
End Function
Private Function CrearActualizarProductos(Todos As Boolean) As Boolean
Dim Retorno As Boolean = False
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
@@ -1738,6 +1801,8 @@ Public Class E141 : Implements IHttpHandler
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 26)) Then
DtPS = ObjPS.DtResultados.Copy()
Else
GuardaLogAD($"NP-Ocurrió un error al obtener los productos", "LogE141")
End If
End Using
@@ -1759,10 +1824,10 @@ Public Class E141 : Implements IHttpHandler
CountPeticionesExitosas += 1
GuardaLogAD("NP-Creacion/actualizacion de productos exitosa", "LogE141")
Else
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${respuesta.ToString()}", "LogE141")
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${respuesta.ToString()}", "LogE141")
End If
Else
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${resp}", "LogE141")
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${resp}", "LogE141")
End If
Else
@@ -1799,16 +1864,18 @@ Public Class E141 : Implements IHttpHandler
CountPeticionesExitosas += 1
GuardaLogAD("NP-Creacion/actualizacion de productos exitosa", "LogE141")
Else
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${respuesta.ToString()}", "LogE141")
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${respuesta.ToString()}", "LogE141")
End If
Else
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${resp}", "LogE141")
GuardaLogAD($"NP-No se pudo realizar la Creacion/actualizacion de productos ${resp}", "LogE141")
End If
Threading.Thread.Sleep(1000)
End While
End If
If DtPS.Rows.Count > 0 Then
EnviarCorreoNotificacion("SIG - Actualización de productos", $"Se ejecuto la tarea de actualización de productos. <br/> Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}")
End If
End If
If CountPeticionesExitosas = CountPeticiones Then
@@ -1826,7 +1893,7 @@ Public Class E141 : Implements IHttpHandler
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
If ObjPS.GetProductosModificados(CveEmpresa, 44, If(Todos, -1, 26)) Then
DtPS = ObjPS.DtResultados.Copy()
End If
End Using
@@ -1890,6 +1957,12 @@ Public Class E141 : Implements IHttpHandler
Private Function ActualizarPrecios(Todos As Boolean) As Boolean
Dim Retorno As Boolean = False
'ENVIAR PRECIOS SOLO DE 8am a 7pm
If Now.Hour < 7 OrElse Now.Hour > 21 Then
Retorno = True
Return Retorno
End If
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
Dim DtPS As DataTable = Nothing
@@ -1897,6 +1970,8 @@ Public Class E141 : Implements IHttpHandler
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetPreciosModificados(CveEmpresa, 44, If(Todos, -1, 1)) Then
DtPS = ObjPS.DtResultados.Copy()
Else
GuardaLogAD($"AP-Ocurrió un error al obtener los precios", "LogE141")
End If
End Using
@@ -1965,8 +2040,13 @@ Public Class E141 : Implements IHttpHandler
End While
End If
If DtPS.Rows.Count > 0 Then
EnviarCorreoNotificacion("SIG - Actualización de precios", $"Se ejecuto la tarea de actualización de precios. <br/> Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}")
End If
End If
Return Retorno
End Function
@@ -2017,11 +2097,19 @@ Public Class E141 : Implements IHttpHandler
Dim Retorno As Boolean = False
Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
'ENVIAR SOLO DE 8am a 8pm
If Now.Hour < 7 OrElse Now.Hour > 21 Then
Retorno = True
Return Retorno
End If
Dim DtPS As DataTable = Nothing
Using ObjPS As New ClsProductosServicios
'OBTERNER PRECIOS DE PUBLICO GENERAL
If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
DtPS = ObjPS.DtResultados.Copy()
Else
GuardaLogAD($"AE-Ocurrió un error al obtener las existencias", "LogE141")
End If
End Using
@@ -2087,6 +2175,10 @@ Public Class E141 : Implements IHttpHandler
Threading.Thread.Sleep(1000)
End While
End If
If DtPS.Rows.Count > 0 Then
EnviarCorreoNotificacion("SIG - Actualización de existencias", $"Se ejecuto la tarea de actualización de existencias. <br/> Fecha y hora: {Now.ToString("dd/MM/yyyy hh:mm:ss tt")}")
End If
End If
If CountPeticionesExitosas = CountPeticiones Then

View File

@@ -869,13 +869,13 @@ Partial Class Bancos_IE
End Try
CveIEDeposito = ObjIE.DtResultados(0)("CveIEDepositoPadre").ToString.ToEntero
CuentaDepositoPadre = ObjIE.DtResultados(0)("CuentaDepositoPadre").ToString
Cuenta = ObjIE.DtResultados(0)("NumCuenta").ToString
CveIEDeposito2 = ObjIE.DtResultados(0)("CveIEDeposito2").ToString.ToEntero
NumComplementos = ObjIE.DtResultados(0)("NumComplementos").ToString.ToEntero
Dim CveIEEstadoCuenta As Integer = ObjIE.DtResultados(0)("CveIEEstadoCuenta").ToString.ToEntero
If UsuarioActual.TienePermisoProceso(99) Then
'BtnActualizar.Visible = True
@@ -936,6 +936,7 @@ Partial Class Bancos_IE
'ChkImpreso.Checked = ObjIE.FueImpreso
ChkConciliado.Checked = ObjIE.FueConciliado
DdlEstatusIE.SelectedValue = ObjIE.CveEstatusIE.ToString
DdlEstatusIE.Visible = False
LblEstatusIE.Visible = True
@@ -1087,6 +1088,9 @@ Partial Class Bancos_IE
If UsuarioActual.TienePermisoProceso(85) AndAlso Not ObjIE.FueConciliado Then LnkCancelar.Visible = True
' si fue conciliado manual, pero no relacionado al IEEstadocuenta, porque es conciliación bancaria
If UsuarioActual.TienePermisoProceso(85) AndAlso UsuarioActual.CveEmpresa = 119 AndAlso ObjIE.FueConciliado AndAlso CveIEEstadoCuenta = 0 Then LnkCancelar.Visible = True
''COMENTAR - solo para pruebas
'If UsuarioActual.TienePermisoProceso(85) Then LnkCancelar.Visible = True
'If UsuarioActual.TienePermisoProceso(80) Then LnkEliminar.Visible = True

View File

@@ -1428,7 +1428,7 @@ Partial Class Bancos_PopIECompras
Select Case RBLContado.SelectedValue
Case "1" ' Bancos
Dim ImporteBancos As Decimal = TxtImporte.Text.ToDecimal
Dim ImporteBancos As Decimal = TxtImporte.Text.ToDecimal.RoundSQL
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImporteBancos, CveMoneda, 11, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"))
If Not CveIE > 0 Then
MsgError = "Ocurrio un Error al registrarse el movimiento bancario."

View File

@@ -27,6 +27,9 @@ Partial Class Ventas_RepRecuperacion
End If
End Sub
Private Sub CargaCombos()
'CARGA PROVEEDORES
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)

Binary file not shown.

View File

@@ -6635,7 +6635,7 @@ Partial Class Compras_Compras
End If
End If
Next
Dim diferenciaTransito As Decimal = 0
For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
Dim importeMNTemp As Decimal = 0
@@ -6643,6 +6643,7 @@ Partial Class Compras_Compras
ErrorMovInv = True
Exit For
End If
Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal
'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
@@ -6654,23 +6655,28 @@ Partial Class Compras_Compras
End If
End If
Next
'si se marca que no se va a recibir, falta validación
If Not ErrorMovInv AndAlso Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 1, UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Dim diferenciaTransito As Decimal = 0
'la diferencia se va aplicar sobre los
'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL
If diferenciaTransito <> 0 Then
Dim tCveCon As Integer = 65
If diferenciaTransito < 0 Then
tCveCon = 64
End If
diferenciaTransito = Math.Abs(diferenciaTransito)
Dim tCveCon As Integer = 65
If diferenciaTransito < 0 Then
tCveCon = 64
End If
diferenciaTransito = Math.Abs(diferenciaTransito)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
ErrorPrepoliza = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
ErrorPrepoliza = True
End If
End If
End If
Else
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
Else
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
If TotalRealDevolucion <> 0 Then
If Math.Abs(DiferenciaDevolucion) > 0 Then

View File

@@ -413,11 +413,13 @@ Partial Class Compras_ReembolsosComprobaciones
Dim FechaFactura As Date = gvRowVal.DataKey("FechaCompra").ToDate
Dim FechaDocumento As Date
If DDlCheques.SelectedValue.ToEntero = -1 Then
If DDlCheques.SelectedValue.ToEntero = -1 And Not ChkReembolsarSinBancos.Checked Then
FechaDocumento = TxtFechaDocumento.Text.ToDate
Else
FechaDocumento = TxtFechaPrePoliza.Text.ToDate
End If
Dim AnioFactura As Integer = FechaFactura.Year
Dim MesFactura As Integer = FechaFactura.Month
Dim AnioDocumento As Integer = FechaDocumento.Year

View File

@@ -92,6 +92,7 @@ Partial Class Compras_RepCxP
If Not Page.IsPostBack Then
CargaCombos()
CargaGvPersonalizarRaqngoColumnas()
ProcesaRequest()
CargaDatos()
If UsuarioActual.CveRol = 1 Then
@@ -101,6 +102,36 @@ Partial Class Compras_RepCxP
End Sub
#Region "CARGAS"
Private Sub ProcesaRequest()
If Request("FechaInicio") IsNot Nothing AndAlso IsDate(Request("FechaInicio")) Then
txtFechaI.Text = Request("FechaInicio")
End If
If Request("FechaFin") IsNot Nothing AndAlso IsDate(Request("FechaFin")) Then
txtFechaF.Text = Request("FechaFin")
End If
If Request("TipoDocto") IsNot Nothing AndAlso Request("TipoDocto").Length > 0 Then
Dim tipodoctos As String() = Request("TipoDocto").Split(","c)
For Each itemTipoDocto As ListItem In DdlTipoDocto.Items
For Each tipoDocto As String In tipodoctos
itemTipoDocto.Selected = (tipoDocto.ToUpper = itemTipoDocto.Value.ToUpper)
Next
Next
End If
If Request("CveMoneda") IsNot Nothing AndAlso Request("CveMoneda").ToEntero <> 0 Then
DdlMoneda.SelectedValueExist(Request("CveMoneda").ToEntero)
End If
If Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero <> 0 Then
DdlSubProyecto.SelectedValueExist(Request("CveSubProyecto").ToEntero)
End If
End Sub
Private Sub CargaCombos()
If (UsuarioActual.Empresa.Funcionalidad(105) = "1") Then

View File

@@ -31,6 +31,7 @@ public partial class Compras_RepPagado : ClsPaginas
if (!IsPostBack)
{
InicializaValores();
ProcesaRequest();
}
}
@@ -73,6 +74,50 @@ public partial class Compras_RepPagado : ClsPaginas
TxtFechaFCompra.Text = DateTime.Now.ToShortDateString();
}
private void ProcesaRequest()
{
if (DateTime.TryParse(Request["FechaInicio"], out DateTime fechaInicio))
{
txtFechaI.Text = fechaInicio.ToString("yyyy-MM-dd");
}
if (DateTime.TryParse(Request["FechaFin"], out DateTime fechaFin))
{
txtFechaF.Text = fechaFin.ToString("yyyy-MM-dd");
}
//if (Request["TipoDocto"] != null && Request["TipoDocto"].Length > 0)
//{
// string[] tipodoctos = Request["TipoDocto"].Split(',');
// foreach (ListItem itemTipoDocto in DdlTipoDocto.Items)
// {
// foreach (string tipoDocto in tipodoctos)
// {
// itemTipoDocto.Selected = tipoDocto.ToUpper() == itemTipoDocto.Value.ToUpper();
// }
// }
//}
if (Request["CveMoneda"] != null && Request["CveMoneda"].ToEntero() != 0)
{
DdlMoneda.SelectedValueExist(Request["CveMoneda"].ToEntero());
}
if (Request["CveSubProyecto"] != null && Request["CveSubProyecto"].ToEntero() != 0)
{
DdlSubProyecto.SelectedValueExist(Request["CveSubProyecto"].ToEntero());
}
if ((DateTime.TryParse(Request["FechaInicio"], out DateTime fechaInicio2)) && (DateTime.TryParse(Request["FechaFin"], out DateTime fechaFin2)))
{
CargaDatos();
}
}
private void CargaCuentasBancarias()
{
DdlCuentaBancaria.Items.Clear();

View File

@@ -91,20 +91,56 @@ Partial Class RepCxC
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Index = 0
Modalidad = ""
CargaCombos()
CargaGvPersonalizarRaqngoColumnas()
ProcesaRequest()
CargaDatos()
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then ChkAnticipos.Visible = True
ActivaEnviarEstadoCuenta()
If UsuarioActual.CveRol = 1 Or UsuarioActual.TienePermisoProceso(243) Then LnkDescargarSegmentos.Visible = True
End If
End Sub
#Region "CARGAS"
Private Sub ProcesaRequest()
If Request("FechaInicio") IsNot Nothing AndAlso IsDate(Request("FechaInicio")) Then
txtFechaI.Text = Request("FechaInicio")
End If
If Request("FechaFin") IsNot Nothing AndAlso IsDate(Request("FechaFin")) Then
txtFechaF.Text = Request("FechaFin")
End If
If Request("TipoDocto") IsNot Nothing AndAlso Request("TipoDocto").Length > 0 Then
Dim tipodoctos As String() = Request("TipoDocto").Split(","c)
For Each itemTipoDocto As ListItem In DdlTipoDocto.Items
For Each tipoDocto As String In tipodoctos
itemTipoDocto.Selected = (tipoDocto.ToUpper = itemTipoDocto.Value.ToUpper)
Next
Next
End If
If Request("CveMoneda") IsNot Nothing AndAlso Request("CveMoneda").ToEntero <> 0 Then
DdlMoneda.SelectedValueExist(Request("CveMoneda").ToEntero)
End If
If Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero <> 0 Then
DdlSubProyecto.SelectedValueExist(Request("CveSubProyecto").ToEntero)
End If
End Sub
Private Sub CargaCombos()
'CargaClientes
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns:cl="http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition">
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="DataSet">
@@ -65,6 +65,10 @@
<DataField>Valor</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Disponible">
<DataField>Disponible</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DataSet</rd:DataSetName>
@@ -811,7 +815,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -823,7 +826,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Cantidad.Value</Value>
<Value>=Fields!Disponible .Value</Value>
<Style>
<FontSize>7pt</FontSize>
<FontWeight>=IIf(Fields!PS.Value = "", "Bold", "Default")</FontWeight>
@@ -1612,7 +1615,6 @@
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>40c94aad-a12a-44fb-ab0d-ea36a9656792</rd:ReportID>
</Report>

View File

@@ -669,7 +669,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0"></asp:TextBox>
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" style="text-align:right"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>

View File

@@ -1576,6 +1576,14 @@ Partial Class Inventarios_TraspasoAlmacen
End If
e.Row.FCTextBox("TxtSerie").ReadOnly = True
'If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
If UsuarioActual.CveEmpresa = 141 Then
e.Row.FCTextBox("TxtCantidad").Enabled = False
e.Row.FCTextBox("TxtCantidad").Text = e.Row.DataKey("Cantidad").ToDecimal.ToString("#,###.######")
e.Row.FCCheckBox("Chk").Enabled = False
e.Row.FCCheckBox("Chk").Checked = True
End If
End If
'FUNCIONALIDAD PISTOLA DE CODIGOS
@@ -1586,6 +1594,11 @@ Partial Class Inventarios_TraspasoAlmacen
End If
End If
End If
End Sub
@@ -3388,3 +3401,4 @@ End Class

View File

@@ -821,7 +821,7 @@
<i class="fa fa-user font-yellow-gold"></i>
<span class="caption-subject bold font-black uppercase">Trabajador : </span>
<asp:Label ID="LblCodigoEmpleado" runat="server"></asp:Label>
<asp:HyperLink ID="LblEmpleado" runat="server" Text=""></asp:HyperLink>
<asp:HyperLink ID="LblEmpleado" runat="server" CssClass="Texto" Text=""></asp:HyperLink>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
@@ -3348,7 +3348,7 @@
</div>
<div id="DModalNominas" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpCargarNomina" class="modal-dialog" tabindex="-1" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpCargarNomina" class="modal-dialog modal-lg" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content rowpadding">
<div class="modal-header">
@@ -3359,26 +3359,13 @@
</div>
<div class="modal-body">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Paso 1: Descargar plantilla</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding " id="showConceptos">
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-10">
<div class="portlet light smmallpadding bordered">
<div class="row">
<div class="col-md-8">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-download font-green"></i>
<span class="caption-subject bold uppercase">Conceptos</span>
<span class="caption-subject bold uppercase">Paso 1: Descargar plantilla Conceptos</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
@@ -3414,11 +3401,30 @@
<asp:LinkButton ID="LnkFormato" OnClick="LnkFormato_Click" CssClass="btn btn-success" runat="server"><i class="fa fa-download"></i> Descargar Plantilla</asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-upload font-green"></i>
<span class="caption-subject bold uppercase">Paso 2: cargar plantilla </span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding ">
<asp:TextBox ID="TxtArchivoNomina" CssClass="ADSdropzone hidden" runat="server"></asp:TextBox>
</div>
</div>
<div class=" text-right">
<asp:CheckBox ID="ChkRecalcularNomina" Text="¿Volver a calcular la nómina?" runat="server" />
</div>
</div>
</div>
<%-- -recuerda Solo editar de las tercer fila en adelante.<br />
-No se debe editar el nombre de la hoja 'Nómina'.<br />
-la columna para referenciar al emplado es la primer columna 'Codigo', la columna empleado es solo es informativa.<br />
@@ -3426,23 +3432,7 @@
-si no desea insertar un concepto puede borrar la columna.<br />
-no se debe borrar la columna código.<br />--%>
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-upload font-green"></i>
<span class="caption-subject bold uppercase">Paso 2: cargar plantilla </span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body rowpadding ">
<asp:TextBox ID="TxtArchivoNomina" CssClass="ADSdropzone hidden" runat="server"></asp:TextBox>
</div>
</div>
<div class=" text-right">
<asp:CheckBox ID="ChkRecalcularNomina" Text="¿Volver a calcular la nómina?" runat="server" />
</div>
</div>

View File

@@ -1434,7 +1434,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
LogicNominas lognom = new LogicNominas();
string Msg = "";
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, UsuarioActual.Empresa.CvePAC);
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, CvePAC: UsuarioActual.Empresa.CvePAC);
if (Msg != null && Msg.Length > 0)
{
@@ -1707,7 +1707,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
//CURP = drow["CURP"].ToString();
}
string Msg = "";// lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, (UsuarioActual.CveUsuario == 100 ? 4 : 4));
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, versionTimbre: VersionTimbradoEnum.Version4_0);
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, CvePAC: UsuarioActual.Empresa.CvePAC, versionTimbre: VersionTimbradoEnum.Version4_0);
if (Msg != null && Msg.Length > 0)//<pre>{4}</pre><span style='display:none'>{1}</span>
{ Alert(string.Format("El empleado no se pudo timbrar, el sat nos devolvio el siguiente mensaje:<br/>{1}", Msg, msgCorregidoSat(Msg, CvePersonal, RFC, CURP)), TipoMensaje.MsgAdvertencia); }
@@ -1851,9 +1851,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
protected void BtnCancelarDocumento_Click(object sender, EventArgs e)
{
int CveNomina = CveNominaCancelar;
if (CveNomina > 0)
{

View File

@@ -45,7 +45,7 @@
<th colspan="5"></th>
</tr>
</table>
<asp:GridView ID="GvTurno" runat="server" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" CellSpacing="0" Width="100%" AutoGenerateColumns="False"
<asp:GridView ID="GvTurno" runat="server" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" CellSpacing="0" Width="100%" AutoGenerateColumns="False"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Turnos" data-tableheader="#thheader"
DataKeyNames="CveTurno,Turno,CveChecadorHorario,HorarioDe,DiaDescanso,HorarioA,Comida,ComidaDe,ComidaA,Estatus,FechaIng,CveUsuario,CveEmpresa,Usuario,ChecadorHorario,ToleranciaERetardo,ToleranciaEFalta,ToleranciaEFalta2,ToleranciaSRetardo,ToleranciaSFalta">
<Columns>

View File

@@ -550,7 +550,7 @@
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList Width="100%" ID="DdlJornada" runat="server" AppendDataBoundItems="True" DataTextField="Jornada" DataValueField="CveJornada" CssClass="form-control input-sm select2me" ValidationGroup="GrpGuardar">
<asp:DropDownList Width="100%" ID="DdlJornada" runat="server" AppendDataBoundItems="True" DataTextField="ClaveJornada" DataValueField="CveJornada" CssClass="form-control input-sm select2me" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Label AssociatedControlID="DdlJornada" runat="server" Text="Jornada:"></asp:Label>
@@ -3065,6 +3065,7 @@
</asp:DropDownList>
</div>
</div>
<div class="col-md-6">
<div class="">
<asp:Label runat="server" AssociatedControlID="DdlVacPeriodo" Style="padding-bottom: 0px; margin-bottom: 0px; font-size: 12px; color: #888; font-weight: 400;" >Periodo</asp:Label><br />
@@ -3076,9 +3077,9 @@
</div>
</div>
</div>
<asp:Panel runat="server" ID="PnlVacfechas" CssClass="row">
<asp:Panel runat="server" CssClass="row">
<div class="col-md-3">
<div class="col-md-3" runat="server" id="PnlVacfechas" >
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px !important">
@@ -3106,7 +3107,7 @@
</asp:Panel>
<div class="col-md-3" style="max-height:58px!important">
<div class="col-md-3" style="max-height:58px!important" runat="server" id="PnlVacfechas2">
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px !important">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
<asp:TextBox ID="TxtFechaFinVac" runat="server" CausesValidation="true" CssClass="form-control input-sm" ClientIDMode="Static" onblur="calculaFechasVacacionesFechaFin()"></asp:TextBox>
@@ -3122,8 +3123,8 @@
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright calendarlinealinput form-small">
<div class="col-md-3" runat="server" id="PnlVacDiasFeriados">
<div class="form-group form-md-line-input input-iconright calendarlinealinput form-small" >
<asp:TextBox ID="Txtdiasinabiles" runat="server" TextMode="Number" CausesValidation="true" CssClass="form-control input-sm form-small" ClientIDMode="Static" Style="margin-top: 20px!important"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="Txtdiasinabiles" Style="margin-top: 10px!important">Días feriados</asp:Label>
</div>
@@ -3133,9 +3134,9 @@
</asp:Panel>
<asp:Panel runat="server" ID="PnlVacDias" CssClass="row">
<asp:Panel runat="server" CssClass="row">
<div class="col-md-6">
<div class="col-md-6" runat="server" ID="PnlVacDias" >
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px !important">
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
@@ -4824,10 +4825,13 @@
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtNumeroCuenta" runat="server"></asp:TextBox>
<asp:TextBox CssClass="form-control" ID="TxtNumeroCuenta" runat="server" CausesValidation="true"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtNumeroCuenta" Text="Cuenta:"></asp:Label>
<asp:RequiredFieldValidator ID="RFVNumeroCuenta" runat="server" InitialValue="-1" ControlToValidate="TxtNumeroCuenta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarBanco"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RFVNumeroCuenta" runat="server" ControlToValidate="TxtNumeroCuenta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarBanco"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RGVNumeroCuenta" ValidationExpression="^(?:\d{10}|\d{11}|\d{15}|\d{16}|\d{18})$" runat="server" ControlToValidate="TxtNumeroCuenta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> debe de tener una logitud de 10,11,15,16,18 caracteres." ValidationGroup="GrpAgregarBanco"></asp:RegularExpressionValidator>
<ajax:ValidatorCalloutExtender ID="VcoNumeroCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RFVNumeroCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VcoRGVNumeroCuenta" runat="server" HighlightCssClass="vco" TargetControlID="RGVNumeroCuenta" Width="300px"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">

View File

@@ -5457,37 +5457,42 @@ Partial Class RH_Personal
Protected Sub DdlFormapagovacaciones_SelectedIndexChanged(sender As Object, e As EventArgs)
PnlVacfechas.Visible = False
PnlVacfechas2.Visible = False
PnlVacDias.Visible = False
'PnlVacFechapago.Visible = False
PnlVacDiasPago.Visible = False
' PnlVacDiasPago.Visible = False
PnlVacChecks.Visible = False
TxtVacDiasPago.Text = "0"
PnlVacDiasFeriados.Visible = False
Select Case DdlFormapagovacaciones.SelectedValue.ToEntero()
Case 1
PnlVacfechas.Visible = True
PnlVacfechas2.Visible = True
PnlVacDias.Visible = True
'PnlVacFechapago.Visible = True
PnlVacDiasPago.Visible = True
PnlVacChecks.Visible = True
PnlVacDiasFeriados.Visible = True
Case 2
PnlVacfechas.Visible = True
PnlVacDias.Visible = True
PnlVacfechas2.Visible = True
PnlVacChecks.Visible = True
PnlVacDiasFeriados.Visible = True
Case 3
PnlVacfechas.Visible = True
PnlVacfechas2.Visible = True
PnlVacDias.Visible = True
PnlVacDiasPago.Visible = False
'PnlVacFechapago.Visible = True
PnlVacDiasFeriados.Visible = True
Case 4
' PnlVacFechapago.Visible = True
PnlVacDiasPago.Visible = True
PnlVacDias.Visible = True
PnlVacChecks.Visible = True
Case 5
PnlVacfechas.Visible = True
PnlVacfechas2.Visible = True
PnlVacDias.Visible = True
PnlVacDiasFeriados.Visible = True
Case 6
'PnlVacFechapago.Visible = True
PnlVacDiasPago.Visible = True
PnlVacDias.Visible = True
End Select
End Sub
#End Region

View File

@@ -417,10 +417,17 @@
<div class='portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom <%= clasegrid %>'>
<%--DataKeyNames="Periodo,Version CFDI,Version Nómina,UUID,UUIDs relacionados,Tipo relacion,Tipo nomina,Serie,Folio,Fecha emision,Fecha certificacion,Fecha cancelacion,Fecha pago,Fecha inicial pago,Fecha final pago,Dias pagados,RFC emisor,Razon emisor,Registro patronal,RFC receptor,Razon receptor,Fecha inicio relacion laboral,Tipo contrato,Tipo jornada,Tipo regimen,Num empleado,Antiguedad,Sindicalizado,ClaveEntFed,Banco,Cuenta bancaria,CURP,No Seguro social,Departamento,Puesto,Periodicidad pago,Salario base cot apor,Salario diario integrado,Estado"--%>
<asp:GridView ID="GVSolicitudTimbreNominaGral" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVSolicitudTimbreNominaGral" AutoGenerateColumns="true">
<Columns></Columns>
<asp:GridView ID="GVSolicitudTimbreNominaGral" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVSolicitudTimbreNominaGral" OnRowDataBound="GVSolicitudTimbreNominaGral_RowDataBound" AutoGenerateColumns="true">
<Columns>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:LinkButton runat="server" ID="BtnCancelar" OnClick="BtnCancelar_Click" Visible="false" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='fa fa-ban'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" ></asp:LinkButton>
<asp:CheckBox ID="ChkC" runat="server" Visible="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:LinkButton runat="server" ID="BtnCancelarMasivo" OnClick="BtnCancelarMasivo_Click" Visible="false" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='fa fa-ban'></i> Cancelar solo en SAT" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" ></asp:LinkButton>
</div>
</div>

View File

@@ -1,4 +1,5 @@
using System;
using DocumentFormat.OpenXml.Wordprocessing;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
@@ -10,7 +11,7 @@ using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using static Extensiones.ModExtensiones;
public partial class SAT_SolicitudesNominaSat : ClsPaginas
@@ -30,7 +31,7 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
{
get
{
if (ViewState["fechaInicio"] == null) { return ModExtensiones.MinFecha; }
if (ViewState["fechaInicio"] == null) { return MinFecha; }
else { return ViewState["fechaInicio"].ToString().ToDate(); }
}
set { ViewState["fechaInicio"] = value; }
@@ -39,7 +40,7 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
{
get
{
if (ViewState["fechaFin"] == null) { return ModExtensiones.MaxFecha; }
if (ViewState["fechaFin"] == null) { return MaxFecha; }
else { return ViewState["fechaFin"].ToString().ToDate(); }
}
set { ViewState["fechaFin"] = value; }
@@ -155,6 +156,16 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
if (DdlReporte.SelectedValue == "3")
{
GVSolicitudTimbreNominaGral.DataKeyNames = new string[] { "UUID", "RFCReceptor", "Total" };
BtnCancelarMasivo.Visible = true;
}
else
{
GVSolicitudTimbreNominaGral.DataKeyNames = null;
BtnCancelarMasivo.Visible = false;
}
nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin, DdlTipoNomina.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero());
GVSolicitudTimbreNominaGral.DataSource = nom.DtResultados;
@@ -221,7 +232,7 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
//RegistraScript("$('#DModalSolicitudesNominas').modal('hide');");
RegistraScript("$('#ModalAgregarSolicitud').modal('hide');");
cargasolicitudes();
Alert("se a envia la solicitud al sat, le enviaremos un correo en cuanto tengamos una respuesta", ModExtensiones.TipoMensaje.ToastInformacion);
Alert("se a envia la solicitud al sat, le enviaremos un correo en cuanto tengamos una respuesta", TipoMensaje.ToastInformacion);
}
}
@@ -234,6 +245,60 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
cargasolicitudes();
}
protected void BtnCancelar_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
string FolioFiscal = GvRow.DataKey("UUID");
string RFCReceptor = GvRow.DataKey("RFCReceptor");
decimal Total = GvRow.DataKey("Total").ToDecimal();
int CveMotivoCancelacion = 3; // no se llevó a cabo //get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltroPrimeroValor ("CveMotivoCancelacion", "CveSATMotivoCancelacion IN (2,3)").ToEntero();
Timbrado ObjTimbrado = new Timbrado();
var resultado = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, 4, CveSATMotivoCancelacion: CveMotivoCancelacion);
if (resultado != null)
{
Alert("Folio Fiscal Cancelado", TipoMensaje.MsgInformacion);
}
}
protected void BtnCancelarMasivo_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
foreach (GridViewRow GvRow in GVSolicitudTimbreNominaGral.Rows)
{
if (GvRow.FCCheckBox("ChkC").Checked)
{
string FolioFiscal = GvRow.DataKey("UUID");
string RFCReceptor = GvRow.DataKey("RFCReceptor");
decimal Total = GvRow.DataKey("Total").ToDecimal();
int CveMotivoCancelacion = 3; // no se llevó a cabo //get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltroPrimeroValor ("CveMotivoCancelacion", "CveSATMotivoCancelacion IN (2,3)").ToEntero();
Timbrado ObjTimbrado = new Timbrado();
var resultado = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC, 4, CveSATMotivoCancelacion: CveMotivoCancelacion);
if (resultado != null)
{
GvRow.FCCheckBox("ChkC").Checked = false;
sb.AppendFormat("UUID: {0}<br/>", FolioFiscal);
}
}
}
if (sb.Length > 0)
{
Alert("Folios Cancelados: <br/><br/>" + sb.ToString() , TipoMensaje.MsgInformacion);
}
}
protected void GVSolicitudTimbreNominaGral_RowDataBound(object sender, GridViewRowEventArgs e)
{
//solo cuando es vista por recibo, y que no esté en sig
if (DdlReporte.SelectedValue == "3" && e.Row.RowType == DataControlRowType.DataRow && e.Row.DBCampo("SIG") =="NO")
{
//e.Row.FCLinkButton("BtnCancelar").Visible = true;
e.Row.FCCheckBox("ChkC").Visible = true;
}
}
}
public class GeneralesAPI : ADSNetLibrary.Helpers.Conexiones.SIGAPI.BaseSIGAPI

View File

@@ -1653,9 +1653,7 @@
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:Button ID="BtnOrdenaArchivos" CssClass="btn btn-info" runat="server" Text="Ordena Archivos" />
<asp:Button ID="BtnMandaMail" runat="server" CssClass="btn btn-info" Text="Manda Mail" />
<div class="portlet-body">
<asp:Label ID="Lbl" runat="server" Text=""></asp:Label>
<br />
<br />

1049
Sistemas/Empresa2.aspx Normal file

File diff suppressed because it is too large Load Diff

2048
Sistemas/Empresa2.aspx.vb Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -76,7 +76,7 @@
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="0" />
<div>
<asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False"
DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto,CveCuentaAsignacionGasto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto,CveCuentaAsignacionGasto, CveCuentaGasto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Clasificación">
<ItemTemplate>
@@ -233,13 +233,13 @@
</div>
<div class="form-group input-iconright" id="DivCuentaCostos" runat="server">
<div class="form-group input-iconright" id="DivCuentaCostos" visible="false" runat="server">
<label for="<%= DdlCuentaCostos.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Costos:</label>
<asp:DropDownList ID="DdlCuentaCostos" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList>
</div>
<div class="form-group input-iconright" id="DivCuentaIngresos" runat="server">
<div class="form-group input-iconright" id="DivCuentaIngresos" visible="false" runat="server">
<label for="<%= DdlCuentaIngresos.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Ingresos:</label>
<asp:DropDownList ID="DdlCuentaIngresos" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList>
</div>

View File

@@ -109,25 +109,15 @@ Partial Class CatClasificaciones
End If
UpModalClasif.Update()
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
''COMENTADO DF 30 JUNIO 2017
'Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
'If Cuenta.GetCuentas(-1, "-1", 1, 20000) Then
' DtCuentas = Cuenta.DtResultados
'End If
'Cuenta.Dispose()
Else
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
DivCuentaIngresos.Visible = False
DivCuentaCostos.Visible = False
DivCuentaGasto.Visible = False
GvDatos.Columns(1).Visible = False
GvDatos.Columns(2).Visible = False
GvDatos.Columns(3).Visible = False
End If
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
DivCuentaIngresos.Visible = False
DivCuentaCostos.Visible = False
'DivCuentaGasto.Visible = False
' GvDatos.Columns(1).Visible = False
GvDatos.Columns(2).Visible = False
GvDatos.Columns(3).Visible = False
End If
DdlCuentaGasto.Items.Insert(0, New ListItem("-", "-1"))
@@ -174,6 +164,7 @@ Partial Class CatClasificaciones
If DdlCuentaCostos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(69, UsuarioActual.CveEmpresa, DdlCuentaCostos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
If DdlCuentaIngresos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(4, UsuarioActual.CveEmpresa, DdlCuentaIngresos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
End If
ObjClasificaciones.Commit()
TxtClasificacion.Text = ""
TxtPrecioBaseCosto.Text = ""
DdlCuentaGasto.SelectedValueExist("0")
@@ -181,6 +172,9 @@ Partial Class CatClasificaciones
DdlCuentaIngresos.SelectedValueExist("0")
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al agregar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
ObjClasificaciones.RollBack()
End If
ElseIf HdnModalidadClasificacion.Value = "U" Then
@@ -226,14 +220,12 @@ Partial Class CatClasificaciones
DdlCuentaGasto.DataValueField = "CveCuenta"
DdlCuentaGasto.DataTextField = "Cuenta"
Dim ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
DtCuentasContables = ObjContabilidad.DtResultados
'Cuenta, CtaCodigo
DtCuentasContables.Columns("CtaCodigo").ColumnName = "Cuenta"
End If
ObjContabilidad.Dispose()
ElseIf UsuarioActual.Empresa.TipoContabilidad = 1 Then
DtCuentasContables = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1)
'Cuenta, CtaCodigo
DtCuentasContables.Columns("CtaCodigo").ColumnName = "Cuenta"
ElseIf UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim ObjEmpresa As New ClsSisEmpresas
Dim Empresa As Empresa = Nothing
@@ -319,7 +311,7 @@ Partial Class CatClasificaciones
If e.Row.DBCampo("CuentaIngresos") = "Seleccione" Or e.Row.DBCampo("CuentaIngresos") = "" Then e.Row.FCLabel("LtlCuentaIngresos").Text = "-"
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If UsuarioActual.Empresa.UsaContabilidad Then
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
e.Row.FCLabel("LtlClasificacion").Text = String.Format("<a Class='Texto' href='/Ventas/CatClasificacionesDetalle.aspx?CveClasificacion={0}'>{1}</a>", e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("Clasificacion"))
End If
@@ -328,18 +320,15 @@ Partial Class CatClasificaciones
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
ObjClasificaciones.Dispose()
CargaGrid()
End Sub
@@ -420,7 +409,14 @@ Partial Class CatClasificaciones
If CuentaGasto.Length > 1 And CargaGastos Then
DdlCuentaGasto.Items.Insert(0, New ListItem(CuentaGasto, CveCuentaGastoActual.ToString))
DdlCuentaGasto.SelectedIndex = 0
CargaGastos = False
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
DdlCuentaGasto.Items.Clear() : DdlCuentaGasto.Items.Add(New ListItem("-", "-1"))
'DdlCuentaGasto.Text = ""
DdlCuentaGasto.DataSource = GlobalDTContaCuentasContables(UsuarioActual.CveEmpresa, Afectable:=1) : DdlCuentaGasto.DataBind()
DdlCuentaGasto.SelectedValueExist(GvRow.DataKey("CveCuentaGasto"))
End If
Else
DdlCuentaGasto.SelectedValueExist(CveCuentaGastoActual)
End If

View File

@@ -107,23 +107,37 @@ Partial Class Ventas_FacturacionAcarreos
ObjVentas.IniciaTransacSQL()
Dim TieneError As Boolean = False
Try
Dim DtPS As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
If dt.Rows.Count = 0 Then
TieneError = True
MsgFacturacionAcarreos.Append("No hay datos para procesar")
RowsNoCargados += 1
End If
For Each row As DataRow In dt.Rows
Dim msg As String = ObjVentas.AddFacturacionAcarreos(row("Sucursal").ToString(), row("RFC").ToString(), row("Cantidad").ToString().ToDecimal(), row("ProductoGeneral").ToString(),
row("Origen").ToString(), row("Destino").ToString(), row("FechaSalida").ToString().ToDateTime(), row("FechaLlegada").ToString().ToDateTime(),
row("Unidad").ToString(), row("Chofer").ToString(), row("Configuración").ToString(), row("Remolque1").ToString(), row("Remolque2").ToString(),
row("Distancia").ToString().ToDecimal(), UsuarioActual.CveEmpresa)
Dim FechaSalida As DateTime = MinFecha
Dim FechaLlegada As DateTime = MinFecha
If row("FechaSalida").ToString().ToDateTime() > FechaSalida Then
FechaSalida = row("FechaSalida").ToString().ToDateTime()
End If
If row("FechaLlegada").ToString().ToDateTime() > FechaLlegada Then
FechaLlegada = row("FechaLlegada").ToString().ToDateTime()
End If
Dim msg As String = ObjVentas.AddFacturacionAcarreos(row("Sucursal").ToString(), row("RFC").ToString(), row("Cantidad").ToString().ToDecimal(), row("ProductoGeneral").ToString(), row("Origen").ToString(),
row("Destino").ToString(), FechaSalida, FechaLlegada, row("Unidad").ToString(), row("Chofer").ToString(), row("Configuración").ToString(),
row("Remolque1").ToString(), row("Remolque2").ToString(), row("Distancia").ToString().ToDecimal(), UsuarioActual.CveEmpresa)
If msg = "Correcto" Then
RowsCargados += 1
Else
TieneError = True
MsgFacturacionAcarreos.AppendFormat("{0}", msg)
MsgFacturacionAcarreos.AppendFormat("Ocurrió un error al procesar la fila: {0}<br/>{1}", row("NoExcel"), msg)
RowsNoCargados += 1
Exit For
End If
Next
Catch ex As Exception
OnError("Ocurrió un error al cargar los precios.", ex)
OnError("Ocurrió un error al cargar los datos.", ex)
Finally
Dim MensajeFinal As New StringBuilder()
If RowsNoCargados = 0 AndAlso RowsCargados > 0 Then
@@ -147,7 +161,6 @@ Partial Class Ventas_FacturacionAcarreos
CargaDatos()
End If
End Sub
@@ -179,15 +192,21 @@ Partial Class Ventas_FacturacionAcarreos
End If
Next
dataTable.Columns.Add("NoExcel", GetType(String))
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
columns = New String(cols) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
For curCol = 0 To cols
If curCol = cols Then
columns(curCol) = worksheet.Rows(curRow).Name
Else
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
End If
Next

View File

@@ -0,0 +1,339 @@
<%@ Page Title="Indicadores por Proyecto" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadoresPorProyecto.aspx.vb" Inherits="Ventas_RepIndicadoresPorProyecto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.portlet-total {
float: right !important;
display: inline-block !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones">
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Indicadores por Proyecto
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content6" 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="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
</div>
<div class="titlefiltros caption">
<div class="row">
<asp:Label runat="server" ID="LblSubProyecto" class="col-md-1 truncate" style="text-align:right">Sucursal:</asp:Label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate" style="text-align:right" >Fecha Inicio:</label>
<div class="col-md-2" style="max-width: 140px;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</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="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 truncate" style="text-align:right">Fecha Fin:</label>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="85px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</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="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">CxC</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="caption font-green portlet-total">
<span id="SPResumenCxC" class="caption-subject bold uppercase" runat="server" />
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvResumenCxC" DataKeyNames="CveMoneda,Moneda,Cantidad,Saldo" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros especificados" ToolTip="Cuentas por Cobrar"
CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Moneda" DataField="Moneda" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">CxP</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="caption font-green portlet-total">
<span id="SPResumenCxP" class="caption-subject bold uppercase" runat="server" />
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvResumenCxP" DataKeyNames="CveMoneda,Moneda,Cantidad,Saldo" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros especificados" ToolTip="Cuentas por Pagar"
CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Moneda" DataField="Moneda" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cobrado</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="caption font-green portlet-total">
<span id="SPRepCobrado" class="caption-subject bold uppercase" runat="server" />
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvRepCobrado" DataKeyNames="CveMoneda,Cobrado" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros especificados" ToolTip="Cobrado"
CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Moneda" DataField="Moneda" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cobrado" DataField="Cobrado" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Pagado</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="caption font-green portlet-total">
<span id="SPRepPagado" class="caption-subject bold uppercase" runat="server" />
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvRepPagado" DataKeyNames="CveMoneda,Pagado" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros especificados" ToolTip="Pagado"
CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Moneda" DataField="Moneda" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Pagado" DataField="Pagado" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<div class="row" runat="server" id="DVMargenBruto" visible="false">
<div class="col-md-6" style="text-align:left;font-size:20px!important">
Margen Bruto: <asp:Label runat="server" ID="LblMargenBruto"></asp:Label> MXN
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ingresos Facturas</span>
</div>
<%-- <div class="actions">
<div class="btn-group">
<div class="row ">
<div class="col-md-12">
<input type="text" id="TxtGvRepIngresosFact" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtGvRepIngresosFact','{0}')", GvRepIngresosFact.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtGvRepIngresosFact','{0}')", GvRepIngresosFact.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>--%>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="caption font-green portlet-total">
<span id="SPRepIngresosFact" class="caption-subject bold uppercase" runat="server" />
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvRepIngresosFact" DataKeyNames="CveMoneda,Fecha" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros especificados" ToolTip="Cobrado"
CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Fecha" DataField="Fecha" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="SerieFolio" DataField="SerieFolio" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Importe" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="col-md-6">
<div class="portlet light xspadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Costos y Gastos</span>
</div>
<%--<div class="actions">
<div class="btn-group">
<div class="row ">
<div class="col-md-12">
<input type="text" id="TxtGvRepCostosGastos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtGvRepCostosGastos','{0}')", GvRepCostosGastos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtGvRepCostosGastos','{0}')", GvRepCostosGastos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
</div>--%>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="caption font-green portlet-total">
<span id="SPRepCostosGastos" class="caption-subject bold uppercase" runat="server" />
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvRepCostosGastos" DataKeyNames="CveMoneda,CveClasificacion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos con los filtros especificados" ToolTip="Pagado"
CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Clasificación" DataField="Clasificacion" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Importe" DataFormatString="{0:###,###,##0.00}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,204 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Imports ADSNetLibrary.SIGAPI.Services.Generales
Imports ADSNetLibrary.SIGAPI.Models.Generales.Request
Imports ADSNetLibrary.SIGAPI.Models.Generales.Response
Imports MoreLinq
Partial Class Ventas_RepIndicadoresPorProyecto
Inherits ClsPaginas
#Region "Propiedades"
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
InicializaValores()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
txtFechaI.Text = FirstDayOfMonth(Now).ToShortDateString
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
If Not IsDate(txtFechaI.Text) Then
Alert("La fecha inicial no es valida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Not IsDate(txtFechaF.Text) Then
Alert("La fecha final no es valida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
GvResumenCxC.DataSource = Nothing
GvResumenCxP.DataSource = Nothing
GvRepCobrado.DataSource = Nothing
GvRepPagado.DataSource = Nothing
GvRepIngresosFact.DataSource = Nothing
GvRepCostosGastos.DataSource = Nothing
Dim gralService = New GeneralesService(System.Configuration.ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
Dim DatResumenCxC = gralService.GetResumenCxC(New RequestResumenCxC() With {.tipoDocto = "Ing",
.cveUsuario = UsuarioActual.CveUsuario,
.cveEmpresa = UsuarioActual.CveEmpresa,
.cveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero,
.fechaInicial = txtFechaI.Text,
.fechaFinal = txtFechaF.Text})
Dim DatResumenCxP = gralService.GetResumenCxP(New RequestResumenCxP() With {.tipoDocto = "Fac",
.cveUsuario = UsuarioActual.CveUsuario,
.cveEmpresa = UsuarioActual.CveEmpresa,
.cveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero,
.fechaInicial = txtFechaI.Text,
.fechaFinal = txtFechaF.Text})
Dim DatRepCobrado = gralService.RepCobrado(New RequestRepCobrado() With {.tipoDocto = "Ing",
.cveUsuario = UsuarioActual.CveUsuario,
.cveEmpresa = UsuarioActual.CveEmpresa,
.cveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero,
.fechaInicial = txtFechaI.Text,
.fechaFinal = txtFechaF.Text})
Dim DatRepPagado = gralService.RepPagado(New RequestRepPagado() With {.tipoDocto = "Fac",
.cveUsuario = UsuarioActual.CveUsuario,
.cveEmpresa = UsuarioActual.CveEmpresa,
.cveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero,
.fechaInicial = txtFechaI.Text,
.fechaFinal = txtFechaF.Text})
Dim DatRepIngresosFact = gralService.RepIngresosFact(New RequestRepIngresosFact() With {.tipoDocto = "Ing",
.cveUsuario = UsuarioActual.CveUsuario,
.cveEmpresa = UsuarioActual.CveEmpresa,
.cveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero,
.fechaInicial = txtFechaI.Text,
.fechaFinal = txtFechaF.Text})
Dim DatRepCostosGastos = gralService.RepCostosGastos(New RequestRepCostosGastos() With {.tipoDocto = "Fac",
.cveUsuario = UsuarioActual.CveUsuario,
.cveEmpresa = UsuarioActual.CveEmpresa,
.cveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero,
.fechaInicial = txtFechaI.Text,
.fechaFinal = txtFechaF.Text})
If DatResumenCxC.Result.Count > 0 Then
GvResumenCxC.DataSource = DatResumenCxC.Result.ToDataTable
SPResumenCxC.InnerText = $"Total: {DatResumenCxC.Result.ToDataTable.SUMD("saldoMN").ToString("###,###,###.00")} MXN"
End If
If DatResumenCxP.Result.Count > 0 Then
GvResumenCxP.DataSource = DatResumenCxP.Result.ToDataTable
SPResumenCxP.InnerText = $"Total: {DatResumenCxP.Result.ToDataTable.SUMD("saldoMN").ToString("###,###,###.00")} MXN"
End If
If DatRepCobrado.Result.Count > 0 Then
GvRepCobrado.DataSource = DatRepCobrado.Result.ToDataTable
SPRepCobrado.InnerText = $"Total: {DatRepCobrado.Result.ToDataTable.SUMD("cobradoMN").ToString("###,###,###.00")} MXN"
End If
If DatRepPagado.Result.Count > 0 Then
GvRepPagado.DataSource = DatRepPagado.Result.ToDataTable
SPRepPagado.InnerText = $"Total: {DatRepPagado.Result.ToDataTable.SUMD("pagadoMN").ToString("###,###,###.00")} MXN"
End If
If DatRepIngresosFact.Result.Count > 0 Then
GvRepIngresosFact.DataSource = DatRepIngresosFact.Result.ToDataTable.FiltraParametros("nRow <= 50")
SPRepIngresosFact.InnerText = $"Total: {DatRepIngresosFact.Result.ToDataTable.SUMD("importeMN").ToString("###,###,###.00")} MXN"
End If
If DatRepCostosGastos.Result.Count > 0 Then
GvRepCostosGastos.DataSource = DatRepCostosGastos.Result.ToDataTable.FiltraParametros("nRow <= 50")
SPRepCostosGastos.InnerText = $"Total: {DatRepCostosGastos.Result.ToDataTable.SUMD("importeMN").ToString("###,###,###.00")} MXN"
End If
LblMargenBruto.Text = $"{(DatRepIngresosFact.Result.ToDataTable.SUMD("importeMN") - DatRepCostosGastos.Result.ToDataTable.SUMD("importeMN")).ToString("###,###,###.00")}"
GvResumenCxC.DataBind()
GvResumenCxP.DataBind()
GvRepCobrado.DataBind()
GvRepPagado.DataBind()
GvRepIngresosFact.DataBind()
GvRepCostosGastos.DataBind()
DVMargenBruto.Visible = True
UpDatos.Update()
End Sub
Private Sub GvResumenCxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvResumenCxC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim liga As String = $"../CxC/RepCxC.aspx?CveSubProyecto={DdlSubProyecto.SelectedValue}&FechaInicio={txtFechaI.Text}&FechaFin={txtFechaF.Text}&CveMoneda={e.Row.DataKey("CveMoneda")}&TipoDocto=Ing"
e.Row.Cells(0).Text = $"<a target='_blank' href='{liga}'>{e.Row.Cells(0).Text}</a>"
e.Row.Cells(1).Text = $"<a target='_blank' href='{liga}' >{e.Row.Cells(1).Text}</a>"
e.Row.Cells(2).Text = $"<a target='_blank' href='{liga}'>{e.Row.Cells(2).Text}</a>"
End If
End Sub
Private Sub GvResumenCxP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvResumenCxP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim liga As String = $"../Compras/RepCxP.aspx?CveSubProyecto={DdlSubProyecto.SelectedValue}&FechaInicio={txtFechaI.Text}&FechaFin={txtFechaF.Text}&CveMoneda={e.Row.DataKey("CveMoneda")}&TipoDocto=Fac"
e.Row.Cells(0).Text = $"<a target='_blank' href='{liga}'>{e.Row.Cells(0).Text}</a>"
e.Row.Cells(1).Text = $"<a target='_blank' href='{liga}' >{e.Row.Cells(1).Text}</a>"
e.Row.Cells(2).Text = $"<a target='_blank' href='{liga}'>{e.Row.Cells(2).Text}</a>"
End If
End Sub
Private Sub GvRepCobrado_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRepCobrado.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim liga As String = $"../Ventas/RepRecuperacion.aspx?CveSubProyecto={DdlSubProyecto.SelectedValue}&FechaInicio={txtFechaI.Text}&FechaFin={txtFechaF.Text}&CveMoneda={e.Row.DataKey("CveMoneda")}&TipoDocto=Ing"
e.Row.Cells(0).Text = $"<a target='_blank' href='{liga}'>{e.Row.Cells(0).Text}</a>"
e.Row.Cells(1).Text = $"<a target='_blank' href='{liga}' >{e.Row.Cells(1).Text}</a>"
End If
End Sub
Private Sub GvRepPagado_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRepPagado.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim liga As String = $"../Compras/RepPagado.aspx?CveSubProyecto={DdlSubProyecto.SelectedValue}&FechaInicio={txtFechaI.Text}&FechaFin={txtFechaF.Text}&CveMoneda={e.Row.DataKey("CveMoneda")}&TipoDocto=Fac"
e.Row.Cells(0).Text = $"<a target='_blank' href='{liga}'>{e.Row.Cells(0).Text}</a>"
e.Row.Cells(1).Text = $"<a target='_blank' href='{liga}' >{e.Row.Cells(1).Text}</a>"
End If
End Sub
Private Sub GvRepIngresosFact_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRepIngresosFact.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DataKey("Fecha").ToString.Trim = "01/01/0001 12:00:00 a. m." Then
e.Row.CssClass = "Totales"
e.Row.Cells(0).Text = ""
End If
End If
End Sub
Private Sub GvRepCostosGastos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRepCostosGastos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DataKey("CveClasificacion").ToString.Trim.ToEntero = 0 Then
e.Row.CssClass = "Totales"
End If
End If
End Sub
#End Region
#Region " GV DATOS "
#End Region
End Class

View File

@@ -54,8 +54,11 @@
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgImprimir" runat="server" Enabled="true"> <i class="fa fa-file-pdf-o"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Generar</asp:LinkButton>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
</li>
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
@@ -63,9 +66,7 @@
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<li>
<asp:LinkButton ID="ImgImprimir" runat="server" Enabled="true"> <i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>

View File

@@ -249,7 +249,19 @@
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem>
<asp:ListItem Text="Contado" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">
Moneda:
</div>
<div class="col-md-2 truncate">
<asp:DropDownList ID="DdlMoneda" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Pesos" Value="1"></asp:ListItem>
<asp:ListItem Text="Dolares" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -48,12 +48,51 @@ Partial Class Ventas_RepRecuperacion
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
'CargaDatos()
ProcesaRequest()
'CargaDatos()
End If
End Sub
End Sub
#Region "CARGAS"
Private Sub ProcesaRequest()
If Request("FechaInicio") IsNot Nothing AndAlso IsDate(Request("FechaInicio")) Then
txtFechaI.Text = Request("FechaInicio")
End If
If Request("FechaFin") IsNot Nothing AndAlso IsDate(Request("FechaFin")) Then
txtFechaF.Text = Request("FechaFin")
End If
If Request("TipoDocto") IsNot Nothing AndAlso Request("TipoDocto").Length > 0 Then
Dim tipodoctos As String() = Request("TipoDocto").Split(","c)
For Each itemTipoDocto As ListItem In DdlTipoDocto.Items
For Each tipoDocto As String In tipodoctos
itemTipoDocto.Selected = (tipoDocto.ToUpper = itemTipoDocto.Value.ToUpper)
Next
Next
End If
If Request("CveMoneda") IsNot Nothing AndAlso Request("CveMoneda").ToEntero <> 0 Then
DdlMoneda.SelectedValueExist(Request("CveMoneda").ToEntero)
End If
If Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero <> 0 Then
DdlSubProyecto.SelectedValueExist(Request("CveSubProyecto").ToEntero)
End If
UPFiltros.Update()
If IsDate(txtFechaF.Text) AndAlso IsDate(txtFechaF.Text) Then
CargaDatos()
End If
End Sub
Private Sub CargaCombos()
'Carga Clientes
If (UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1") Then
@@ -138,7 +177,8 @@ Partial Class Ventas_RepRecuperacion
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero,
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero) Then
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero,
CveMoneda:=DdlMoneda.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjMovtos.DtResultados
DtDatos = ObjMovtos.DtResultados
Else

View File

@@ -60,7 +60,8 @@
<asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel Personalizado</asp:LinkButton>
</li>
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink>
<%--<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink>--%>
<asp:LinkButton ID="LnkPersonalizar" OnClick="LnkPersonalizar_Click" runat="server"><i class="fa fa-pencil"></i>Personalizar Columnas</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="BtnDescargarPDF" runat="server"> <i class="fa fa-download"></i> Descarga PDFs</asp:LinkButton>
@@ -332,178 +333,226 @@
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" data-sort="true" Width="99%" DataKeyNames="CveVenta,TipoDocumento,SerieFolio" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<%-- 0--%>
<asp:TemplateField HeaderText="Tipo Docto">
<ItemTemplate>
<asp:Literal ID="LtlTipo" runat="server" Text='<%# Eval("TipoDocumento") %>'></asp:Literal>
<asp:HiddenField ID="HdnTipo" runat="server" Value='<%# Eval("TipoDocumento") %>' />
</ItemTemplate>
</asp:TemplateField>
<%-- 1--%>
<asp:TemplateField HeaderText="Folio" ItemStyle-Width="100px">
<ItemTemplate>
<asp:Literal ID="LtlFolio" runat="server" Text='<%# Eval("SerieFolio") %>'></asp:Literal>
<asp:HiddenField ID="HdnFolio" runat="server" Value='<%# Eval("SerieFolio") %>' />
</ItemTemplate>
</asp:TemplateField>
<%-- 2--%>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 3--%>
<asp:TemplateField HeaderText="Cliente" Visible="True">
<ItemTemplate>
<asp:Literal ID="LtlCliente" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 4--%>
<asp:TemplateField HeaderText="SubTotal" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlSubTotal" runat="server" Text='<%# Eval("SubTotal", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 5--%>
<asp:TemplateField HeaderText="Descuento" Visible="True" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlDescuento" runat="server" Text='<%# Eval("Descuento", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 6--%>
<asp:TemplateField HeaderText="Motivo Descuento" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlMotivoDescuento" runat="server" Text='<%# Eval("MotivoDescuento", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 7--%>
<asp:TemplateField HeaderText="Amortización" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlAmortizacion" runat="server" Text='<%# Eval("Amortizacion", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 8--%>
<asp:TemplateField HeaderText="IVA" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlIVA" runat="server" Text='<%# Eval("IVA", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 9--%>
<asp:TemplateField HeaderText="IEPS" Visible="false" ItemStyle-HorizontalAlign="Right" >
<ItemTemplate>
<asp:Literal ID="LtlIEPS" runat="server" Text='<%# Eval("IEPS", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 10--%>
<asp:TemplateField HeaderText="Ret. IVA" Visible="false" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlRetIVA" runat="server" Text='<%# Eval("RetIVA", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 11--%>
<asp:TemplateField HeaderText="Ret. ISR" Visible="false" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlRetISR" runat="server" Text='<%# Eval("RetISR", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 12--%>
<asp:TemplateField HeaderText="Imp. Locales" Visible="false" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlImpLocales" runat="server" Text='<%# Eval("TotalImpuestos", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 13--%>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 14--%>
<asp:TemplateField HeaderText="Mon">
<ItemTemplate>
<asp:Literal ID="LtlMon" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 15--%>
<asp:TemplateField HeaderText="Sucursal" Visible="True">
<ItemTemplate>
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 16--%>
<asp:TemplateField HeaderText="Suc Ejecución" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlSucursalE" runat="server" Text='<%# Eval("SubProyectoEjecucion", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 17--%>
<asp:TemplateField HeaderText="Código Cliente" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlCodCliente" runat="server" Text='<%# Eval("Codigo", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 18--%>
<asp:TemplateField HeaderText="Sucursal Cliente" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlSucCliente" runat="server" Text='<%# Eval("SucursalCliente", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 19--%>
<asp:TemplateField HeaderText="Suc Cobranza" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlSucCobranza" runat="server" Text='<%# Eval("SubProyectoCobranza", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 20--%>
<asp:TemplateField HeaderText="Sucursal Ejecución" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlSucServicio" runat="server" Text='<%# Eval("SubProyectoEjecucion", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 21--%>
<asp:TemplateField HeaderText="Vendedor" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 22--%>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Literal ID="LtlEstatusFactura" runat="server" Text='<%# Eval("EstatusFactura", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 23--%>
<asp:TemplateField HeaderText="Motivo Cancelación" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlMotivoCancelacion" runat="server" Text='<%# Eval("MotivoCancelacion", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 24--%>
<asp:TemplateField Visible="false" HeaderText="Se Timbró">
<ItemTemplate>
<asp:Literal ID="LtlSeTimbro" runat="server" Text='<%# Eval("SeTimbro") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 25--%>
<asp:TemplateField Visible="false" HeaderText="Se envió Mail">
<ItemTemplate>
<asp:Literal ID="LtlSeEnvioMail" runat="server" Text='<%# Eval("EnvioMail") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 26--%>
<asp:TemplateField HeaderText="Cuenta Contable" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlCtaContable" runat="server" Text='<%# Eval("CuentaContable") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 27--%>
<asp:TemplateField HeaderText="Usuario" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 28--%>
<asp:TemplateField HeaderText="Observaciones" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlObservaciones" runat="server" Text='<%# Eval("Observaciones", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 29--%>
<asp:TemplateField HeaderText="Folio Fiscal (UUID)" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlFolioFiscal" runat="server" Text='<%# Eval("FolioFiscal") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 30--%>
<asp:TemplateField HeaderText="Mail Cliente" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlMailCliente" runat="server" Text='<%# Eval("MailCliente") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 31--%>
<asp:TemplateField HeaderText="Estatus Facturación" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlEstatusFacturacion" runat="server" Text='<%# Eval("EstatusCot") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 32--%>
<asp:TemplateField HeaderText="Factura de Cotización" Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlFacturaCotizacion" runat="server" Text='<%# Eval("FolioVenta") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 33--%>
<asp:TemplateField HeaderText="Saldo" Visible="false" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 34--%>
<asp:TemplateField HeaderText="Orden Compra" Visible="false">
<ItemTemplate>
<asp:Literal ID="lTLOrdenCompra" runat="server" Text='<%# Eval("OrdenCompra") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- 35--%>
<asp:TemplateField HeaderText="Pedido Contrato" Visible="false">
<ItemTemplate>
<asp:Literal ID="lTLPedidoContrato" runat="server" Text='<%# Eval("PedidoContrato") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
@@ -576,102 +625,92 @@
<table class="table table-striped nobordertop table-advance table-hover">
<tbody>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFolio" runat="server" Text="Folio" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSubTotal" runat="server" Text="SubTotal" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDescuento" runat="server" Text="Descuento" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChlMotivoDescuento" runat="server" Text="Motivo Descuento" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkTipoDocto" runat="server" Text="&nbsp;*Tipo Documento" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursal" runat="server" Text="&nbsp;*Sucursal" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursalCobranza" runat="server" Text="&nbsp;Sucursal Cobranza" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkAmortizacion" runat="server" Text="Amortización" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIVA" runat="server" Text="IVA" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="Ret. IVA" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="Ret. ISR" /></td>
</tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkFolio" runat="server" Text="&nbsp;*Folio" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkEstatusFactura" runat="server" Text="&nbsp;*Estatus de Factura" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursalEjecucion" runat="server" Text="&nbsp;Sucursal Ejecución" /></td>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTotal" runat="server" Text="Total" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFecha" runat="server" Text="Fecha" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursal" runat="server" Text="Sucursal" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursalEjecucion" runat="server" Text="Sucursal Ejecución" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursalCobranza" runat="server" Text="Sucursal Cobranza" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkFecha" runat="server" Text="&nbsp;*Fecha" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkVendedor" runat="server" Text="&nbsp;Vendedor" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkMotivoCancelacion" runat="server" Text="&nbsp;Motivo Cancelacion" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkSubTotal" runat="server" Text="&nbsp;*SubTotal" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkCodigo" runat="server" Text="&nbsp;Código Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkUsuario" runat="server" Text="&nbsp;Usuario" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkDescuento" runat="server" Text="&nbsp;*Descuento" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkCliente" runat="server" Text="&nbsp;*Cliente" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkEstatusFacturacion" runat="server" Text="&nbsp;Estatus Facturación" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkIVA" runat="server" Text="&nbsp;*IVA" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkMailCliente" runat="server" Text="&nbsp;Mail Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkFolioFacturacion" runat="server" Text="&nbsp;Factura Cotización" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkRetIVA" runat="server" Text="&nbsp;Ret. IVA" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkCuentaContable" runat="server" Text="&nbsp;Cuenta Contable" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkObservaciones" runat="server" Text="&nbsp;Observaciones" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkRetISR" runat="server" Text="&nbsp;Ret. ISR" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSucursalCliente" runat="server" Text="&nbsp;Sucursal Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkOrdenCompra" runat="server" Text="&nbsp;OrdenCompra" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSucursalCliente" runat="server" Text="Sucursal Cliente" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkVendedor" runat="server" Text="Vendedor" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkEstatusFactura" runat="server" Text="Estatus de Factura" Checked="true" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMotivoCancelacion" runat="server" Text="Motivo Cancelacion" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSeTimbro" runat="server" Text="Se Timbró" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSeEnvioMail" runat="server" Text="Se envió Mail" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCuentaContable" runat="server" Text="Cuenta Contable" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkTotalImpuestos" runat="server" Text="&nbsp;Impuestos Locales" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSaldo" runat="server" Text="&nbsp;Saldo" Checked="false" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkPedidoContrato" runat="server" Text="&nbsp;Pedido Contrato" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkUsuario" runat="server" Text="Usuario" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkObservaciones" runat="server" Text="Observaciones" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFolioFiscal" runat="server" Text="Folio Fiscal (UUID)" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMailCliente" runat="server" Text="Mail Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkTotal" runat="server" Text="&nbsp;*Total" Checked="true" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkFolioFiscal" runat="server" Text="&nbsp;Folio Fiscal (UUID)" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChlMotivoDescuento" runat="server" Text="&nbsp;Motivo Descuento" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkEstatusFacturacion" runat="server" Text="Estatus Facturación" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkFolioFacturacion" runat="server" Text="Factura Cotización" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCliente" runat="server" Text="Cliente" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkCodigo" runat="server" Text="Código Cliente" /></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkMoneda" runat="server" Text="&nbsp;*Moneda" Checked="true" /></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkAmortizacion" runat="server" Text="&nbsp;Amortización" /></td>
</tr>
<tr>
<td style="text-align: left;"><asp:CheckBox ID="ChkIEPS" runat="server" Text="&nbsp;*IEPS" /></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSeTimbro" runat="server" Text="&nbsp;Se Timbró" /></td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTotalImpuestos" runat="server" Text="Impuestos Locales" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIEPS" runat="server" Text="IEPS" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMoneda" runat="server" Text="Moneda" Checked="true" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSaldo" runat="server" Text="Saldo" Checked="false" /></td>
</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><asp:CheckBox ID="ChkSeEnvioMail" runat="server" Text="&nbsp; Se envió Mail" />&nbst</td>
</tr>
</tbody>
</table>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
<div class="row">
<div class="col-md-6" style="text-align:left">
<asp:CheckBox ID="ChkGuardarPersonalizacion" runat="server" Text=" Guarda Personalización" TextAlign="Right" />
</div>
<div class="col-md-6">
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>

View File

@@ -28,6 +28,9 @@ Partial Class RepVentaDetalle
End Property
Private Property DtVentas As DataTable
Get
If ViewState("DtVentas") Is Nothing Then
ViewState("DtVentas") = New DataTable
End If
Return DirectCast(ViewState("DtVentas"), DataTable)
End Get
Set(value As DataTable)
@@ -94,6 +97,20 @@ Partial Class RepVentaDetalle
End Set
End Property
Public Property Primeracontsulta As Boolean
Get
If ViewState("Primeracontsulta") Is Nothing Then
ViewState("Primeracontsulta") = True
End If
Return Boolean.Parse(ViewState("Primeracontsulta").ToString)
End Get
Set(value As Boolean)
ViewState("Primeracontsulta") = value
End Set
End Property
#End Region
'pRivate ReadOnly Property ColumnasVisibles As
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -111,6 +128,8 @@ Partial Class RepVentaDetalle
DVServicioDomicilio.Visible = True
End If
PrePersonalizacion()
CargaPersonalizacion()
End If
End Sub
@@ -407,6 +426,16 @@ Partial Class RepVentaDetalle
ImgImprimir.Enabled = True
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
GvVsh.DataSource = ObjVentas.DtResultados.FiltraParametros("CveVenta > 0")
If DtVentas.SUMD("Descuento") <= 0 Then
GvDatos.Columns(5).Visible = False ' se oculta descuentos, si está vac+io
Else
If Primeracontsulta Then
GvDatos.Columns(5).Visible = True
ChkDescuento.Checked = True
End If
End If
Else
GvDatos.DataSource = Nothing
GvVsh.DataSource = Nothing
@@ -416,8 +445,19 @@ Partial Class RepVentaDetalle
If DtVentas IsNot Nothing AndAlso DtVentas.Rows.Count > 0 AndAlso DtVentas.SUMD("Descuento") <= 0 Then GvDatos.Columns(5).Visible = False ' se oculta descuentos, si está vac+io
Agrupador = DdlGrupo.SelectedItem.Text
GvDatos.DataBind()
GvDatosDataBind()
GvVsh.DataBind()
Primeracontsulta = False
End Sub
Private Sub GvDatosDataBind()
GvDatos.DataSource = DtVentas
GvDatos.DataBind()
UPDatos.Update()
End Sub
#End Region
@@ -526,8 +566,388 @@ Partial Class RepVentaDetalle
#Region "PERSONALIZAR COLUMNAS"
Private Sub PrePersonalizacion()
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then
ChkIEPS.Visible = True
Else
ChkIEPS.Visible = False
GvDatos.Columns(9).Visible = False
End If
End Sub
Private Sub PersonalizaDefault()
ChkTipoDocto.Checked = True
ChkFolio.Checked = True
ChkFecha.Checked = True
ChkSubTotal.Checked = True
If DtVentas.Rows.Count > 0 AndAlso DtVentas.SUMD("Descuento") > 0 Then
ChkDescuento.Checked = True
End If
ChkIVA.Checked = True
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then
ChkIEPS.Checked = True
End If
ChkTotal.Checked = True
ChkMoneda.Checked = True
ChkSucursal.Checked = True
ChkEstatusFactura.Checked = True
ChkCliente.Checked = True
End Sub
Protected Sub LnkPersonalizar_Click(sender As Object, e As EventArgs)
ChkGuardarPersonalizacion.Checked = False
RegistraScript("$('#DivPersonalizar').modal('show')")
End Sub
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
If ChkGuardarPersonalizacion.Checked Then
GuardaPersonalizacion()
End If
Personaliza()
GvDatosDataBind()
UPDatos.Update()
End Sub
Private Sub GuardaPersonalizacion()
Dim objUsuario As New ClsSisUsuarios
Dim ListPersonalizada As New List(Of String)
If ChkOrdenCompra.Checked Then
ListPersonalizada.Add("OrdenCompra")
End If
If ChkFolio.Checked Then
ListPersonalizada.Add("Folio")
End If
If ChkPedidoContrato.Checked Then
ListPersonalizada.Add("PedidoContrato")
End If
If ChkFolio.Checked Then
ListPersonalizada.Add("Folio")
End If
If ChkFecha.Checked Then
ListPersonalizada.Add("Fecha")
End If
If ChkCliente.Checked Then
ListPersonalizada.Add("Cliente")
End If
If ChkSubTotal.Checked Then
ListPersonalizada.Add("SubTotal")
End If
If ChkDescuento.Checked Then
ListPersonalizada.Add("Descuento")
End If
If ChlMotivoDescuento.Checked Then
ListPersonalizada.Add("MotivoDescuento")
End If
If ChkAmortizacion.Checked Then
ListPersonalizada.Add("Amortizacion")
End If
If ChkIVA.Checked Then
ListPersonalizada.Add("IVA")
End If
If ChkIEPS.Checked Then
ListPersonalizada.Add("IEPS")
End If
If ChkRetIVA.Checked Then
ListPersonalizada.Add("RetIVA")
End If
If ChkRetISR.Checked Then
ListPersonalizada.Add("RetISR")
End If
If ChkTotalImpuestos.Checked Then
ListPersonalizada.Add("TotalImpuestos")
End If
If ChkTotal.Checked Then
ListPersonalizada.Add("Total")
End If
If ChkMoneda.Checked Then
ListPersonalizada.Add("Moneda")
End If
If ChkSucursal.Checked Then
ListPersonalizada.Add("Sucursal")
End If
If ChkSucursalEjecucion.Checked Then
ListPersonalizada.Add("SucursalEjecucion")
End If
If ChkCodigo.Checked Then
ListPersonalizada.Add("Codigo")
End If
If ChkSucursalCliente.Checked Then
ListPersonalizada.Add("SucursalCliente")
End If
If ChkSucursalCobranza.Checked Then
ListPersonalizada.Add("SucursalCobranza")
End If
If ChkVendedor.Checked Then
ListPersonalizada.Add("Vendedor")
End If
If ChkEstatusFactura.Checked Then
ListPersonalizada.Add("EstatusFactura")
End If
If ChkMotivoCancelacion.Checked Then
ListPersonalizada.Add("MotivoCancelacion")
End If
If ChkSeTimbro.Checked Then
ListPersonalizada.Add("SeTimbro")
End If
If ChkSeEnvioMail.Checked Then
ListPersonalizada.Add("SeEnvioMail")
End If
If ChkCuentaContable.Checked Then
ListPersonalizada.Add("CuentaContable")
End If
If ChkUsuario.Checked Then
ListPersonalizada.Add("Usuario")
End If
If ChkObservaciones.Checked Then
ListPersonalizada.Add("Observaciones")
End If
If ChkFolioFiscal.Checked Then
ListPersonalizada.Add("FolioFiscal")
End If
If ChkMailCliente.Checked Then
ListPersonalizada.Add("MailCliente")
End If
If ChkEstatusFacturacion.Checked Then
ListPersonalizada.Add("EstatusFacturacion")
End If
If ChkFolioFacturacion.Checked Then
ListPersonalizada.Add("FolioFacturacion")
End If
If ChkSaldo.Checked Then
ListPersonalizada.Add("Saldo")
End If
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentaDetalles.aspx", String.Join("|", ListPersonalizada)) Then
'Alert("Personalizacion guardada")
End If
objUsuario.Dispose()
End Sub
Private Sub CargaPersonalizacion()
Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("RepVentaDetalles.aspx")
If strBasePersonalizacion.Trim.Length > 0 Then
ChkTipoDocto.Checked = False
ChkOrdenCompra.Checked = False
ChkPedidoContrato.Checked = False
ChkFolio.Checked = False
ChkFecha.Checked = False
ChkCliente.Checked = False
ChkSubTotal.Checked = False
ChkDescuento.Checked = False
ChlMotivoDescuento.Checked = False
ChkAmortizacion.Checked = False
ChkIVA.Checked = False
ChkIEPS.Checked = False
ChkRetIVA.Checked = False
ChkRetISR.Checked = False
ChkTotalImpuestos.Checked = False
ChkTotal.Checked = False
ChkMoneda.Checked = False
ChkSucursal.Checked = False
ChkSucursalEjecucion.Checked = False
ChkCodigo.Checked = False
ChkSucursalCliente.Checked = False
ChkSucursalCobranza.Checked = False
ChkSucursalEjecucion.Checked = False
ChkVendedor.Checked = False
ChkEstatusFactura.Checked = False
ChkMotivoCancelacion.Checked = False
ChkSeTimbro.Checked = False
ChkSeEnvioMail.Checked = False
ChkCuentaContable.Checked = False
ChkUsuario.Checked = False
ChkObservaciones.Checked = False
ChkFolioFiscal.Checked = False
ChkMailCliente.Checked = False
ChkEstatusFacturacion.Checked = False
ChkFolioFacturacion.Checked = False
ChkSaldo.Checked = False
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
For Each personalizacion As String In Personalizaciones
Select Case personalizacion
Case "TipoDocto"
ChkTipoDocto.Checked = True
Exit Select
Case "OrdenCompra"
ChkOrdenCompra.Checked = True
Exit Select
Case "PedidoContrato"
ChkPedidoContrato.Checked = True
Exit Select
Case "Folio"
ChkFolio.Checked = True
Exit Select
Case "Fecha"
ChkFecha.Checked = True
Exit Select
Case "Cliente"
ChkCliente.Checked = True
Exit Select
Case "SubTotal"
ChkSubTotal.Checked = True
Exit Select
Case "Descuento"
ChkDescuento.Checked = True
Exit Select
Case "MotivoDescuento"
ChlMotivoDescuento.Checked = True
Exit Select
Case "Amortizacion"
ChkAmortizacion.Checked = True
Exit Select
Case "IVA"
ChkIVA.Checked = True
Exit Select
Case "IEPS"
ChkIEPS.Checked = True
Exit Select
Case "RetIVA"
ChkRetIVA.Checked = True
Exit Select
Case "RetISR"
ChkRetISR.Checked = True
Exit Select
Case "TotalImpuestos"
ChkTotalImpuestos.Checked = True
Exit Select
Case "Total"
ChkTotal.Checked = True
Exit Select
Case "Moneda"
ChkMoneda.Checked = True
Exit Select
Case "Sucursal"
ChkSucursal.Checked = True
Exit Select
Case "SucursalEjecucion"
ChkSucursalEjecucion.Checked = True
Exit Select
Case "Codigo"
ChkCodigo.Checked = True
Exit Select
Case "SucursalCliente"
ChkSucursalCliente.Checked = True
Exit Select
Case "SucursalCobranza"
ChkSucursalCobranza.Checked = True
Exit Select
Case "SucursalEjecucion"
ChkSucursalEjecucion.Checked = True
Exit Select
Case "Vendedor"
ChkVendedor.Checked = True
Exit Select
Case "EstatusFactura"
ChkEstatusFactura.Checked = True
Exit Select
Case "MotivoCancelacion"
ChkMotivoCancelacion.Checked = True
Exit Select
Case "SeTimbro"
ChkSeTimbro.Checked = True
Exit Select
Case "SeEnvioMail"
ChkSeEnvioMail.Checked = True
Exit Select
Case "CuentaContable"
ChkCuentaContable.Checked = True
Exit Select
Case "Usuario"
ChkUsuario.Checked = True
Exit Select
Case "Observaciones"
ChkObservaciones.Checked = True
Exit Select
Case "FolioFiscal"
ChkFolioFiscal.Checked = True
Exit Select
Case "MailCliente"
ChkMailCliente.Checked = True
Exit Select
Case "EstatusFacturacion"
ChkEstatusFacturacion.Checked = True
Exit Select
Case "FolioFacturacion"
ChkFolioFacturacion.Checked = True
Exit Select
Case "Saldo"
ChkSaldo.Checked = True
Exit Select
Case Else
Exit Select
End Select
Next
Personaliza()
Else
PersonalizaDefault()
End If
UPPersonalizar.Update()
End Sub
Private Sub Personaliza()
GvDatos.Columns(0).Visible = ChkTipoDocto.Checked
GvDatos.Columns(1).Visible = ChkFolio.Checked
GvDatos.Columns(2).Visible = ChkFecha.Checked
GvDatos.Columns(3).Visible = ChkCliente.Checked
@@ -561,6 +981,8 @@ Partial Class RepVentaDetalle
GvDatos.Columns(31).Visible = ChkEstatusFacturacion.Checked
GvDatos.Columns(32).Visible = ChkFolioFacturacion.Checked
GvDatos.Columns(33).Visible = ChkSaldo.Checked
GvDatos.Columns(34).Visible = ChkOrdenCompra.Checked
GvDatos.Columns(35).Visible = ChkPedidoContrato.Checked
Personalizo = 1
If Personalizo = 1 Then
@@ -568,7 +990,7 @@ Partial Class RepVentaDetalle
Else
ImgExcelPersonalizado.Visible = False
End If
UPDatos.Update()
End Sub
#End Region
@@ -871,4 +1293,6 @@ Partial Class RepVentaDetalle
#End Region
End Class

View File

@@ -69,10 +69,19 @@
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
<asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel Personalizado</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkPErsonalizar" OnClick="LnkPErsonalizar_Click" runat="server"><i class="fa fa-pencil"></i>Personalizar Columnas</asp:LinkButton>
<%--<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>--%>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgExcelPersonalizado" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpLnkHP" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -344,34 +353,51 @@
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas" CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None">
<Columns>
<%--0--%>
<asp:TemplateField HeaderText="Grupo" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlGrupo" runat="server" Text='<%# Eval("GPO") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%--1--%>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:N0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%--2--%>
<asp:BoundField HeaderText="Sub Total" DataField="SubTotal" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--3--%>
<asp:BoundField HeaderText="Descuento" DataField="Descuento" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--4--%>
<asp:BoundField HeaderText="Amortización" DataField="Amortizacion" Visible="false" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--5--%>
<asp:BoundField HeaderText="Sub Total 2" DataField="SubTotal2" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--6--%>
<asp:BoundField HeaderText="IVA" DataField="IVA" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--7--%>
<asp:BoundField HeaderText="IEPS" DataField="IEPS" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--8--%>
<asp:BoundField HeaderText="Ret. IVA" DataField="RetIVA" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--9--%>
<asp:BoundField HeaderText="Ret. ISR" DataField="RetISR" ItemStyle-Width="7.5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--10--%>
<asp:BoundField HeaderText="Imp. Locales" DataField="TotalImpuestos" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--11--%>
<asp:BoundField HeaderText="Total" DataField="Total" ItemStyle-Width="10%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--12--%>
<asp:BoundField HeaderText="Sub. Máximo" DataField="MAX_SubTotal" ItemStyle-Width="5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--13--%>
<asp:BoundField HeaderText="Sub. Promedio" DataField="AVG_SubTotal" ItemStyle-Width="5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--14--%>
<asp:BoundField HeaderText="Sub. Mínimo" DataField="MIN_SubTotal" ItemStyle-Width="5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--15--%>
<asp:BoundField HeaderText="Tot. Máximo" DataField="MAX_Total" ItemStyle-Width="5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--16--%>
<asp:BoundField HeaderText="Tot. Promedio" DataField="AVG_Total" ItemStyle-Width="5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--17--%>
<asp:BoundField HeaderText="Tot. Mínimo" DataField="MIN_Total" ItemStyle-Width="5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<%--18--%>
<asp:BoundField HeaderText="Tot. Refacturado" DataField="TotalRefacturado" ItemStyle-Width="5%" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
</Columns>
<RowStyle CssClass="Texto" />
@@ -397,46 +423,127 @@
<tbody>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="Ret. IVA" /></td>
<asp:CheckBox ID="ChkCantidad" runat="server" Text="&nbsp;*Cantidad" /></td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMinSub" runat="server" Text="SubTotal Mínimo" /></td>
<asp:CheckBox ID="ChkMaxSub" runat="server" Text="&nbsp;SubTotal Máximo" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="Ret. ISR" /></td>
<asp:CheckBox ID="ChkSubtotal" runat="server" Text="&nbsp;Sub total" /></td>
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMaxTot" runat="server" Text="Total Máximo" /></td>
<asp:CheckBox ID="ChkAVGSub" runat="server" Text="&nbsp;SubTotal Promedio" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMaxSub" runat="server" Text="SubTotal Máximo" /></td>
<asp:CheckBox ID="ChkDescuentos" runat="server" Text="&nbsp;*Descuentos" /></td>
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkAvgTot" runat="server" Text="Total Promedio" /></td>
<asp:CheckBox ID="ChkMinSub" runat="server" Text="&nbsp;SubTotal Mínimo" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkAVGSub" runat="server" Text="SubTotal Promedio" /></td>
<asp:CheckBox ID="ChkSubTotal2" runat="server" Text="&nbsp;*Subtotal 2" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkMinTot" runat="server" Text="Total Mínimo" /></td>
<asp:CheckBox ID="ChkMaxTot" runat="server" Text="&nbsp;Total Máximo" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkImpLoc" runat="server" Text="Impuestos Locales" /></td>
<asp:CheckBox ID="ChkIVA" runat="server" Text="&nbsp;*IVA" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="CheckRefacturado" runat="server" Text="Refacturado" /></td>
<asp:CheckBox ID="ChkAvgTot" runat="server" Text="&nbsp;Total Promedio" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkSubTotal2" runat="server" Text="Subtotal 2" /></td>
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="&nbsp;Ret. IVA" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIEPS" runat="server" Text="IEPS" /></td>
<asp:CheckBox ID="ChkMinTot" runat="server" Text="&nbsp;Total Mínimo" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="&nbsp;Ret. ISR" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="CheckRefacturado" runat="server" Text="&nbsp;Refacturado" />
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkImpLoc" runat="server" Text="&nbsp;Impuestos Locales" />
</td>
<td style="text-align: left;">
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkTotal" runat="server" Text="&nbsp;*Total" />
</td>
<td style="text-align: left;">
</td>
</tr>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkIEPS" runat="server" Text="&nbsp;*IEPS" />
</td>
<td style="text-align: left;">
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
<div class="row">
<div class="col-md-6" style="text-align:left">
<asp:CheckBox ID="ChkGuardarPersonalizacion" runat="server" Text=" Guarda Personalización" TextAlign="Right" />
</div>
<div class="col-md-6">
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>

View File

@@ -61,6 +61,9 @@ Partial Class Ventas_RepVentas
End Property
Private Property DtVentas As DataTable
Get
If ViewState("DtVentas") Is Nothing Then
ViewState("DtVentas") = New DataTable
End If
Return DirectCast(ViewState("DtVentas"), DataTable)
End Get
Set(value As DataTable)
@@ -68,6 +71,28 @@ Partial Class Ventas_RepVentas
End Set
End Property
Private Property Personalizo As Integer
Get
Return ViewState("Personalizo").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Personalizo") = value
End Set
End Property
Public Property Primeracontsulta As Boolean
Get
If ViewState("Primeracontsulta") Is Nothing Then
ViewState("Primeracontsulta") = True
End If
Return Boolean.Parse(ViewState("Primeracontsulta").ToString)
End Get
Set(value As Boolean)
ViewState("Primeracontsulta") = value
End Set
End Property
#End Region
@@ -76,7 +101,8 @@ Partial Class Ventas_RepVentas
If Not IsPostBack Then
If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario.Contiene(77, 21) Then Response.Redirect("/Inicio.aspx")
TipoCambio = 1
TCEspecifico = -1
TCEspecifico = -1
Personalizo = 0
CargaCombos()
ConfiguraEmpresa()
@@ -121,7 +147,10 @@ Partial Class Ventas_RepVentas
DVServicioDomicilio.Visible = True
DivLblDistr.Visible = True
DivDistr.Visible = True
End If
End If
PrePersonalizacion()
CargaPersonalizacion()
End If
@@ -254,12 +283,34 @@ Partial Class Ventas_RepVentas
GvDatos.DataSource = Nothing
End If
If DtVentas.SUMD("Descuento") <= 0 Then GvDatos.Columns(3).Visible = False ' se oculta descuentos, si está vac+io
If DtVentas.SUMD("Descuento") <= 0 Then
GvDatos.Columns(3).Visible = False ' se oculta descuentos, si está vac+io
'ChkDescuentos.Visible = False
Else
If Primeracontsulta Then
GvDatos.Columns(3).Visible = True
ChkDescuentos.Checked = True
End If
End If
UPPersonalizar.Update()
Agrupador = DdlGrupo.SelectedItem.Text
CveProyecto = DdlProyecto.SelectedValue.ToEntero
ObjVentas.Dispose()
GvDatos.DataBind()
ObjVentas.Dispose()
GvDatosDataBind()
Primeracontsulta = False
End Sub
Private Sub GvDatosDataBind()
GvDatos.DataSource = DtVentas
GvDatos.DataBind()
UPDatos.Update()
End Sub
#End Region
@@ -474,25 +525,261 @@ Partial Class Ventas_RepVentas
#End Region
#Region " PERSONALIZAR "
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs)
Personaliza()
Private Sub PrePersonalizacion()
'ChkDescuentos.Visible = False
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then
ChkIEPS.Visible = True
Else
ChkIEPS.Visible = False
GvDatos.Columns(7).Visible = False
End If
End Sub
Protected Sub LnkPErsonalizar_Click(sender As Object, e As EventArgs)
ChkGuardarPersonalizacion.Checked = False
RegistraScript("$('#DivPersonalizar').modal('show')")
End Sub
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs)
If ChkGuardarPersonalizacion.Checked Then
GuardaPersonalizacion()
End If
Personaliza()
GvDatosDataBind()
End Sub
Private Sub GuardaPersonalizacion()
Dim objUsuario As New ClsSisUsuarios
Dim ListPersonalizada As New List(Of String)
'ChkCantidad.Checked = False
'ChkSubtotal.Checked = False
'ChkDescuentos.Checked = False
'ChkIVA.Checked = False
'ChkTotal.Checked = False
If ChkCantidad.Checked Then
ListPersonalizada.Add("Cantidad")
End If
If ChkSubtotal.Checked Then
ListPersonalizada.Add("Subtotal")
End If
If ChkDescuentos.Checked Then
ListPersonalizada.Add("Descuentos")
End If
If ChkIVA.Checked Then
ListPersonalizada.Add("IVA")
End If
If ChkTotal.Checked Then
ListPersonalizada.Add("Total")
End If
If ChkSubTotal2.Checked Then
ListPersonalizada.Add("SubTotal2")
End If
If ChkIEPS.Checked Then
ListPersonalizada.Add("IEPS")
End If
If ChkRetIVA.Checked Then
ListPersonalizada.Add("RetIVA")
End If
If ChkRetISR.Checked Then
ListPersonalizada.Add("RetISR")
End If
If ChkImpLoc.Checked Then
ListPersonalizada.Add("ImpLoc")
End If
If ChkMinSub.Checked Then
ListPersonalizada.Add("MinSub")
End If
If ChkAVGSub.Checked Then
ListPersonalizada.Add("AVGSub")
End If
If ChkMaxSub.Checked Then
ListPersonalizada.Add("MaxSub")
End If
If ChkMaxTot.Checked Then
ListPersonalizada.Add("MaxTot")
End If
If ChkAvgTot.Checked Then
ListPersonalizada.Add("AvgTot")
End If
If ChkMinTot.Checked Then
ListPersonalizada.Add("MinTot")
End If
If CheckRefacturado.Checked Then
ListPersonalizada.Add("CheckRefacturado")
End If
If ChkCantidad.Checked Then
ListPersonalizada.Add("Cantidad")
End If
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "RepVentas.aspx", String.Join("|", ListPersonalizada)) Then
'Alert("Personalizacion guardada")
End If
objUsuario.Dispose()
End Sub
Private Sub CargaPersonalizacion()
Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("RepVentas.aspx")
If strBasePersonalizacion.Trim.Length > 0 Then
ChkCantidad.Checked = False
ChkSubtotal.Checked = False
ChkDescuentos.Checked = False
ChkIVA.Checked = False
ChkTotal.Checked = False
ChkSubTotal2.Checked = False
ChkIEPS.Checked = False
ChkRetIVA.Checked = False
ChkRetISR.Checked = False
ChkImpLoc.Checked = False
ChkMinSub.Checked = False
ChkAVGSub.Checked = False
ChkMaxSub.Checked = False
ChkMaxTot.Checked = False
ChkAvgTot.Checked = False
ChkMinTot.Checked = False
CheckRefacturado.Checked = False
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
For Each personalizacion As String In Personalizaciones
Select Case personalizacion
Case "Cantidad"
ChkCantidad.Checked = True
Exit Select
Case "Subtotal"
ChkSubtotal.Checked = True
Exit Select
Case "Descuentos"
ChkDescuentos.Checked = True
Exit Select
Case "IVA"
ChkIVA.Checked = True
Exit Select
Case "Total"
ChkTotal.Checked = True
Exit Select
Case "SubTotal2"
ChkSubTotal2.Checked = True
Exit Select
Case "IEPS"
ChkIEPS.Checked = True
Exit Select
Case "RetIVA"
ChkRetIVA.Checked = True
Exit Select
Case "RetISR"
ChkRetISR.Checked = True
Exit Select
Case "ImpLoc"
ChkImpLoc.Checked = True
Exit Select
Case "MinSub"
ChkMinSub.Checked = True
Exit Select
Case "AVGSub"
ChkAVGSub.Checked = True
Exit Select
Case "MaxSub"
ChkMaxSub.Checked = True
Exit Select
Case "MaxTot"
ChkMaxTot.Checked = True
Exit Select
Case "AvgTot"
ChkAvgTot.Checked = True
Exit Select
Case "MinTot"
ChkMinTot.Checked = True
Exit Select
Case "CheckRefacturado"
CheckRefacturado.Checked = True
Exit Select
Case Else
Exit Select
End Select
Next
Personaliza()
Else
PersonalizaDefault()
End If
UPPersonalizar.Update()
End Sub
Private Sub PersonalizaDefault()
ChkCantidad.Checked = True
'ChkSubtotal.Checked = True
If DtVentas.Rows.Count > 0 AndAlso DtVentas.SUMD("Descuento") > 0 Then
ChkDescuentos.Checked = True
End If
ChkSubTotal2.Checked = True
ChkIVA.Checked = True
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then
ChkIEPS.Checked = True
End If
'ChkRetIVA.Checked = True
'ChkRetISR.Checked = True
'ChkImpLoc.Checked = True
ChkTotal.Checked = True
End Sub
Private Sub Personaliza()
GvDatos.Columns(1).Visible = ChkCantidad.Checked
GvDatos.Columns(2).Visible = ChkSubtotal.Checked
GvDatos.Columns(3).Visible = ChkDescuentos.Checked
GvDatos.Columns(6).Visible = ChkIVA.Checked
GvDatos.Columns(11).Visible = ChkTotal.Checked
GvDatos.Columns(5).Visible = ChkSubTotal2.Checked
GvDatos.Columns(7).Visible = ChkIEPS.Checked
GvDatos.Columns(8).Visible = ChkRetIVA.Checked
GvDatos.Columns(9).Visible = ChkRetISR.Checked
GvDatos.Columns(10).Visible = ChkImpLoc.Checked
GvDatos.Columns(12).Visible = ChkMinSub.Checked
GvDatos.Columns(12).Visible = ChkMaxSub.Checked
GvDatos.Columns(13).Visible = ChkAVGSub.Checked
GvDatos.Columns(14).Visible = ChkMaxSub.Checked
GvDatos.Columns(14).Visible = ChkMinSub.Checked
GvDatos.Columns(15).Visible = ChkMaxTot.Checked
GvDatos.Columns(16).Visible = ChkAvgTot.Checked
GvDatos.Columns(17).Visible = ChkMinTot.Checked
GvDatos.Columns(18).Visible = CheckRefacturado.Checked
Personalizo = 1
If Personalizo = 1 Then
ImgExcelPersonalizado.Visible = True
Else
ImgExcelPersonalizado.Visible = False
End If
UPDatos.Update()
End Sub
@@ -510,7 +797,7 @@ Partial Class Ventas_RepVentas
Private Sub GenerarPDF(Optional Formato As String = "PDF")
If DtVentas IsNot Nothing Then
Dim StrFiltro As New StringBuilder
StrFiltro.AppendFormat("&emsp;<b>Agrupado por</b>: {0}", DdlGrupo.SelectedItem.Text)
StrFiltro.AppendFormat("&emsp;<b>Agrupado por</b>: {0}", DdlGrupo.SelectedItem.Text)
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepVentas.rdlc", UsuarioActual.Empresa.Ruta))
Dim ruta As String = ""
@@ -743,5 +1030,13 @@ Partial Class Ventas_RepVentas
End Sub
Protected Sub ImgExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles ImgExcelPersonalizado.Click
'GvVsh.Visible = True
'GvVsh.ExportToExcel("DetalleVentas_" & Now.ToShortDateString)
'GvVsh.Visible = False
GvDatos.ExportToExcel("Ventas_" & Now.ToShortDateString & ".xls")
'GvDatos.ExportToExcelG("DetalleVentas_" & Now.ToShortDateString & ".xlsx")
End Sub
End Class