This commit is contained in:
@@ -37,6 +37,9 @@
|
||||
<asp:PostBackTrigger ControlID="LnkAccionesDIOT" />
|
||||
</Triggers>
|
||||
</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 ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -43,7 +43,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaValores();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
TCEspecifico = -1;
|
||||
txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}";
|
||||
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
||||
|
||||
LnkAccionesDIOT.Visible = true;
|
||||
|
||||
LnkAccionesDIOT.Visible = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -84,17 +84,17 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
{
|
||||
GvA.DataSource = ObjCont.DtResultados;
|
||||
DtIVAAcreditable = ObjCont.DtResultados;
|
||||
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";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvIVA2.DataSource = ObjCont.DtResultados;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
ObjCont.Dispose();
|
||||
@@ -130,19 +130,19 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
}
|
||||
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) );
|
||||
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 dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2);
|
||||
if (dif > 1)
|
||||
{
|
||||
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");
|
||||
}
|
||||
protected void LnkExcel2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Imprimir("EXCEL2");
|
||||
}
|
||||
|
||||
public void Imprimir(String Opcion)
|
||||
{
|
||||
@@ -192,11 +196,12 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
}
|
||||
|
||||
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));
|
||||
string Ruta = (ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\Grales\Formatos\{Formato}");
|
||||
Ruta.GuardaLogAD();
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt,para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
|
||||
Ruta.GuardaLogAD();
|
||||
ImprimirbytesPDF(ImprimirPDFCrystal(Ruta, Dt, para, "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -248,17 +253,17 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
|
||||
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()) + "|"+
|
||||
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["ValorIvaNo1516"].ToString()) + "|" +
|
||||
|
||||
LV(Drow["valorActos1011"].ToString()) + "|" +
|
||||
LV(Drow["valorActos10"].ToString()) + "|" +
|
||||
@@ -270,11 +275,11 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
LV(Drow["ValorIvaNoImp16"].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["IvaExento"].ToString()) + "|"+
|
||||
LV(Drow["IvaExento"].ToString()) + "|" +
|
||||
LV(Drow["IvaRetenido"].ToString()) + "|" +
|
||||
LV(Drow["IvaDevoluciones"].ToString()) + "|");
|
||||
}
|
||||
@@ -286,7 +291,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
//TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8);
|
||||
|
||||
//tw.Write(SBDIOT.ToString());
|
||||
|
||||
|
||||
//tw.Flush();
|
||||
|
||||
//byte[] bytes = ms.ToArray();
|
||||
@@ -310,7 +315,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
Response.End();
|
||||
}
|
||||
|
||||
protected string LV(string Valor )
|
||||
protected string LV(string Valor)
|
||||
{
|
||||
return (Valor.ToDecimal() > 0) ? Valor.ToDecimal().ToString().FormatoNumero(0).Replace(",", string.Empty) : "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user