nueva sección de Retención de IVA para Proveedores

This commit is contained in:
2023-05-10 13:04:57 -07:00
parent 0ef424be2f
commit 05706a1fc5
2 changed files with 78 additions and 59 deletions

View File

@@ -200,6 +200,7 @@
<ajax:TabPanel ID="TA" runat="server" HeaderText="IVA Acreditable"> <ajax:TabPanel ID="TA" runat="server" HeaderText="IVA Acreditable">
<ContentTemplate> <ContentTemplate>
<div class="row">
<h4><b>IVA Acreditable</b></h4> <h4><b>IVA Acreditable</b></h4>
<asp:Label ID="LblMsgAcreditable" runat="server" Text="" ForeColor="Red"></asp:Label> <asp:Label ID="LblMsgAcreditable" runat="server" Text="" ForeColor="Red"></asp:Label>
<asp:GridView ID="GvA" runat="server" EmptyDataText="No se encontraron datos con los filtros seleccionados" OnRowDataBound="GvIVAAcreditable_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="99%" GridLines="None" AutoGenerateColumns="false"> <asp:GridView ID="GvA" runat="server" EmptyDataText="No se encontraron datos con los filtros seleccionados" OnRowDataBound="GvIVAAcreditable_RowDataBound" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="99%" GridLines="None" AutoGenerateColumns="false">
@@ -250,18 +251,30 @@
<asp:BoundField HeaderText="Num. Cuenta" DataField="NumCuenta" ItemStyle-CssClass="truncate2" /> <asp:BoundField HeaderText="Num. Cuenta" DataField="NumCuenta" ItemStyle-CssClass="truncate2" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div>
<div class="row"> <div class="row">
<div class="col-md-6">
<h4><b>IVA por Porcentaje</b></h4> <h4><b>IVA por Porcentaje</b></h4>
<asp:GridView ID="GvIVA2" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false"> <asp:GridView ID="GvIVA2" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" data-sort="true" Width="400px" GridLines="None" AutoGenerateColumns="false">
<Columns> <Columns>
<asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIVA" /> <asp:BoundField HeaderText="Porcentaje" DataField="PorcentajeIVA" />
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Base" DataField="Base" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>
<div class="col-md-6">
<h4><b>Ret IVA</b></h4>
<asp:GridView ID="GvRetIVA" runat="server" EmptyDataText="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="400px" GridLines="None" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="Tipo" DataField="TipoRetIVA" />
<asp:BoundField HeaderText="Base" DataField="BaseRetIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Ret IVA" DataField="RetIVA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </ajax:TabPanel>

View File

@@ -65,7 +65,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
TCEspecifico = -1; TCEspecifico = -1;
DateTime FF = DateTime.Now.AddMonths(-1); DateTime FF = DateTime.Now.AddMonths(-1);
txtFechaI.Text = $"01/{FF.Month}/{FF.Year}"; txtFechaI.Text = $"01/{FF.Month}/{FF.Year}";
txtFechaF.Text = FF.ToShortDateString(); txtFechaF.Text = FF.LastDayOfMonth().ToShortDateString();
LnkAccionesDIOT.Visible = true; LnkAccionesDIOT.Visible = true;
@@ -109,13 +109,18 @@ public partial class Contabilidad_RepIVA : ClsPaginas
GvA.Columns[11].Visible = DtIVAAcreditable.SUM("valorActosImp1516") > 0; // sino tiene valor la columna de importación de oculta GvA.Columns[11].Visible = DtIVAAcreditable.SUM("valorActosImp1516") > 0; // sino tiene valor la columna de importación de oculta
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{ {
GvIVA2.DataSource = ObjCont.DtResultados; GvIVA2.DataSource = ObjCont.DtResultados;
} }
if (UsuarioActual.CveEmpresa == 119)
{
if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 4, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
GvRetIVA.DataSource = ObjCont.DtResultados;
}
}
} }
ObjCont.Dispose(); ObjCont.Dispose();
GvT.DataBind(); GvT.DataBind();
@@ -123,6 +128,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
GvIEPSA.DataBind(); GvIEPSA.DataBind();
GvIVAA.DataBind(); GvIVAA.DataBind();
GvIVA2.DataBind(); GvIVA2.DataBind();
GvRetIVA.DataBind();
UpDatos.Update(); UpDatos.Update();
String Str = "Se Consultó el Reporte de IVA. - " + UsuarioActual.Usuario; String Str = "Se Consultó el Reporte de IVA. - " + UsuarioActual.Usuario;
@@ -162,7 +168,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
{ {
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() + Math.Round(e.Row.DBCampo("IVANoDeducible").ToDecimal()), 2); Decimal dif = Math.Round(SubTotal * e.Row.DBCampo("PorcentajeIVA").ToDecimal(), 2) - Math.Round(e.Row.DBCampo("IVA").ToDecimal(), 2);
if (Math.Abs(dif) > 1) if (Math.Abs(dif) > 1)
{ {
e.Row.ForeColor = System.Drawing.Color.Red; e.Row.ForeColor = System.Drawing.Color.Red;