diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx
index 334824b57..1ce1ea9f3 100644
--- a/Contabilidad/RepIVA.aspx
+++ b/Contabilidad/RepIVA.aspx
@@ -30,9 +30,9 @@
Generar DIOT
-
- Excel DIOT
-
+
+ Excel DIOT
+
@@ -174,7 +174,7 @@
IEPS por Porcentaje
+ OnRowDataBound="GvIEPSA_RowDataBound" DataKeyNames="PorcentajeIEPS">
@@ -187,8 +187,8 @@
IVA por Porcentaje
-
+ OnRowDataBound="GvIVAA_RowDataBound" DataKeyNames="PorcentajeIVA">
+
@@ -213,7 +213,7 @@
- <%-- --%>
+ <%-- --%>
SubTotal
16%
@@ -222,7 +222,7 @@
-
+
SubTotal
Imp. 16%
@@ -231,16 +231,16 @@
- <%-- --%>
+ <%-- --%>
SubTotal
8%
-
+
- <%-- --%>
+ <%-- --%>
SubTotal
0%
@@ -318,6 +318,14 @@
+
+
+ SubTotal
Imp. No Tan.16%
+
+
+
+
+
@@ -325,7 +333,7 @@
IVA por Porcentaje
+ OnRowDataBound="GvIVA2_RowDataBound" DataKeyNames="PorcentajeIVA">
@@ -337,7 +345,7 @@
Ret IVA
+ OnRowDataBound="GvRetIVA_RowDataBound" DataKeyNames="TipoRetIVA">
diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs
index b78bd060f..8b761791e 100644
--- a/Contabilidad/RepIVA.aspx.cs
+++ b/Contabilidad/RepIVA.aspx.cs
@@ -333,124 +333,152 @@ public partial class Contabilidad_RepIVA : ClsPaginas
protected void LnkTxtDIOT_Click(object sender, EventArgs e)
{
- ClsContabilidad Objconta = new ClsContabilidad();
StringBuilder SBDIOT = new StringBuilder();
- int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
+ int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
- if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
+ using (var Objconta = new ClsContabilidad())
{
- if (txtFechaI.Text.ToDate() < "2024/12/31".ToDate()) // años anteriores al enero 2025
+ if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
{
- foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0)
+ if (txtFechaI.Text.ToDate() < "2024/12/31".ToDate()) // años anteriores al enero 2025
{
- SBDIOT.AppendLine(
- Drow["TipoTercero"].ToString() + "|" +
- Drow["TipoOperacion"].ToString() + "|" +
- Drow["RFC"].ToString() + "|" +
- Drow["NumeroIDFiscal"].ToString() + "|" +
- Drow["NombreExtranjero"].ToString() + "|" +
- Drow["PaisResidencia"].ToString() + "|" +
- Drow["Nacionalidad"].ToString() + "|" +
- LV(Drow["valorActos1516"].ToString()) + "|" +
- LV(Drow["valorActos15"].ToString()) + "|" +
- LV(Drow["ValorIvaNo1516"].ToString()) + "|" +
+ foreach (DataRow Drow in Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 and SubTotal >= 1 ").Rows) // and(IVA > 1 OR IEPS > 0)
+ {
+ SBDIOT.AppendLine(
+ Drow["TipoTercero"].ToString() + "|" +
+ Drow["TipoOperacion"].ToString() + "|" +
+ Drow["RFC"].ToString() + "|" +
+ Drow["NumeroIDFiscal"].ToString() + "|" +
+ Drow["NombreExtranjero"].ToString() + "|" +
+ Drow["PaisResidencia"].ToString() + "|" +
+ Drow["Nacionalidad"].ToString() + "|" +
+ LV(Drow["valorActos1516"].ToString()) + "|" +
+ LV(Drow["valorActos15"].ToString()) + "|" +
+ LV(Drow["ValorIvaNo1516"].ToString()) + "|" +
- LV(Drow["valorActos1011"].ToString()) + "|" +
- LV(Drow["valorActos10"].ToString()) + "|" +
- LV(Drow["valorActosImp8"].ToString()) + "|" +
- LV(Drow["ValorIvaNo10"].ToString()) + "|" +
- LV(Drow["ValorIvaNo08"].ToString()) + "|" +
+ LV(Drow["valorActos1011"].ToString()) + "|" +
+ LV(Drow["valorActos10"].ToString()) + "|" +
+ LV(Drow["valorActosImp8"].ToString()) + "|" +
+ LV(Drow["ValorIvaNo10"].ToString()) + "|" +
+ LV(Drow["ValorIvaNo08"].ToString()) + "|" +
- LV(Drow["valorActosImp1516"].ToString()) + "|" +
- LV(Drow["ValorIvaNoImp16"].ToString()) + "|" +
+ LV(Drow["valorActosImp1516"].ToString()) + "|" +
+ LV(Drow["ValorIvaNoImp16"].ToString()) + "|" +
- LV(Drow["valorActosImp10"].ToString()) + "|" +
- LV(Drow["ValorIvaNoImp10"].ToString()) + "|" +
+ LV(Drow["valorActosImp10"].ToString()) + "|" +
+ LV(Drow["ValorIvaNoImp10"].ToString()) + "|" +
- LV(Drow["IvaExentoImpo"].ToString()) + "|" +
- LV(Drow["IVACero"].ToString()) + "|" +
- LV(Drow["IvaExento"].ToString()) + "|" +
- LV(Drow["IvaRetenido"].ToString()) + "|" +
- LV(Drow["IvaDevoluciones"].ToString()) + "|");
+ LV(Drow["IvaExentoImpo"].ToString()) + "|" +
+ LV(Drow["IVACero"].ToString()) + "|" +
+ LV(Drow["IvaExento"].ToString()) + "|" +
+ LV(Drow["IvaRetenido"].ToString()) + "|" +
+ LV(Drow["IvaDevoluciones"].ToString()) + "|");
+ }
}
- }
- else
- {
- DataTable dtt = new DataTable();
- dtt = Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 AND ( ActosFN > 0 OR ActosFS > 0 OR Actos16 > 0 OR ActosImp16 > 0 OR ActosImpNotan16 > 0 OR DATasa0 > 0 OR DANoObjetoTN > 0 OR DANoObjetoNoTN > 0 OR NoAcredFN > 0 OR NoAcredNoFN > 0 OR NoAcredNo16 > 0 )");
- //acumula los prov, globales en un solo registro
- dtt = AcumularYReemplazar(dtt);
-
- foreach (DataRow Drow in dtt.Rows)
+ else
{
- SBDIOT.AppendLine(
- Drow["TipoTercero"].ToString() + "|" +
- Drow["TipoOperacion"].ToString() + "|" +
- Drow["RFC_DIOT"].ToString() + "|" +
- Drow["NumeroIDFiscal"].ToString() + "|" +
- Drow["NombreExtranjero"].ToString() + "|" +
- Drow["PaisResidenciaFiscal"].ToString() + "|" +
- Drow["Jurisdiccion"].ToString() + "|" +
- // 3.2 valor de los actos o actividades
- LV(Drow["ActosFN"].ToString()) + "|" + // actos norte
- LV(Drow["ActosDevFN"].ToString()) + "|" + // desc norte
- LV(Drow["ActosFS"].ToString()) + "|" + // actos sur
- LV(Drow["ActosDevFS"].ToString()) + "|" + // desc sur
- LV(Drow["Actos16"].ToString()) + "|" + // 16%
- LV(Drow["ActosDev16"].ToString()) + "|" + // desc 16%
- LV(Drow["ActosImp16"].ToString()) + "|" + // importacion 16%
- LV(Drow["ActosImpDev16"].ToString()) + "|" + // desc importacion 16%
- LV(Drow["ActosImpNotan16"].ToString()) + "|" + // importacion intangibles 16%
- LV(Drow["ActosImpNotanDev16"].ToString()) + "|" + // desc intangibles 16%
- // 3.3 IVA Acreditable
- LV(Drow["AcredFN"].ToString()) + "|" + // actos norte
- LV(Drow["AcreNoFN"].ToString()) + "|" + // proporcion actos norte
- LV(Drow["AcredFS"].ToString()) + "|" + // actos sur
- LV(Drow["AcredNoFS"].ToString()) + "|" + // proporcion actos sur
- LV(Drow["Acred16"].ToString()) + "|" + // 16%
- LV(Drow["AcredIva16"].ToString()) + "|" + // proporcion 16%
- LV(Drow["AcredImp16"].ToString()) + "|" + // importacion 16%
- LV(Drow["AcredNoImp16"].ToString()) + "|" + // proporción importacion 16%
- LV(Drow["AcredImpIntan16"].ToString()) + "|" + // intangibles 16%
- LV(Drow["AcredNoImpIntan16"].ToString()) + "|" + // proporcion intangibles 16%
- // 3.4 IVA NO Acreditable
- LV(Drow["NoAcredFN"].ToString()) + "|" +
- LV(Drow["NoAcredNoFN"].ToString()) + "|" +
- LV(Drow["NoAcredExentaFN"].ToString()) + "|" +
- LV(Drow["NoAcredNoObjetoFN"].ToString()) + "|" +
- LV(Drow["NoAcredFS"].ToString()) + "|" +
- LV(Drow["NoAcredNoFS"].ToString()) + "|" +
- LV(Drow["NoAcredExentaFS"].ToString()) + "|" +
- LV(Drow["NoAcredNoObjetoFS"].ToString()) + "|" +
- LV(Drow["NoAcred16"].ToString()) + "|" +
- LV(Drow["NoAcredNo16"].ToString()) + "|" +
- LV(Drow["NoAcredExenta16"].ToString()) + "|" +
- LV(Drow["NoAcredNoObjeto16"].ToString()) + "|" +
+ DataTable dtt = new DataTable();
+ dtt = Objconta.DtResultados.FiltraParametros("CveCompra is null and CveProveedor > 0 AND ( ActosFN > 0 OR ActosFS > 0 OR Actos16 > 0 OR ActosImp16 > 0 OR ActosImpNotan16 > 0 OR DATasa0 > 0 OR DANoObjetoTN > 0 OR DANoObjetoNoTN > 0 OR NoAcredFN > 0 OR NoAcredNoFN > 0 OR NoAcredNo16 > 0 )");
+ //acumula los prov, globales en un solo registro
+ dtt = AcumularYReemplazar(dtt);
- LV(Drow["NoAcredTan16"].ToString()) + "|" +
- LV(Drow["NoAcredTanNo16"].ToString()) + "|" +
- LV(Drow["NoAcredTanExenta16"].ToString()) + "|" +
- LV(Drow["NoAcredTanNoObjeto16"].ToString()) + "|" +
- LV(Drow["NoAcredImpIntan16"].ToString()) + "|" +
- LV(Drow["NoAcredImpIntanNo16"].ToString()) + "|" +
- LV(Drow["NoAcredImpIntanExenta16"].ToString()) + "|" +
- LV(Drow["NoAcredImpIntanNoObjeto16"].ToString()) + "|" +
- // 3.5 datos adicionales
- LV(Drow["DAIvaRetenido"].ToString()) + "|" + // VA retenido por el contribuyente
- LV(Drow["DAIvaExentoImpo"].ToString()) + "|" + //Actos o actividades pagados en la importación de bienes y servicios por los que no se pagara el IVA (Exentos)
- LV(Drow["DAIvaExento"].ToString()) + "|" + // Actos o actividades pagados por los que no se pagará el IVA(Exentos)
- LV(Drow["DATasa0"].ToString()) + "|" + // Demás actos o actividades pagados a la tasa del 0%
- LV(Drow["DANoObjetoTN"].ToString()) + "|" + // Actos o actividades no objeto del IVA realizados en
- LV(Drow["DANoObjetoNoTN"].ToString()) + "|" + // Actos o actividades no objeto del IVA por no contar on establecimiento en territorio nacion
- (Drow["DAManifiesto"].ToString())); // Manifiesto que se dio efectos fiscales a los comprobantes que amparan las operaciones realizadas con el proveedor
-
+ var dtSinTipoOperacion = dtt.FiltraParametros("GrpId = 1 AND ISNULL(TipoOperacion,'') = ''");
+
+ if (dtSinTipoOperacion != null && dtSinTipoOperacion.Rows.Count > 0)
+ {
+ var SbSinTipo = new StringBuilder();
+ SbSinTipo.Append("Los siguientes proveedores no tienen especificado el tipo de operación:
");
+ foreach (DataRow row in dtSinTipoOperacion.Rows)
+ {
+ SbSinTipo.AppendFormat("{0}-{1}
", row["RFC"], row["RazonSocial"]);
+ }
+ Alert(SbSinTipo.ToString(), TipoMensaje.MsgAdvertencia);
+ }
+ else
+ {
+ foreach (DataRow Drow in dtt.Rows)
+ {
+ SBDIOT.AppendLine(
+ Drow["TipoTercero"].ToString() + "|" +
+ Drow["TipoOperacion"].ToString() + "|" +
+ Drow["RFC_DIOT"].ToString() + "|" +
+ Drow["NumeroIDFiscal"].ToString() + "|" +
+ Drow["NombreExtranjero"].ToString() + "|" +
+ Drow["PaisResidenciaFiscal"].ToString() + "|" +
+ Drow["Jurisdiccion"].ToString() + "|" +
+ // 3.2 valor de los actos o actividades
+ LV(Drow["ActosFN"].ToString()) + "|" + // actos norte
+ LV(Drow["ActosDevFN"].ToString()) + "|" + // desc norte
+ LV(Drow["ActosFS"].ToString()) + "|" + // actos sur
+ LV(Drow["ActosDevFS"].ToString()) + "|" + // desc sur
+ LV(Drow["Actos16"].ToString()) + "|" + // 16%
+ LV(Drow["ActosDev16"].ToString()) + "|" + // desc 16%
+ LV(Drow["ActosImp16"].ToString()) + "|" + // importacion 16%
+ LV(Drow["ActosImpDev16"].ToString()) + "|" + // desc importacion 16%
+ LV(Drow["ActosImpNotan16"].ToString()) + "|" + // importacion intangibles 16%
+ LV(Drow["ActosImpNotanDev16"].ToString()) + "|" + // desc intangibles 16%
+ // 3.3 IVA Acreditable
+ LV(Drow["AcredFN"].ToString()) + "|" + // actos norte
+ LV(Drow["AcreNoFN"].ToString()) + "|" + // proporcion actos norte
+ LV(Drow["AcredFS"].ToString()) + "|" + // actos sur
+ LV(Drow["AcredNoFS"].ToString()) + "|" + // proporcion actos sur
+ LV(Drow["Acred16"].ToString()) + "|" + // 16%
+ LV(Drow["AcredIva16"].ToString()) + "|" + // proporcion 16%
+ LV(Drow["AcredImp16"].ToString()) + "|" + // importacion 16%
+ LV(Drow["AcredNoImp16"].ToString()) + "|" + // proporción importacion 16%
+ LV(Drow["AcredImpIntan16"].ToString()) + "|" + // intangibles 16%
+ LV(Drow["AcredNoImpIntan16"].ToString()) + "|" + // proporcion intangibles 16%
+ // 3.4 IVA NO Acreditable
+ LV(Drow["NoAcredFN"].ToString()) + "|" +
+ LV(Drow["NoAcredNoFN"].ToString()) + "|" +
+ LV(Drow["NoAcredExentaFN"].ToString()) + "|" +
+ LV(Drow["NoAcredNoObjetoFN"].ToString()) + "|" +
+ LV(Drow["NoAcredFS"].ToString()) + "|" +
+ LV(Drow["NoAcredNoFS"].ToString()) + "|" +
+ LV(Drow["NoAcredExentaFS"].ToString()) + "|" +
+ LV(Drow["NoAcredNoObjetoFS"].ToString()) + "|" +
+ LV(Drow["NoAcred16"].ToString()) + "|" +
+ LV(Drow["NoAcredNo16"].ToString()) + "|" +
+ LV(Drow["NoAcredExenta16"].ToString()) + "|" +
+ LV(Drow["NoAcredNoObjeto16"].ToString()) + "|" +
+
+ LV(Drow["NoAcredTan16"].ToString()) + "|" +
+ LV(Drow["NoAcredTanNo16"].ToString()) + "|" +
+ LV(Drow["NoAcredTanExenta16"].ToString()) + "|" +
+ LV(Drow["NoAcredTanNoObjeto16"].ToString()) + "|" +
+ LV(Drow["NoAcredImpIntan16"].ToString()) + "|" +
+ LV(Drow["NoAcredImpIntanNo16"].ToString()) + "|" +
+ LV(Drow["NoAcredImpIntanExenta16"].ToString()) + "|" +
+ LV(Drow["NoAcredImpIntanNoObjeto16"].ToString()) + "|" +
+ // 3.5 datos adicionales
+ LV(Drow["DAIvaRetenido"].ToString()) + "|" + // VA retenido por el contribuyente
+ LV(Drow["DAIvaExentoImpo"].ToString()) + "|" + //Actos o actividades pagados en la importación de bienes y servicios por los que no se pagara el IVA (Exentos)
+ LV(Drow["DAIvaExento"].ToString()) + "|" + // Actos o actividades pagados por los que no se pagará el IVA(Exentos)
+ LV(Drow["DATasa0"].ToString()) + "|" + // Demás actos o actividades pagados a la tasa del 0%
+ LV(Drow["DANoObjetoTN"].ToString()) + "|" + // Actos o actividades no objeto del IVA realizados en
+ LV(Drow["DANoObjetoNoTN"].ToString()) + "|" + // Actos o actividades no objeto del IVA por no contar on establecimiento en territorio nacion
+ (Drow["DAManifiesto"].ToString())); // Manifiesto que se dio efectos fiscales a los comprobantes que amparan las operaciones realizadas con el proveedor
+
+ }
+
+ Response.Clear();
+ Response.ClearHeaders();
+
+ Response.AppendHeader("Content-Length", SBDIOT.ToString().Length.ToString());
+ Response.ContentType = "text/plain";
+ Response.AppendHeader("Content-Disposition", $"attachment;filename=DIOT_{txtFechaI.Text.ToDate().ToString("ddMMyyyy")}_{txtFechaI.Text.ToDate().ToString("ddMMyyyy")}.txt");
+
+ Response.Write(SBDIOT.ToString());
+ Response.End();
+ }
}
-
+
}
-
+
}
- Objconta.Dispose();
+
+
//MemoryStream ms = new MemoryStream();
//TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8);
@@ -469,15 +497,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
//Response.BinaryWrite(bytes);
//Response.End();
- Response.Clear();
- Response.ClearHeaders();
- Response.AppendHeader("Content-Length", SBDIOT.ToString().Length.ToString());
- Response.ContentType = "text/plain";
- Response.AppendHeader("Content-Disposition", $"attachment;filename=DIOT_{ txtFechaI.Text.ToDate().ToString("ddMMyyyy") }_{txtFechaI.Text.ToDate().ToString("ddMMyyyy") }.txt");
-
- Response.Write(SBDIOT.ToString());
- Response.End();
}
static DataTable AcumularYReemplazar(DataTable dt)