Estatus:
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/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/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs
index 84b310d5c..03e1e139b 100644
--- a/Contabilidad/RepIVA.aspx.cs
+++ b/Contabilidad/RepIVA.aspx.cs
@@ -1,23 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.UI.WebControls;
-using Extensiones;
-using System.Data;
-using static Extensiones.ModExtensiones;
+using Extensiones;
using Microsoft.Reporting.WebForms;
-using System.Activities.Expressions;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
using System.Text;
-using System.IO;
-using CrystalDecisions.CrystalReports.Engine;
-using CrystalDecisions.Shared;
-using System.Diagnostics;
-using DocumentFormat.OpenXml.Drawing;
-using DocumentFormat.OpenXml.ExtendedProperties;
-using static Stimulsoft.Report.StiOptions;
-using System.Web.Services.Description;
-using System.Drawing;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using static Extensiones.ModExtensiones;
public partial class Contabilidad_RepIVA : ClsPaginas
{
@@ -75,7 +65,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
LnkTxtDIOT.Visible = true;
LnkExcelDIOT.Visible = true;
- DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:UsuarioActual.CveEmpresa, CveTipoCuenta:2);
+ DdlCuenta.DataSource = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa, CveTipoCuenta: 2);
DdlCuenta.DataBind();
DdlCuenta.Items.Insert(0, new ListItem("Todos", "-1"));
}
@@ -85,7 +75,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
if (TipoCambio == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
LblMsgAcreditable.Text = ""; // lbl de mensajes de negativos
-
+
if (TT.ActiveTabIndex == 0)
{
ClsContabilidad ObjCont = new ClsContabilidad();
@@ -146,8 +136,8 @@ public partial class Contabilidad_RepIVA : ClsPaginas
GvA.DataBind();
GvIVA2.DataBind();
GvRetIVA.DataBind();
- }
-
+ }
+
UpDatos.Update();
String Str = "Se Consultó el Reporte de IVA. - " + UsuarioActual.Usuario;
@@ -182,13 +172,13 @@ public partial class Contabilidad_RepIVA : ClsPaginas
}
if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0)
{
- // Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0));
+ // Decimal SubTotal = (e.Row.DBCampo("SubTotal16").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal16").ToDecimal() : (e.Row.DBCampo("SubTotal8").ToDecimal() != 0 ? e.Row.DBCampo("SubTotal8").ToDecimal() : (Decimal)0.0));
- Decimal dif = Math.Round(e.Row.DBCampo("SubTotal16").ToDecimal() * 0.16M, 2) + Math.Round(e.Row.DBCampo("SubTotal8").ToDecimal() * 0.08M , 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2);
+ Decimal dif = Math.Round(e.Row.DBCampo("SubTotal16").ToDecimal() * 0.16M, 2) + Math.Round(e.Row.DBCampo("SubTotal8").ToDecimal() * 0.08M, 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2);
if (Math.Abs(dif) > 1)
{
- e.Row.ForeColor = System.Drawing.Color.Red;
- e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err";
+ e.Row.ForeColor = System.Drawing.Color.Red;
+ e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err";
e.Row.ToolTip = "Dif:" + dif.ToString() + " - IVA:" + e.Row.DBCampo("IVA");
}
@@ -202,19 +192,37 @@ public partial class Contabilidad_RepIVA : ClsPaginas
protected void LnkPdf_Click(object sender, EventArgs e)
{
- Imprimir("PDF");
+ ImprimirCrystal("PDF");
}
protected void LnkExcel_Click(object sender, EventArgs e)
{
- Imprimir("EXCEL");
+ ImprimirGembox();
}
protected void LnkExcel2_Click(object sender, EventArgs e)
{
- Imprimir("EXCEL2");
+ ImprimirCrystal("EXCEL2");
}
- public void Imprimir(String Opcion)
+ private void ImprimirGembox()
+ {
+ String FechaF;
+ if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $"Fecha Final: {txtFechaF.Text}"; }
+ String FechaI;
+ if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $"Fecha Inicial: {txtFechaI.Text}"; }
+ String TipoMov;
+ if (DdlTipoMovto.SelectedItem.Text == "Todos") { TipoMov = ""; } else { TipoMov = $"Tipo Movimiento: {DdlTipoMovto.SelectedItem.Text}"; }
+
+ var filtros = $"Filtros: {FechaI} {FechaF} {TipoMov}";
+
+ GvA.ExportToExcelGembox("ReporteIVA", UsuarioActual, "Reporte de IVA", DatosFiltros: filtros);
+ }
+ public override void VerifyRenderingInServerForm(Control control)
+ {
+
+ }
+
+ public void ImprimirStimulsoft()
{
String FechaF;
if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $"
Fecha Final: {txtFechaF.Text}"; }
@@ -222,11 +230,94 @@ public partial class Contabilidad_RepIVA : ClsPaginas
if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $"
Fecha Inicial: {txtFechaI.Text}"; }
String TipoMov;
if (DdlTipoMovto.SelectedItem.Text == "Todos") { TipoMov = ""; } else { TipoMov = $"
Tipo Movimiento: {DdlTipoMovto.SelectedItem.Text}"; }
-
+
if (GvT.Rows.Count > 0 || GvA.Rows.Count > 0)
{
System.IO.FileInfo Imagen;
- // String logouri = "";
+
+ if (UsuarioActual.CveEmpresa.Contiene(119))
+ {
+ Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.jpg", UsuarioActual.Empresa.Ruta));
+ }
+ else
+ {
+ Imagen = new System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png");
+ }
+
+ List
para = new List();
+ para.Add(new ReportParameter("Empresa", UsuarioActual.Empresa.Empresa));
+ para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
+ para.Add(new ReportParameter("Filtros", $"Filtros: {FechaI}{FechaF}{TipoMov}"));
+
+ if (Imagen.Exists)
+ {
+ para.Add(new ReportParameter("LogoPath", Imagen.FullName));
+ }
+ else
+ {
+ para.Add(new ReportParameter("LogoPath", ""));
+ }
+
+ DataTable Dt = DtIVAAcreditable.Copy();
+ string Formato = "RepIVAAcreditable.mrt";
+
+
+ para.Add(new ReportParameter("Formato", "PDF"));
+
+ System.IO.FileInfo Archivo = new System.IO.FileInfo(string.Format("{0}/Formatos/{1}", UsuarioActual.Empresa.Ruta, Formato));
+ string Ruta = ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\Grales\Formatos\{Formato}";
+
+ List lrds = new List();
+
+ ReportDataSource rds = new ReportDataSource();
+ rds.Name = "RepIVAAcreditable";
+ rds.Value = Dt;
+ lrds.Add(rds);
+
+ if (DtIEPSA != null)
+ {
+ ReportDataSource rds2 = new ReportDataSource();
+ rds2.Name = "IEPSPorcentaje";
+ rds2.Value = DtIEPSA;
+ lrds.Add(rds2);
+ }
+
+ if (DtIVAA != null)
+ {
+ ReportDataSource rds3 = new ReportDataSource();
+ rds3.Name = "IVAPorcentaje";
+ rds3.Value = DtIVAA;
+ lrds.Add(rds3);
+ }
+
+ string Extension = "pdf";
+
+ var bytes = StreamBytesStimul("Facturas", Ruta, lrds, para, NombreArchivo: "Reporte de IVA", Formato: "PDF", NombreDataSource: "DtDatos");
+
+ ImprimirbytesPDF(bytes, "Reporte de IVA", Formato, Content_Disposition: "attachment", Extension: Extension);
+
+ Ruta.GuardaLogAD();
+ }
+ else
+ {
+ Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia);
+ }
+ }
+
+
+ public void ImprimirCrystal(String Opcion)
+ {
+ String FechaF;
+ if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = "-1"; } else { FechaF = $" Fecha Final: {txtFechaF.Text}"; }
+ String FechaI;
+ if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = "-1"; } else { FechaI = $" Fecha Inicial: {txtFechaI.Text}"; }
+ String TipoMov;
+ if (DdlTipoMovto.SelectedItem.Text == "Todos") { TipoMov = ""; } else { TipoMov = $" Tipo Movimiento: {DdlTipoMovto.SelectedItem.Text}"; }
+
+ if (GvT.Rows.Count > 0 || GvA.Rows.Count > 0)
+ {
+ System.IO.FileInfo Imagen;
+ // String logouri = "";
if (UsuarioActual.CveEmpresa.Contiene(119))
{
@@ -277,7 +368,8 @@ public partial class Contabilidad_RepIVA : ClsPaginas
//ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, new DataTable(), new DataTable(), "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
}
- }else
+ }
+ else
{
Ruta = ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\Grales\Formatos\{Formato}";
//ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, DtIEPSA, DtIVAA, "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
@@ -334,7 +426,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{
StringBuilder SBDIOT = new StringBuilder();
- int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
+ int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
using (var Objconta = new ClsContabilidad())
{
@@ -579,12 +671,12 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{
ClsContabilidad Objconta = new ClsContabilidad();
-
+
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
- if (Objconta.GetRepIVAComparativo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa ))
+ if (Objconta.GetRepIVAComparativo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa))
{
- GvCompara.DataSource = Objconta.DtResultados;
+ GvCompara.DataSource = Objconta.DtResultados;
}
Objconta.Dispose();
@@ -744,11 +836,11 @@ public partial class Contabilidad_RepIVA : ClsPaginas
protected void GvIEPSA_RowDataBound(object sender, GridViewRowEventArgs e)
{
- if(e.Row.RowType == DataControlRowType.DataRow && e.Row.DataKey("PorcentajeIEPS").Trim() == "")
+ if (e.Row.RowType == DataControlRowType.DataRow && e.Row.DataKey("PorcentajeIEPS").Trim() == "")
{
e.Row.Cells[0].Text = "Total";
e.Row.Font.Bold = true;
- }
+ }
}
protected void GvIVAA_RowDataBound(object sender, GridViewRowEventArgs e)
{
@@ -756,7 +848,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{
e.Row.Cells[0].Text = "Total";
e.Row.Font.Bold = true;
- }
+ }
}
protected void GvIVA2_RowDataBound(object sender, GridViewRowEventArgs e)
{
@@ -764,7 +856,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{
e.Row.Cells[0].Text = "Total";
e.Row.Font.Bold = true;
- }
+ }
}
protected void GvRetIVA_RowDataBound(object sender, GridViewRowEventArgs e)
{
@@ -773,14 +865,14 @@ public partial class Contabilidad_RepIVA : ClsPaginas
e.Row.Cells[0].Text = "Total";
e.Row.Font.Bold = true;
- }
+ }
}
protected void LnkExcelDIOT_Click(object sender, EventArgs e)
{
ClsContabilidad Objconta = new ClsContabilidad();
StringBuilder SBDIOT = new StringBuilder();
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
-
+
if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
{
DataTable TmpDIOT = new DataTable("DIOT");
@@ -794,13 +886,13 @@ public partial class Contabilidad_RepIVA : ClsPaginas
TmpDIOT.Columns.Add("Actos16", typeof(string)); TmpDIOT.Columns.Add("ActosDev16", typeof(string));
TmpDIOT.Columns.Add("ActosImp16", typeof(string)); TmpDIOT.Columns.Add("ActosImpDev16", typeof(string));
TmpDIOT.Columns.Add("ActosImpNotan16", typeof(string)); TmpDIOT.Columns.Add("ActosImpNotanDev16", typeof(string));
-
+
TmpDIOT.Columns.Add("AcredFN", typeof(string)); TmpDIOT.Columns.Add("AcreNoFN", typeof(string));
TmpDIOT.Columns.Add("AcredFS", typeof(string)); TmpDIOT.Columns.Add("AcredNoFS", typeof(string));
TmpDIOT.Columns.Add("Acred16", typeof(string)); TmpDIOT.Columns.Add("AcredIva16", typeof(string));
TmpDIOT.Columns.Add("AcredImp16", typeof(string)); TmpDIOT.Columns.Add("AcredNoImp16", typeof(string));
TmpDIOT.Columns.Add("AcredImpIntan16", typeof(string)); TmpDIOT.Columns.Add("AcredNoImpIntan16", typeof(string));
-
+
TmpDIOT.Columns.Add("NoAcredFN", typeof(string)); TmpDIOT.Columns.Add("NoAcredNoFN", typeof(string));
TmpDIOT.Columns.Add("NoAcredExentaFN", typeof(string)); TmpDIOT.Columns.Add("NoAcredNoObjetoFN", typeof(string));
TmpDIOT.Columns.Add("NoAcredFS", typeof(string)); TmpDIOT.Columns.Add("NoAcredNoFS", typeof(string));
@@ -890,7 +982,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
}
Objconta.Dispose();
TmpDIOT.Columns[0].ColumnName = "01- Tipo de tercero\r\n"; TmpDIOT.Columns[1].ColumnName = "02 -Tipo de operación\r\n";
- TmpDIOT.Columns[2].ColumnName = "03- RFC\r\n"; TmpDIOT.Columns[3].ColumnName = "04 - ID Fiscal";
+ TmpDIOT.Columns[2].ColumnName = "03- RFC\r\n"; TmpDIOT.Columns[3].ColumnName = "04 - ID Fiscal";
TmpDIOT.Columns[4].ColumnName = "05- Nombre del Extranjero\r\n"; TmpDIOT.Columns[5].ColumnName = "06 - País de residencia\r\n";
TmpDIOT.Columns[6].ColumnName = "07- Jurisdicción Fiscal\r\n"; TmpDIOT.Columns[7].ColumnName = "08 - Actividades pagadas RFN\r\n";
TmpDIOT.Columns[8].ColumnName = "09- Devoluciones, Descuentos y Bonificaciones RFN\r\n"; TmpDIOT.Columns[9].ColumnName = "10 - Actividades pagadas RFS\r\n";
@@ -921,7 +1013,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
TmpDIOT.Columns[50].ColumnName = "51 - Valor de actos o actividades 0%\r\n"; TmpDIOT.Columns[51].ColumnName = "52 -Valor de actos o actividades no objeto en territorio nacional\r\n";
TmpDIOT.Columns[52].ColumnName = "53 - Valor de actos o actividades no objeto sin establecimiento en territorio nacional\r\n"; TmpDIOT.Columns[53].ColumnName = "54 - Efectos fiscales a los comprobantes de operaciones realizadas con el proveedor\r\n";
- TmpDIOT.ExportToExcelG("DIOT_"+ txtFechaI.Text,"Reporte DIOT");
+ TmpDIOT.ExportToExcelG("DIOT_" + txtFechaI.Text, "Reporte DIOT");
}
}
}
\ No newline at end of file
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 @@