This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-06-16 10:06:17 -07:00
parent 7fbcf01ed7
commit 88d77479a3
2 changed files with 39 additions and 31 deletions

View File

@@ -37,6 +37,9 @@
<asp:PostBackTrigger ControlID="LnkAccionesDIOT" /> <asp:PostBackTrigger ControlID="LnkAccionesDIOT" />
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>
<li>
<asp:LinkButton ID="LnkExcel2" OnClick="LnkExcel2_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Generales del proveedor</asp:LinkButton>
</li>
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -87,7 +87,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
if (DtIVAAcreditable.FiltraParametros("IVA < 0 OR IEPS < 0 ").Rows.Count > 0) if (DtIVAAcreditable.FiltraParametros("IVA < 0 OR IEPS < 0 ").Rows.Count > 0)
{ {
LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT"; LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT";
} }
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
@@ -130,17 +130,17 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{ {
e.Row.CssClass = "Totales"; e.Row.CssClass = "Totales";
} }
if (e.Row.DBCampo("PorcentajeIVA").ToDecimal() > 0 ) 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(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2); Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2);
if (dif > 1) if (dif > 1)
{ {
e.Row.ForeColor = System.Drawing.Color.Red; e.Row.ForeColor = System.Drawing.Color.Red;
e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err"; e.Row.Cells[0].Text = e.Row.Cells[0].Text + "Err";
e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + e.Row.DBCampo("SubTotal")+ " - IVA:"+ e.Row.DBCampo("IVA"); e.Row.ToolTip = "Dif:" + dif.ToString() + "- Sub:" + e.Row.DBCampo("SubTotal") + " - IVA:" + e.Row.DBCampo("IVA");
} }
} }
} }
@@ -155,6 +155,10 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{ {
Imprimir("EXCEL"); Imprimir("EXCEL");
} }
protected void LnkExcel2_Click(object sender, EventArgs e)
{
Imprimir("EXCEL2");
}
public void Imprimir(String Opcion) public void Imprimir(String Opcion)
{ {
@@ -192,11 +196,12 @@ public partial class Contabilidad_RepIVA : ClsPaginas
} }
DataTable Dt = TT.ActiveTabIndex == 0 ? DtIVATrasladado.Copy() : DtIVAAcreditable.Copy(); DataTable Dt = TT.ActiveTabIndex == 0 ? DtIVATrasladado.Copy() : DtIVAAcreditable.Copy();
string Formato = TT.ActiveTabIndex == 0 ? "RepIVA.rpt" : "RepIVAAcreditable.rpt"; string Formato = TT.ActiveTabIndex == 0 ? "RepIVA.rpt" : (Opcion == "EXCEL2" ? "RepIVAAcreditable2.rpt" : "RepIVAAcreditable.rpt");
Opcion = (Opcion == "EXCEL2" ? "EXCEL" : Opcion);
para.Add(new CrystalParametro("Excel", Formato)); para.Add(new CrystalParametro("Excel", Formato));
string Ruta = (ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\Grales\Formatos\{Formato}"); string Ruta = (ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\Grales\Formatos\{Formato}");
Ruta.GuardaLogAD(); Ruta.GuardaLogAD();
ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt,para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion); ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
} }
else else
{ {
@@ -251,14 +256,14 @@ public partial class Contabilidad_RepIVA : ClsPaginas
SBDIOT.AppendLine( SBDIOT.AppendLine(
Drow["TipoTercero"].ToString() + "|" + Drow["TipoTercero"].ToString() + "|" +
Drow["TipoOperacion"].ToString() + "|" + Drow["TipoOperacion"].ToString() + "|" +
Drow["RFC"].ToString() +"|"+ Drow["RFC"].ToString() + "|" +
Drow["NumeroIDFiscal"].ToString() + "|" + Drow["NumeroIDFiscal"].ToString() + "|" +
Drow["NombreExtranjero"].ToString() +"|"+ Drow["NombreExtranjero"].ToString() + "|" +
Drow["PaisResidencia"].ToString() + "|" + Drow["PaisResidencia"].ToString() + "|" +
Drow["Nacionalidad"].ToString() +"|"+ Drow["Nacionalidad"].ToString() + "|" +
LV(Drow["valorActos1516"].ToString()) + "|"+ LV(Drow["valorActos1516"].ToString()) + "|" +
LV(Drow["valorActos15"].ToString()) + "|" + LV(Drow["valorActos15"].ToString()) + "|" +
LV(Drow["ValorIvaNo1516"].ToString()) +"|"+ LV(Drow["ValorIvaNo1516"].ToString()) + "|" +
LV(Drow["valorActos1011"].ToString()) + "|" + LV(Drow["valorActos1011"].ToString()) + "|" +
LV(Drow["valorActos10"].ToString()) + "|" + LV(Drow["valorActos10"].ToString()) + "|" +
@@ -272,9 +277,9 @@ public partial class Contabilidad_RepIVA : ClsPaginas
LV(Drow["valorActosImp10"].ToString()) + "|" + LV(Drow["valorActosImp10"].ToString()) + "|" +
LV(Drow["ValorIvaNoImp10"].ToString()) + "|" + LV(Drow["ValorIvaNoImp10"].ToString()) + "|" +
LV(Drow["IvaExentoImpo"].ToString()) + "|"+ LV(Drow["IvaExentoImpo"].ToString()) + "|" +
LV(Drow["IVACero"].ToString()) + "|" + LV(Drow["IVACero"].ToString()) + "|" +
LV(Drow["IvaExento"].ToString()) + "|"+ LV(Drow["IvaExento"].ToString()) + "|" +
LV(Drow["IvaRetenido"].ToString()) + "|" + LV(Drow["IvaRetenido"].ToString()) + "|" +
LV(Drow["IvaDevoluciones"].ToString()) + "|"); LV(Drow["IvaDevoluciones"].ToString()) + "|");
} }
@@ -310,7 +315,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
Response.End(); Response.End();
} }
protected string LV(string Valor ) protected string LV(string Valor)
{ {
return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : ""; return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : "";
} }