diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index 9b6ce58b5..cdfbb7d58 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -433,6 +433,7 @@ Partial Class AF_AF
End If
+
End If
End Sub
Private Sub cargaOrdenesdeservicio()
@@ -2493,6 +2494,8 @@ Partial Class AF_AF
Dim FechaBaja As Date = If(TxtFechaBaja.Text = "", MinFecha, TxtFechaBaja.Text.ToDate)
+ Dim EsNuevo As Boolean = If(CveActivoFijo > 0, False, True)
+
If CveActivoFijo <= 0 Then
'SALIDA DE ALMACEN PARA IMPORTACION
@@ -2664,15 +2667,80 @@ Partial Class AF_AF
' UPHistModificaciones.Update()
ObjAF.Commit()
- Alert("El Activo Fijo se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/AF/CatAF.aspx"";")
+ Alert("El Activo Fijo se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/AF/CatAF.aspx"";")
Else
ObjAF.RollBack()
Alert("Ocurrió un error al actualizar el Activo Fijo. Por favor vuelva a intentar o comuniquese con servicio técnico", TipoMensaje.MsgError)
End If
ObjAF.Dispose()
- End Sub
+ If UsuarioActual.CveEmpresa = 13 Then
+ If EsNuevo Then
+ EnviarNotificacionCorreo(1) 'Alta de Activo Fijo
+ ElseIf DdlEstadoActivoFijo.SelectedValue.ToEntero = 6 Then
+ EnviarNotificacionCorreo(2) 'Baja de Activo Fijo
+ End If
+ End If
+
+ End Sub
+
+ Private Sub EnviarNotificacionCorreo(Opcion As Integer) '1 = alta AF, 2 = baja AF
+
+
+
+ Try
+ 'Dim Para As String = "roberto.hernandez@exploracionesmineras.com"
+ Dim Para As String = "oscar.irigoyen@adssistemas.mx"
+ Dim Asunto As String = $"Registro de {If(Opcion = 1, "Alta de Activo Fijo", "Baja de ActivoFijo")}"
+ Dim Body As String = ""
+ Dim strBody As New StringBuilder
+
+ Dim Codigo As String = TxtCodigo.Text
+ Dim Descripcion As String = TxtDescripcion.Text.Trim
+ Dim Proyecto As String = DdlSubProyecto.SelectedItem.Text
+ Dim TipoActivoFijo As String = DdlTipoActivoFijo.SelectedItem.Text
+ Dim SubtipoActivoFijo As String = DdlSubTipoActivoFijo.SelectedItem.Text
+ Dim EstatusActivoFijo As String = DdlEstadoActivoFijo.SelectedItem.Text
+ Dim Fecha As String = NowADS().ToString("dd/MM/yyyy HH:mm:ss")
+ Dim Usuario As String = UsuarioActual.Nombre
+
+ strBody.Append("")
+ strBody.Append("
-
+ --%>
diff --git a/AF/CatAF.aspx.vb b/AF/CatAF.aspx.vb
index 594d4b956..51b294589 100644
--- a/AF/CatAF.aspx.vb
+++ b/AF/CatAF.aspx.vb
@@ -327,6 +327,8 @@ Partial Class AF_CatAF
GvDatos.DataSource = DtActivosFijos
GvDatos.DataBind()
+ LtlTotalRegistros.Text = "0"
+
If DtActivosFijos IsNot Nothing Then
LtlTotalRegistros.Text = DtActivosFijos.Rows.Count.ToString.FormatoNumero(0)
End If
@@ -853,4 +855,23 @@ Partial Class AF_CatAF
End Sub
#End Region
+
+ Protected Sub DdlAFTipoGrupo_SelectedIndexChanged(sender As Object, e As EventArgs)
+
+
+ DdlTipoActivo.ClearSelection()
+ DdlTipoActivo.SelectedValue = Nothing
+ DdlTipoActivo.Items.Clear()
+
+ If DdlAFTipoGrupo.SelectedValue.ToEntero > 0 Then
+ DdlTipoActivo.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveTipoAFGrupo = {0}", DdlAFTipoGrupo.SelectedValue), "TipoActivoFijo")
+ Else
+ DdlTipoActivo.DataSource = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo")
+ End If
+
+ DdlTipoActivo.DataBind()
+ DdlTipoActivo.Items.Insert(0, New ListItem("Todos", "-1"))
+ UpFiltro.Update()
+
+ End Sub
End Class
diff --git a/AF/CatTipos.aspx b/AF/CatTipos.aspx
index 594e793d2..8ddc7e863 100644
--- a/AF/CatTipos.aspx
+++ b/AF/CatTipos.aspx
@@ -24,12 +24,16 @@
-
+
+
+
+
+
>
@@ -117,6 +121,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AF/CatTipos.aspx.vb b/AF/CatTipos.aspx.vb
index d7dd84cf6..b391ca2a3 100644
--- a/AF/CatTipos.aspx.vb
+++ b/AF/CatTipos.aspx.vb
@@ -16,8 +16,16 @@ Partial Class AF_CatTipos
GvDatos.Columns(1).Visible = True
End If
+ If UsuarioActual.CveEmpresa = 13 Then
+ DvTipoAFGrupo.Visible = True
+ DvTipoAFPadre.Visible = True
+ GvDatos.Columns(4).Visible = True
+ GvDatos.Columns(5).Visible = True
+ End If
+
+
CargaDatos()
- End If
+ End If
End Sub
#Region "AGREGAR / ACTUALIZAR"
@@ -33,6 +41,9 @@ Partial Class AF_CatTipos
ChkFolio.Checked = False
ChkContable.Checked = False
divEstatus.Visible = False
+ DdlTipoAFGrupo.SelectedValueExist("-1")
+ ChkTipoAFPadre.Checked = True
+
UpAddTipoAF.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddTipoAF"))
End Sub
@@ -58,6 +69,11 @@ Partial Class AF_CatTipos
ChkContable.Checked = CBool(If(GvRow.DataKey("Contable") = "Activo", True, False))
divEstatus.Visible = True
ChkEstatus.Checked = CBool(If(GvRow.DataKey("Estado") = "Activo", True, False))
+
+ DdlTipoAFGrupo.SelectedValueExist(GvRow.DataKey("CveTipoAFGrupo"))
+ ChkTipoAFPadre.Checked = Boolean.Parse((GvRow.DataKey("TipoAFPadre")))
+ 'CveTipoAFGrupo, TipoAFPadre
+
UpAddTipoAF.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddTipoAF"))
End Sub
@@ -68,11 +84,15 @@ Partial Class AF_CatTipos
If ChkEstatus.Checked Then Estatus = True Else Estatus = False
If HdnModalidad.Value = "A" Then
- If Not ObjAF.AddTiposActivosFijos(TxtTipo.Text.Trim, DdlCuentaInicial.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, PorDepreciacion:=TxtDepreciacionAF.Text.ToDecimal, MedidaVehicular:=DdlMedidaVehicular.SelectedValue.ToEntero, AutoFolio:=ChkFolio.Checked, Contable:=ChkContable.Checked) Then
+ If Not ObjAF.AddTiposActivosFijos(TxtTipo.Text.Trim, DdlCuentaInicial.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, PorDepreciacion:=TxtDepreciacionAF.Text.ToDecimal,
+ MedidaVehicular:=DdlMedidaVehicular.SelectedValue.ToEntero, AutoFolio:=ChkFolio.Checked, Contable:=ChkContable.Checked, CveTipoAFGrupo:=DdlTipoAFGrupo.SelectedValue.ToEntero,
+ TipoAFPadre:=ChkTipoAFPadre.Checked) Then
TieneError = True
End If
ElseIf HdnModalidad.Value = "U" Then
- If Not ObjAF.UpdateTiposActivosFijos(HdnID.Value.ToEntero, TxtTipo.Text.Trim, DdlCuentaInicial.SelectedValue.ToEntero, Estatus, PorDepreciacion:=TxtDepreciacionAF.Text.ToDecimal, MedidaVehicular:=DdlMedidaVehicular.SelectedValue.ToEntero, AutoFolio:=ChkFolio.Checked, Contable:=ChkContable.Checked) Then
+ If Not ObjAF.UpdateTiposActivosFijos(HdnID.Value.ToEntero, TxtTipo.Text.Trim, DdlCuentaInicial.SelectedValue.ToEntero, Estatus, PorDepreciacion:=TxtDepreciacionAF.Text.ToDecimal,
+ MedidaVehicular:=DdlMedidaVehicular.SelectedValue.ToEntero, AutoFolio:=ChkFolio.Checked, Contable:=ChkContable.Checked, CveTipoAFGrupo:=DdlTipoAFGrupo.SelectedValue.ToEntero,
+ TipoAFPadre:=ChkTipoAFPadre.Checked) Then
TieneError = True
End If
End If
diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb
index e0edd96b6..6e352b78b 100644
--- a/App_Code/ClsAF.vb
+++ b/App_Code/ClsAF.vb
@@ -1512,7 +1512,8 @@ Public Class ClsAF
Return Retorno
End Function
- Public Function AddTiposActivosFijos(TipoActivoFijo As String, CuentaInicial As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional PorDepreciacion As Decimal = 0, Optional MedidaVehicular As Integer = 1, Optional AutoFolio As Boolean = False, Optional Contable As Boolean = False) As Boolean
+ Public Function AddTiposActivosFijos(TipoActivoFijo As String, CuentaInicial As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional PorDepreciacion As Decimal = 0, Optional MedidaVehicular As Integer = 1,
+ Optional AutoFolio As Boolean = False, Optional Contable As Boolean = False, Optional CveTipoAFGrupo As Integer = 1, Optional TipoAFPadre As Boolean = True) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposActivosFijosAdd")
@@ -1526,6 +1527,8 @@ Public Class ClsAF
.Add("@MedidaVehicular", SqlDbType.TinyInt).Value = MedidaVehicular
.Add("@AutoFolio", SqlDbType.Bit).Value = AutoFolio
.Add("@Contable", SqlDbType.Bit).Value = Contable
+ .Add("@CveTipoAFGrupo", SqlDbType.Int).Value = CveTipoAFGrupo
+ .Add("@TipoAFPadre", SqlDbType.Bit).Value = TipoAFPadre
End With
Try
@@ -1538,7 +1541,8 @@ Public Class ClsAF
Return Retorno
End Function
- Public Function UpdateTiposActivosFijos(CveTipoActivoFijo As Integer, TipoActivoFijo As String, CuentaInicial As Integer, Estado As Boolean, Optional PorDepreciacion As Decimal = 0, Optional MedidaVehicular As Integer = 1, Optional AutoFolio As Boolean = False, Optional Contable As Boolean = False) As Boolean
+ Public Function UpdateTiposActivosFijos(CveTipoActivoFijo As Integer, TipoActivoFijo As String, CuentaInicial As Integer, Estado As Boolean, Optional PorDepreciacion As Decimal = 0, Optional MedidaVehicular As Integer = 1,
+ Optional AutoFolio As Boolean = False, Optional Contable As Boolean = False, Optional CveTipoAFGrupo As Integer = 1, Optional TipoAFPadre As Boolean = True) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_TiposActivosFijosUpdate")
@@ -1552,6 +1556,8 @@ Public Class ClsAF
.Add("@MedidaVehicular", SqlDbType.TinyInt).Value = MedidaVehicular
.Add("@AutoFolio", SqlDbType.Bit).Value = AutoFolio
.Add("@Contable", SqlDbType.Bit).Value = Contable
+ .Add("@CveTipoAFGrupo", SqlDbType.Int).Value = CveTipoAFGrupo
+ .Add("@TipoAFPadre", SqlDbType.Bit).Value = TipoAFPadre
End With
Try
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 135d41b25..6723cdd82 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -1808,6 +1808,7 @@ Public Class ClsBancos
End With
Try
+ SqlAdapter.SelectCommand.CommandTimeout = 0
SqlAdapter.Fill(Data)
Retorno = SqlAdapter.SelectCommand.Parameters("@CvePrePoliza").Value.ToString.ToEntero
Catch ex As Exception
diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb
index 245d7a2e0..3d7cbcf63 100644
--- a/Bancos/PagoElectronicoGrupos.aspx.vb
+++ b/Bancos/PagoElectronicoGrupos.aspx.vb
@@ -2,8 +2,9 @@
Option Strict On
Imports System.Data
-Imports Extensiones
+Imports System.Globalization
Imports System.IO
+Imports Extensiones
Imports Ionic.Zip
Imports Microsoft.Reporting.WebForms
@@ -1167,12 +1168,34 @@ Partial Class Bancos_PagoElectronicoGrupos
If Not DdlCuenta.SelectedValue.ToEntero > 0 Then
Alert("Primero debe seleccionar una Cuenta", TipoMensaje.MsgAdvertencia)
Exit Sub
- End If
-
+ End If
+
+
+ 'GlobalDTBancosCuentas.FiltraParametros($"CveCuentaDeposito = {DdlCuenta.SelectedValue} AND EstatusCtaDeposito = 'True'")
+
+
+
If DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing Then
- GeneraPago(DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0"))
-
+ Dim CuentaCargo As String = "0382755740201"
+
+ If DdlCuenta.SelectedItem.Text.Contains("BAJIO") Then
+
+ GeneraPagoBajio(
+ numeroArchivo:=1,
+ fechaCargo:=NowADS,
+ cuentaCargo:=CuentaCargo,
+ DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0"))
+
+
+ ElseIf DdlCuenta.SelectedItem.Text.Contains("Scotiabank") Then
+ GeneraPagoScotiabank(DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0"))
+ Else
+ GeneraPago(DTPendientes.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0"))
+ End If
+
+
+
Else
Alert("No hay registros para generar", TipoMensaje.MsgAdvertencia)
@@ -1180,6 +1203,175 @@ Partial Class Bancos_PagoElectronicoGrupos
End If
End Sub
+ 'Private Sub GeneraPagoBajio(dataTable As DataTable)
+ ' 'Throw New NotImplementedException()
+ 'End Sub
+
+ Public Sub GeneraPagoBajio(numeroArchivo As Integer,
+ fechaCargo As Date,
+ cuentaCargo As String,
+ DTDatos As DataTable)
+
+
+ Dim HEADER_LEN As Integer = 20
+ Dim DETALLE_LEN As Integer = 384
+ Dim TRAILER_LEN As Integer = 34
+
+ ' --- columnas fijas del header / trailer ---
+ Dim DIVISA_MXN As String = "001"
+ Dim FILLER_8CEROS As String = "00000000"
+ Dim FILLER_4CEROS As String = "0000"
+ Dim CONST_0140 As String = "0140" '/** Pregunta */: tu banco usa siempre 0140?
+
+ Dim _mediosValidos As HashSet(Of String) = New HashSet(Of String)({"BCO", "TEF", "SPE", "SPD"})
+ Dim _tiposCuentaValidos As HashSet(Of String) = New HashSet(Of String)({"40", "1", "3"})
+
+ ' --------------------------- Header (20 bytes) ---------------------------
+ Dim header As String = $"01{numeroArchivo:D7}{fechaCargo:yyyyMMdd}{DIVISA_MXN}"
+ If header.Length <> HEADER_LEN Then
+ Alert($"Header debe medir {HEADER_LEN} bytes, mide {header.Length}.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ ' --------------------------- Detalles (384 bytes) ------------------------
+ Dim detalles As New List(Of String)(DTDatos.Rows.Count)
+ Dim consecArchivo As Integer = 2 'el #1 lo ocupa el header
+ Dim consecPago As Integer = 1
+ Dim totalCentavos As Long = 0
+ Dim MedioPago As String = "TEF"
+ Dim ReferenciaSPEI As String = ""
+ Dim ClasificacionSPID As String = ""
+
+
+ For Each DRow As DataRow In DTDatos.Rows
+
+ Dim ClabeOCuenta As String = DRow("CLABEDestino").ToString.Trim
+ Dim nCaracteresClabeCuenta As Integer = ClabeOCuenta.Length
+ Dim TipoCuentaDestino As String = ""
+ Dim Importe As Decimal = DRow("Importe").ToString.ToDecimal
+ Dim IVA As Decimal = 0D
+
+ If nCaracteresClabeCuenta <> 18 Then
+ If nCaracteresClabeCuenta <> 12 Then
+ Alert($"CLABE/Cuenta debe tener 18 o 12 caracteres, tiene {ClabeOCuenta.Length}.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+
+ If nCaracteresClabeCuenta = 18 Then
+ TipoCuentaDestino = "40"
+ Else
+ TipoCuentaDestino = "1"
+ End If
+
+
+ ' ----------- Validaciones de negocio --------------------------------
+ DRow("RazonSocial") = LimpiarDatosBajio(DRow("RazonSocial").ToString, 15, "Alias")
+ DRow("RazonSocial") = LimpiarDatosBajio(DRow("RazonSocial").ToString, 250, "Descripción")
+
+ If Not _tiposCuentaValidos.Contains(TipoCuentaDestino) Then
+ Alert($"TipoCuentaDestino inválido: {TipoCuentaDestino}", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If Not _mediosValidos.Contains(MedioPago) Then
+ Alert($"MedioPago inválido: {MedioPago}", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If MedioPago = "SPE" AndAlso (ReferenciaSPEI.Length <> 7 OrElse Not IsNumeric(ReferenciaSPEI)) Then
+ Alert("ReferenciaSPEI debe contener 7 dígitos numéricos cuando MedioPago = SPE.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If MedioPago <> "SPD" AndAlso Not String.IsNullOrEmpty(ClasificacionSPID) Then
+ Alert("ClasificacionSPID sólo se permite cuando MedioPago = SPD.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If Importe <= 0D Then
+ Alert("Importe debe ser mayor a cero.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'If DRow.IVA < 0D Then
+ ' Alert("IVA no puede ser negativo.", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
+
+ ' ----------- Construcción de la línea --------------------------------
+ Dim sb As New StringBuilder(DETALLE_LEN)
+
+ sb.Append("02") 'tipo registro
+ sb.Append(consecArchivo.ToString("D7")) 'consec archivo
+ sb.Append("01") 'tipo cta origen fijo
+ sb.Append(FILLER_8CEROS) 'filler
+ sb.Append(cuentaCargo.PadLeft(12, "0"c)) 'cta cargo
+ sb.Append(CONST_0140) 'constante 0140
+ sb.Append(ClabeOCuenta.PadLeft(3, "0"c))
+ sb.Append("00") '5 dígitos banco destino
+ sb.Append(consecPago.ToString("D10")) 'consec pago
+ sb.Append("000" & fechaCargo.ToString("yyyyMMdd")) 'prefijo 000 + fecha
+ sb.Append(MedioPago) 'BCO/TEF/SPE/SPD
+ sb.Append(TipoCuentaDestino.PadLeft(2, "0"c)) 'tipo cta destino
+ sb.Append(FILLER_4CEROS) 'filler
+ sb.Append(DRow("RazonSocial").ToString.PadRight(15)) 'alias (15)
+ sb.Append(CLng(IVA).ToString("D15")) 'IVA ×100
+ sb.Append(DRow("RazonSocial").ToString.PadRight(250)) 'descripción (250)
+ sb.Append(If(String.IsNullOrEmpty(ReferenciaSPEI),
+ New String("0"c, 7),
+ ReferenciaSPEI)) 'referencia SPEI
+ sb.Append(If(String.IsNullOrEmpty(ClasificacionSPID),
+ "00",
+ ClasificacionSPID.PadLeft(2, "0"c))) 'clasif SPID
+ sb.Append(New String(" "c, 25)) 'filler final
+
+ If sb.Length <> DETALLE_LEN Then
+ Throw New InvalidOperationException($"Detalle #{consecPago} mide {sb.Length} bytes, debería {DETALLE_LEN}.")
+ End If
+
+ detalles.Add(sb.ToString())
+ consecArchivo += 1
+ consecPago += 1
+ totalCentavos += CLng(Importe * 100)
+ Next
+
+ ' --------------------------- Trailer (34 bytes) -------------------------
+ Dim totalLineas As Integer = 1 + DTDatos.Rows.Count + 1 'header + detalles + trailer
+ Dim trailer As String = $"09{totalLineas:D7}{DTDatos.Rows.Count:D7}{FILLER_8CEROS}{totalCentavos:D10}"
+ If trailer.Length <> TRAILER_LEN Then Throw New InvalidOperationException($"Trailer debe medir {TRAILER_LEN} bytes, mide {trailer.Length}.")
+
+ ' --------------------------- Resultado ----------------------------------
+ 'Return {header}.Concat(detalles).Concat({trailer})
+ End Sub
+
+ Private Function LimpiarDatosBajio(texto As String, maxLen As Integer, campo As String) As String
+
+ Dim _rxProhibidos As Regex = New Regex("[\$\,\./\-ñÑÁÉÍÓÚÜáéíóúü]", RegexOptions.Compiled)
+
+ If String.IsNullOrWhiteSpace(texto) Then
+ Throw New ArgumentException($"{campo} es obligatorio.")
+ End If
+
+ ' Normalizar y quitar diacríticos
+ Dim s = New String(texto.Normalize(NormalizationForm.FormD) _
+ .Where(Function(ch) CharUnicodeInfo.GetUnicodeCategory(ch) <> UnicodeCategory.NonSpacingMark) _
+ .ToArray()) _
+ .Normalize(NormalizationForm.FormC)
+
+ ' Eliminar caracteres prohibidos
+ s = _rxProhibidos.Replace(s, "")
+
+ If s.Length > maxLen Then
+ Throw New ArgumentException($"{campo} ({s}) excede {maxLen} caracteres.")
+ End If
+ Return s
+ End Function
+
+ Private Sub GeneraPagoScotiabank(dataTable As DataTable)
+ 'Throw New NotImplementedException()
+ End Sub
+
Private Sub GeneraPago(DTPendientesTemp As DataTable, Optional InsertaEnDB As Boolean = True, Optional NombreArchivoEnviado As String = "")
Dim RegistrosPago As New StringBuilder
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 505f8942e..8b1947ecb 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -18116,6 +18116,9 @@ Partial Class Compras_Compras
DdlIVA.Enabled = True
End If
+ If UsuarioActual.CveRol = 1 Then
+ TxtRetISRModal.Enabled = True
+ End If
UpPSS.Update()
RegistraScript("$('#divAddProducto').modal('show');")
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index 7176a8e4e..6d6c56058 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -1756,9 +1756,7 @@ Partial Class Compras_eFacturas
Dim PDfDestino As String = $"{UsuarioActual.Empresa.Ruta}\Compras\{FF.EmisorRFC}\{FF.CveFactura}.PDF"
- If RutaPDF = "" Then
-
-
+ If RutaPDF = "" Then ' llega sin pdf
'no valida nada solo lo crea y lo pone en la carpeta, no importa si ya existe
If SobreEscribirPDFSiExiste Then
@@ -9124,6 +9122,12 @@ Namespace ADS.eFacturas
Dim TmpArchivoQR As String = $"{Ruta}\Temp\Facturas\{Path.GetFileNameWithoutExtension(Fact.ArchivoXML)}-ttt.jpg"
Dim ArchivoXML As String = String.Format("{0}\Compras\{2}\{1}", DirectorioEmpresa, Fact.ArchivoXML, Fact.EmisorRFC)
Dim ArchivoPDF As String = String.Format("{0}\Compras\{2}\{1}.pdf", DirectorioEmpresa, Fact.CveFactura, Fact.EmisorRFC)
+
+ 'Validación si existe PDF no lo genera
+ If System.IO.File.Exists(ArchivoPDF) Then
+ Return True
+ End If
+
Dim dtotal As Decimal = If(Fact.Total <= 0.0D, 0.0001D, Fact.Total)
Dim cfdi As New RVCFDI33.GeneraCFDI()
diff --git a/Empresas/13/Formatos/CHQ-10.rdlc b/Empresas/13/Formatos/CHQ-10.rdlc
index bc1b247d2..3b497a9c7 100644
--- a/Empresas/13/Formatos/CHQ-10.rdlc
+++ b/Empresas/13/Formatos/CHQ-10.rdlc
@@ -594,61 +594,6 @@