This commit is contained in:
2025-05-24 07:06:45 -07:00
4 changed files with 168 additions and 124 deletions

View File

@@ -6096,8 +6096,14 @@ Public Class ClsVentas
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
Retorno = True Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("vigente") Then
Alert("Ya existe una solicitud vigente", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al guardar la autorización.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception Catch ex As Exception
OnError("Ocurrió un error al obtener los limites.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) OnError("Ocurrió un error al guardar la autorización.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try End Try
Return Retorno Return Retorno
End Function End Function

View File

@@ -237,7 +237,7 @@
<asp:Label data-toggle="tooltip" data-placement="top" ToolTip="SubTotal al 8%." runat="server">SubTotal <br/>8%</asp:Label> <asp:Label data-toggle="tooltip" data-placement="top" ToolTip="SubTotal al 8%." runat="server">SubTotal <br/>8%</asp:Label>
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("AcredFN", "{0:N2}") %>'></asp:Label> <asp:Label runat="server" Text='<%# Eval("ActosFN", "{0:N2}") %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<%-- <asp:BoundField HeaderText="SubTotal 0%" DataField="valorActosImp0" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />--%> <%-- <asp:BoundField HeaderText="SubTotal 0%" DataField="valorActosImp0" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />--%>
@@ -318,6 +318,14 @@
<asp:Label runat="server" Text='<%# Eval("ValorIvaNoDeducible08", "{0:N2}") %>'></asp:Label> <asp:Label runat="server" Text='<%# Eval("ValorIvaNoDeducible08", "{0:N2}") %>'></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label data-toggle="tooltip" data-placement="top" ToolTip="IVA SubTotal Importación No Tangibles 16%." runat="server">SubTotal <br/> Imp. No Tan.16%</asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("ActosImpNotan16", "{0:N2}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -333,10 +333,11 @@ public partial class Contabilidad_RepIVA : ClsPaginas
protected void LnkTxtDIOT_Click(object sender, EventArgs e) protected void LnkTxtDIOT_Click(object sender, EventArgs e)
{ {
ClsContabilidad Objconta = new ClsContabilidad();
StringBuilder SBDIOT = new StringBuilder(); StringBuilder SBDIOT = new StringBuilder();
int Conciliado = DdlTipoMovto.SelectedValue.ToEntero(); int Conciliado = DdlTipoMovto.SelectedValue.ToEntero();
using (var Objconta = new ClsContabilidad())
{
if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico)) if (Objconta.GetRepIVA(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 2, UsuarioActual.CveUsuario, -1, Conciliado, UsuarioActual.CveEmpresa, TipoCambio, TCEspecifico))
{ {
if (txtFechaI.Text.ToDate() < "2024/12/31".ToDate()) // años anteriores al enero 2025 if (txtFechaI.Text.ToDate() < "2024/12/31".ToDate()) // años anteriores al enero 2025
@@ -381,6 +382,20 @@ public partial class Contabilidad_RepIVA : ClsPaginas
//acumula los prov, globales en un solo registro //acumula los prov, globales en un solo registro
dtt = AcumularYReemplazar(dtt); dtt = AcumularYReemplazar(dtt);
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:<br/>");
foreach (DataRow row in dtSinTipoOperacion.Rows)
{
SbSinTipo.AppendFormat("{0}-{1} <br/>", row["RFC"], row["RazonSocial"]);
}
Alert(SbSinTipo.ToString(), TipoMensaje.MsgAdvertencia);
}
else
{
foreach (DataRow Drow in dtt.Rows) foreach (DataRow Drow in dtt.Rows)
{ {
SBDIOT.AppendLine( SBDIOT.AppendLine(
@@ -446,11 +461,24 @@ public partial class Contabilidad_RepIVA : ClsPaginas
} }
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(); //MemoryStream ms = new MemoryStream();
//TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8); //TextWriter tw = new StreamWriter(ms, System.Text.Encoding.UTF8);
@@ -469,15 +497,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas
//Response.BinaryWrite(bytes); //Response.BinaryWrite(bytes);
//Response.End(); //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) static DataTable AcumularYReemplazar(DataTable dt)

View File

@@ -228,6 +228,16 @@ Partial Class Ventas_FacturacionGlobal
CveProyecto:=Dr("CveProyecto").ToString().ToEntero(), CveSubProyecto:=Dr("CveSubProyecto").ToString().ToEntero(), CveVentaDetallePadre:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero()) CveProyecto:=Dr("CveProyecto").ToString().ToEntero(), CveSubProyecto:=Dr("CveSubProyecto").ToString().ToEntero(), CveVentaDetallePadre:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalle").ToString().ToEntero())
Next Next
Dim SbObs As New StringBuilder
If txtFechaI.Text.Trim() <> txtFechaF.Text.Trim() Then
SbObs.AppendFormat("Periodo: {0} al {1}", txtFechaI.Text, txtFechaF.Text)
ElseIf txtFechaI.Text.Trim() = txtFechaF.Text.Trim() Then
SbObs.AppendFormat("Periodo: {0}", txtFechaI.Text)
End If
ObjFactura.Observaciones = SbObs.ToString()
ObjFactura.CalculaTotales() ObjFactura.CalculaTotales()
ObjFactura.PreparaTimbre() ObjFactura.PreparaTimbre()