Correciones Solicitudes SAT
This commit is contained in:
@@ -574,7 +574,7 @@ Public Class ClsCompras
|
||||
|
||||
DataAdapter("PA_Comp_CompraDetalleRemove")
|
||||
|
||||
|
||||
SqlAdapter.SelectCommand.CommandTimeout = 0
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
|
||||
End With
|
||||
|
||||
@@ -117,7 +117,9 @@ Public Class ClsMovimientos
|
||||
|
||||
#Region "CxC"
|
||||
|
||||
Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1", Optional FechaCorte As Date = MaxFecha, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha) As Boolean
|
||||
Public Function GetCxCClienteDetalle(CveCliente As Integer, FechaI As String, FechaF As String, CveMoneda As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, CveClienteSucursal As Integer, Optional TipoDocto As String = "-1",
|
||||
Optional FechaCorte As Date = MaxFecha, Optional FechaVencimientoI As Date = MinFecha, Optional FechaVencimientoF As Date = MaxFecha, Optional Opcion As Integer = 1, Optional SaldoMayorA As Decimal = -999999999999,
|
||||
Optional SaldoMenorA As Decimal = 999999999999) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
FechaCorte = IIf(FechaCorte = Nothing, ClsPaginas.NowADS().AddYears(1), FechaCorte).ToString.ToDate
|
||||
@@ -135,6 +137,9 @@ Public Class ClsMovimientos
|
||||
.Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte
|
||||
.Add("@FechaVencimientoI", SqlDbType.Date).Value = FechaVencimientoI
|
||||
.Add("@FechaVencimientoF", SqlDbType.Date).Value = FechaVencimientoF
|
||||
.Add("@Opcion", SqlDbType.Int).Value = Opcion
|
||||
.Add("@SaldoMayorA", SqlDbType.Money).Value = SaldoMayorA
|
||||
.Add("@SaldoMenorA", SqlDbType.Money).Value = SaldoMenorA
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -1948,7 +1948,7 @@ Partial Class Compras_Compras
|
||||
For Each concepto As XmlNode In nodeconceptos
|
||||
' Obtener la descripción del concepto
|
||||
Dim descripcion As String = ValorXML(concepto, "Descripcion")
|
||||
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe"))
|
||||
Dim importeValue As Decimal = Decimal.Parse(ValorXML(concepto, "Importe")).RoundSQL(2)
|
||||
|
||||
' Seleccionar el nodo de Impuestos dentro de Concepto, si existe
|
||||
Dim impuestosNode As XmlNode = concepto.SelectSingleNode("cfdi:Impuestos", namespaces)
|
||||
@@ -1958,7 +1958,7 @@ Partial Class Compras_Compras
|
||||
Dim retenciones As XmlNodeList = impuestosNode.SelectNodes("cfdi:Retenciones/cfdi:Retencion", namespaces)
|
||||
For Each retencion As XmlNode In retenciones
|
||||
' Obtener los valores de los atributos Base e Importe
|
||||
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base"))
|
||||
Dim baseValue As Decimal = Decimal.Parse(ValorXML(retencion, "Base")).RoundSQL(2)
|
||||
Dim impuesto As String = ValorXML(retencion, "Impuesto")
|
||||
|
||||
If impuesto = "001" Then
|
||||
|
||||
@@ -260,8 +260,9 @@ public partial class Contabilidad_RepIVA : ClsPaginas
|
||||
|
||||
|
||||
ImprimirbytesPDF(ImprimirSubRepPDFCrystal(Ruta, Dt, para, DtIEPSA, DtIVAA, "RepIEPSPorcentaje.rpt", "RepIVAPorcentaje.rpt", "Reporte de IVA", Opcion), "Reporte de IVA", Opcion);
|
||||
|
||||
|
||||
//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);
|
||||
|
||||
@@ -605,9 +605,14 @@ Partial Class Contratos_RepPresupuestos
|
||||
params.Add(New ReportParameter("Autorizado", LtlAutorizado.Text.FormatoNumero()))
|
||||
params.Add(New ReportParameter("Ejercido", LtlEjercido.Text.FormatoNumero()))
|
||||
params.Add(New ReportParameter("PorEjercer", LtlPorEjercer.Text.FormatoNumero()))
|
||||
|
||||
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
|
||||
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
|
||||
|
||||
|
||||
params.Add(New ReportParameter("PresupuestoRestrictivo", UsuarioActual.Empresa.Funcionalidad(532)))
|
||||
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepPresupuestoAnual.rdlc", DtPresupuestos, params, "Reporte de Presupuestos Anual", Formato)
|
||||
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,15 +10,7 @@
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<%-- <li>
|
||||
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
|
||||
</li>--%>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
@@ -110,10 +102,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="text-align: left">Centro Costo:</div>
|
||||
<div class="col-md-1" style="text-align: left">
|
||||
<div class="col-md-1" style="text-align: left" runat="server" visible="false" id="DvSubProyectoSaldar1">Centro Costo:</div>
|
||||
<div class="col-md-1" style="text-align: left" runat="server" visible="false" id="DvSubProyectoSaldar2">
|
||||
<asp:DropDownList ID="DdlSubProyectoSaldar" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlSubProyectoSaldar" runat="server" ControlToValidate="DdlSubProyectoSaldar" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Centro Costo''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlSubProyectoSaldar" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlSubProyectoSaldar"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="text-align: left">Concepto:</div>
|
||||
@@ -123,9 +117,25 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VcoConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RfvConcepto"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
|
||||
|
||||
<label class="col-md-1" runat="server" visible="false" id="DVDdlDeduccion1" >Cta Deducción:</label>
|
||||
<div class="col-md-1" style="text-align: left" runat="server" visible="false" id="DVDdlDeduccion2">
|
||||
<asp:DropDownList ID="DdlTipoDeduccion" runat="server" Width="100%" CssClass="form-control select2me" >
|
||||
<asp:ListItem Text="Gasto No Deducible" Value="255" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Text="Incobrable No Deducible" Value="179"></asp:ListItem>
|
||||
<asp:ListItem Text="Incobrable Deducible" Value="263"></asp:ListItem>
|
||||
<asp:ListItem Text="Reservas" Value="252"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlTipoDeduccion" runat="server" ControlToValidate="DdlTipoDeduccion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cta Deducción''</b> es necesario, por favor ingréselo." ValidationGroup="VgGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlTipoDeduccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoDeduccion"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:Button ID="BtnSaldar" OnClick="BtnSaldar_Click" runat="server" Text="Saldar" CssClass="btn btn-primary" ValidationGroup="VgGuardar" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -137,7 +147,7 @@
|
||||
|
||||
<ajax:TabContainer runat="server" ID="Tabs">
|
||||
|
||||
<ajax:TabPanel ID="TabIXC" runat="server" HeaderText="IXC" ClientIDMode="Static">
|
||||
<ajax:TabPanel ID="TabIXC" runat="server" HeaderText="IXC" ClientIDMode="Static" OnClientClick="" >
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
@@ -254,11 +264,10 @@
|
||||
DataKeyNames="TipoDocto,CveVenta,CveCliente,SerieFolio,Original,SubTotal,IVA,IEPS,RetIVA,RetISR,Num3,CveSubProyecto,CveMoneda,Saldo,TipoCambio, RFC,UUID,Fecha,PorcentajeIVA,DescuentoProntoPago,CveTipoRetencion,Descuento,ClaveMetodoPagoSAT"
|
||||
CssClass="table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None" HeaderStyle-CssClass="ADtr">
|
||||
<Columns>
|
||||
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<input type="checkbox" id="ChkAll" onclick="CheckAll();" />
|
||||
<%--<input type="checkbox" id="ChkAll" onclick="CheckAll();" />--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" CssClass="chkgv" runat="server"></asp:CheckBox>
|
||||
@@ -281,6 +290,15 @@
|
||||
<asp:Literal ID="LtlTipoDocto" runat="server" Text='<%# Eval("TipoDocto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>
|
||||
Cliente
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="Ltl" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
@@ -386,7 +404,17 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div style="display:none">
|
||||
<asp:Button runat="server" ID="BtnonClickTabs" OnClick="BtnonClickTabs_Click" ClientIDMode="Static" />
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
function onClickTabs() {
|
||||
$('#BtnonClickTabs').click();
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -78,34 +78,47 @@ Partial Public Class General_SaldosMenores
|
||||
InicializaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnonClickTabs_Click(sender As Object, e As EventArgs)
|
||||
Consultar()
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Consultar()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub Consultar()
|
||||
|
||||
DvSaldar.Visible = False
|
||||
DtDatosIXC = New DataTable
|
||||
DtDatosNCEXC = New DataTable
|
||||
DtDatosVentas = New DataTable
|
||||
|
||||
DvSubProyectoSaldar1.Visible = False
|
||||
DvSubProyectoSaldar2.Visible = False
|
||||
|
||||
DVDdlDeduccion1.Visible = False
|
||||
DVDdlDeduccion2.Visible = False
|
||||
|
||||
If Tabs.ActiveTab Is TabIXC Then
|
||||
CargaDatosIXC()
|
||||
If DtDatosIXC.Rows.Count > 0 Then
|
||||
DvSaldar.Visible = True
|
||||
DvSubProyectoSaldar1.Visible = True
|
||||
DvSubProyectoSaldar2.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Tabs.ActiveTab Is TabVentas Then
|
||||
CargaDatosVentas()
|
||||
If DtDatosVentas.Rows.Count > 0 Then
|
||||
DvSaldar.Visible = True
|
||||
DVDdlDeduccion1.Visible = True
|
||||
DVDdlDeduccion2.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Upsaldar.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnSaldar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
@@ -182,6 +195,7 @@ Partial Public Class General_SaldosMenores
|
||||
|
||||
If MsgError = "" Then
|
||||
ObjConta.Commit()
|
||||
' DvSaldar.Visible = False
|
||||
Dim Msg As String = "Los movimientos se saldaron correctamente."
|
||||
Msg &= $"<br/><br/><a Class='Texto' target='_blank' href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}'>Ver Póliza</a> "
|
||||
Alert(Msg)
|
||||
@@ -197,6 +211,159 @@ Partial Public Class General_SaldosMenores
|
||||
|
||||
If Tabs.ActiveTab Is TabVentas Then
|
||||
|
||||
|
||||
Dim ObjConta As New ClsContabilidad
|
||||
ObjConta.IniciaTransacSQL()
|
||||
Dim CvePrePoliza As Integer = 0
|
||||
Dim MsgError As String = ""
|
||||
|
||||
'Dim ObjIE As New ClsBancos
|
||||
Dim FechaUltimaFluctuacion As Date = MinFecha
|
||||
Dim TipoCambioFluctuacion As Decimal = 1
|
||||
|
||||
Dim tFecha As Date = TxtFecha.Text.ToDate
|
||||
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
|
||||
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
|
||||
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
|
||||
TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
|
||||
End If
|
||||
End If
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ClientesAbonar/SaldarI", 47, 0, 0, 1, TxtFecha.Text.ToDate, TxtFecha.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
For Each gr As GridViewRow In GvCxC.Rows
|
||||
If gr.FCCheckBox("Chk").Checked Then
|
||||
Dim PorcentajePago As Decimal = gr.DataKey("Saldo").ToDecimal / gr.DataKey("Original").ToDecimal
|
||||
Dim Saldo As Decimal = gr.DataKey("Saldo").ToDecimal
|
||||
Dim RETIVA As Decimal = gr.DataKey("RetIVA").ToDecimal
|
||||
Dim SubTotal As Decimal = PorcentajePago * (gr.DataKey("SubTotal").ToDecimal.RoundSQL - gr.DataKey("Descuento").ToDecimal.RoundSQL).RoundSQL
|
||||
Dim IVA As Decimal = PorcentajePago * gr.DataKey("IVA").ToDecimal.RoundSQL
|
||||
Dim IEPS As Decimal = PorcentajePago * gr.DataKey("IEPS").ToDecimal.RoundSQL
|
||||
Dim TCVenta As Decimal = gr.DataKey("TipoCambio").ToDecimal
|
||||
Dim FechaVenta As Date = gr.DataKey("Fecha").ToDate
|
||||
Dim tCveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
|
||||
Dim TCPago As Decimal = GlobalTipoCambio(TxtFecha.Text.ToDate).FormatoNumero(4).ToDecimal
|
||||
Dim CveConceptoDeduccion As Integer = DdlTipoDeduccion.SelectedValue.ToEntero
|
||||
|
||||
Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero
|
||||
|
||||
'si la fecha del documento es anterior a su ultima fluctuación. toma el Tc de la fluctuacion
|
||||
If tCveMoneda = 2 Then
|
||||
If FechaVenta < FechaUltimaFluctuacion Then
|
||||
TCVenta = TipoCambioFluctuacion
|
||||
End If
|
||||
End If
|
||||
'condicionante
|
||||
Dim ClienteMovto As Boolean = True
|
||||
Dim SubtotalMovto As Boolean = False
|
||||
Dim CveConceptoCliente As Integer = 2
|
||||
Dim ImpuestosMovto As Boolean = False
|
||||
|
||||
Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero
|
||||
Dim ConceptoPartida As String = TxtConcepto.Text.Trim & " " & gr.DataKey("SerieFolio").ToString
|
||||
'TxtConcepto.Text
|
||||
'If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
|
||||
'If CveConceptoDeduccion = 179 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
|
||||
'If CveConceptoDeduccion = 263 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(537).ToEntero
|
||||
'If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(581).ToEntero
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
|
||||
|
||||
ClienteMovto = False : Saldo = Saldo * -1
|
||||
ImpuestosMovto = True : IVA = IVA * -1
|
||||
RETIVA = ((SubTotal * RETIVA / gr.DataKey("SubTotal").ToDecimal.RoundSQL) * -1).RoundSQL(2)
|
||||
CveConceptoCliente = 1
|
||||
End If
|
||||
|
||||
Dim UsaComplementaria As Boolean = True
|
||||
|
||||
'If UsuarioActual.CveEmpresa = 119 Then
|
||||
' UsaComplementaria = True
|
||||
'End If
|
||||
|
||||
If MsgError = "" Then
|
||||
Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(6, tCveMoneda, True, 1)
|
||||
'normal
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, Saldo, ConPreP.CveConcepto, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
If UsaComplementaria AndAlso tCveMoneda = 2 Then
|
||||
'complementaria
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, If(CveMoneda = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ConPreP.CveConceptoComplementario, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
End If
|
||||
|
||||
'fluctuación.
|
||||
If tCveMoneda = 2 Then
|
||||
Dim ImporteFluctuacion As Decimal = 0
|
||||
ImporteFluctuacion = Saldo * (TCPago - TCVenta)
|
||||
|
||||
If CveSubProyecto <= 0 Then
|
||||
MsgError = $"No se pudo obtener el sub proyecto de la venta {gr.DataKey("SerieFolio").ToString}"
|
||||
End If
|
||||
|
||||
If TCPago > TCVenta Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 64, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 65, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
End If
|
||||
|
||||
'cuando hay pago en dólares, se ajusta el concepto de subtotal,
|
||||
SubTotal = (Saldo * TCVenta) + ImporteFluctuacion - (IVA * TCVenta) - (IEPS * TCVenta)
|
||||
|
||||
End If
|
||||
|
||||
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, If(CveMoneda = 1, IVA, IVA * TCVenta), 13, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, PorcentajeImpuesto:=gr.DataKey("PorcentajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, If(CveMoneda = 1, RETIVA, RETIVA * TCVenta), 8, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, If(CveMoneda = 1, IEPS, IEPS * TCVenta), 38, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
'al gasto,Subtotal
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, SubTotal, CveConceptoDeduccion, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyecto, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
|
||||
GuardaLogAD($"Ventas/ClientesAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If MsgError = "" Then
|
||||
'ObjConta.RollBack()
|
||||
ObjConta.Commit()
|
||||
'DvSaldar.Visible = False
|
||||
CargaDatosVentas()
|
||||
'RegistraScript("$('#ModalSaldarCuentaIncobrable').modal('hide')")
|
||||
Alert(String.Format("Los movimientos se saldaron correctamente. <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}' class='Texto'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
|
||||
'BtnSaldarCuentasIncobrables.Visible = False
|
||||
Else
|
||||
ObjConta.RollBack()
|
||||
Alert(MsgError, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
|
||||
ObjConta.Dispose()
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -438,8 +605,8 @@ Partial Public Class General_SaldosMenores
|
||||
Dim FechaCorte As Date = NowADS().AddYears(1).ToShortDateString.ToString.ToDate
|
||||
|
||||
Dim SumDescuentoProntoPago As Double = 0.0
|
||||
If Mov.GetCxCClienteDetalle(-1, FechaI, FechaF, -1, -1, UsuarioActual.CveEmpresa, -1, FechaCorte:=FechaCorte) Then
|
||||
DtDatosVentas = Mov.DtResultados.FiltraParametros($"Saldo > {TxtSaldoMayorA.Text.ToDecimal} AND Saldo < {TxtSaldoMenorA.Text.ToDecimal} ", "Fecha,SerieFolio").AsEnumerable().Take(51).CopyToDataTable()
|
||||
If Mov.GetCxCClienteDetalle(-1, FechaI, FechaF, -1, -1, UsuarioActual.CveEmpresa, -1, FechaCorte:=FechaCorte, Opcion:=2, SaldoMayorA:=TxtSaldoMayorA.Text.ToDecimal, SaldoMenorA:=TxtSaldoMenorA.Text.ToDecimal) Then
|
||||
DtDatosVentas = Mov.DtResultados
|
||||
|
||||
'Dim TmpCxCAux As DataTable
|
||||
'TmpCxCAux = Mov.DtResultados.FiltraParametros($"Saldo > {TxtSaldoMayorA.Text.ToDecimal} AND Saldo < {TxtSaldoMenorA.Text.ToDecimal} ", "Fecha,SerieFolio").AsEnumerable().Take(51).CopyToDataTable()
|
||||
@@ -467,9 +634,17 @@ Partial Public Class General_SaldosMenores
|
||||
|
||||
|
||||
Protected Sub GvCxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCxC.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DataKey("CveVenta").ToEntero <= 0 Then
|
||||
e.Row.BackColor = Drawing.Color.LightGray
|
||||
e.Row.FCCheckBox("Chk").Visible = False
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -602,7 +602,6 @@ Partial Class OC_OC
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing
|
||||
CargaDatosAgregarPS()
|
||||
@@ -6182,11 +6181,16 @@ Partial Class OC_OC
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'MANDA CORREO A TODOS LOS USUARIOS INVOLUCRADOS
|
||||
If DtHistorial IsNot Nothing Then
|
||||
For Each Row As DataRow In DtHistorial.FiltraParametros("CveConceptoHistorialBitacora = 1").Rows
|
||||
StrCorreos.AppendFormat("{0};", GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("correo").ToString)
|
||||
CorreosCCPNombre.Add(GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("nombre").ToString)
|
||||
|
||||
If GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero).FiltraParametros(" Estatus = True ").Rows.Count > 0 Then
|
||||
StrCorreos.AppendFormat("{0};", GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("correo").ToString)
|
||||
CorreosCCPNombre.Add(GlobalDTUsuarios(Row("CveUsuario").ToString.ToEntero)(0)("nombre").ToString)
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
@@ -263,7 +263,8 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
|
||||
protected void LnkverificarSolicitudes_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
|
||||
StringBuilder sbResultado = new StringBuilder();
|
||||
foreach (GridViewRow GvRow in GVSolicitudesPendientes.Rows)
|
||||
{
|
||||
@@ -276,7 +277,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
|
||||
List<string> resultVerificacion = new List<string>();
|
||||
var ResultadoVerificaionOK = false;
|
||||
var SeVerifico = false;
|
||||
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
|
||||
|
||||
var ResultadoSolicitudOK = false;
|
||||
|
||||
|
||||
@@ -331,7 +332,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
|
||||
else
|
||||
{
|
||||
|
||||
if (resultSolicitud.Count == 4)
|
||||
if (resultSolicitud.Count >= 4)
|
||||
{
|
||||
sbResultado.Append($"({resultSolicitud[1]})<br> Folio:{Folio} <br> ");
|
||||
}
|
||||
@@ -344,7 +345,7 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
|
||||
}
|
||||
|
||||
|
||||
if (SeVerifico && resultVerificacion.Count == 4)
|
||||
if (SeVerifico && resultVerificacion.Count >= 4)
|
||||
{
|
||||
if (ResultadoVerificaionOK)
|
||||
{
|
||||
@@ -362,11 +363,11 @@ public partial class SAT_SolicitudesIngresoSat : ClsPaginas
|
||||
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
|
||||
}
|
||||
|
||||
Alert(sbResultado.ToString(), TipoMensaje);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Alert(sbResultado.ToString(), TipoMensaje);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVSolicitudesPendientes" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
|
||||
ShowHeaderWhenEmpty="true" EmptyDataText="No se encontraron registros"
|
||||
DataKeyNames="CveSolicitud,CveSolicitudCFDI,CveSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa">
|
||||
DataKeyNames="CveSolicitud,idSolicitud,CveTipoSolicitud,Folio,CveSolicitudCFDI,CveSolicitudMetadata,Estatus,Observaciones,FechaInicio,FechaFin,FechaIng,CveUsuarioIng,CveEmpresa">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Folio">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -12,7 +12,8 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using static Extensiones.ModExtensiones;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Extensiones;
|
||||
|
||||
public partial class SAT_SolicitudesNominaSat : ClsPaginas
|
||||
{
|
||||
@@ -217,15 +218,16 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
|
||||
DateTime fechaFin = txtFechaFAdd.Text.ToDateTime();
|
||||
int cveUsuarioIng = UsuarioActual.CveUsuario;
|
||||
int cveEmpresa = UsuarioActual.CveEmpresa;
|
||||
bool Continuar = false;
|
||||
//bool Continuar = false;
|
||||
int CveSolicitudAgregada = -1;
|
||||
using (ClsNominas nom = new ClsNominas())
|
||||
{
|
||||
Continuar = nom.SolicitudesAdd(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa);
|
||||
{
|
||||
CveSolicitudAgregada = nom.SolicitudesAdd2(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa,1);
|
||||
var api = new GeneralesAPI();
|
||||
api.GeneraSolicitud(UsuarioActual.CveEmpresa, 1);
|
||||
api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1);
|
||||
api.GeneraSolicitud(UsuarioActual.CveEmpresa, 1, CveSolicitudAgregada);
|
||||
api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1, CveSolicitudAgregada);
|
||||
}
|
||||
if (Continuar)
|
||||
if (CveSolicitudAgregada > 0)
|
||||
{
|
||||
txtFechaIAdd.Text = "";
|
||||
txtFechaFAdd.Text = "";
|
||||
@@ -239,10 +241,126 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
|
||||
|
||||
protected void LnkverificarSolicitudes_Click(object sender, EventArgs e)
|
||||
{
|
||||
var api = new GeneralesAPI();
|
||||
api.GeneraSolicitud(UsuarioActual.CveEmpresa,1);
|
||||
api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1);
|
||||
cargasolicitudes();
|
||||
//var api = new GeneralesAPI();
|
||||
//api.GeneraSolicitud(UsuarioActual.CveEmpresa,1);
|
||||
//api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, 1);
|
||||
//cargasolicitudes();
|
||||
|
||||
try
|
||||
{
|
||||
var TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion;
|
||||
StringBuilder sbResultado = new StringBuilder();
|
||||
foreach (GridViewRow GvRow in GVSolicitudesPendientes.Rows)
|
||||
{
|
||||
int CveSolicitudActual = GvRow.DataKey("CveSolicitud").ToEntero();
|
||||
string idSolicitud = GvRow.DataKey("idSolicitud").Trim();
|
||||
int CveTipoSolicitud = GvRow.DataKey("CveTipoSolicitud").ToEntero();
|
||||
int Folio = GvRow.DataKey("CveSolicitud").ToEntero();
|
||||
|
||||
List<string> resultSolicitud = new List<string>();
|
||||
List<string> resultVerificacion = new List<string>();
|
||||
var ResultadoVerificaionOK = false;
|
||||
var SeVerifico = false;
|
||||
|
||||
var ResultadoSolicitudOK = false;
|
||||
|
||||
|
||||
var api = new GeneralesAPI();
|
||||
|
||||
|
||||
if (idSolicitud.Length == 0)
|
||||
{
|
||||
JToken ObjApiSolicitud = (JToken)api.GeneraSolicitud(UsuarioActual.CveEmpresa, CveTipoSolicitud, CveSolicitudActual);
|
||||
if (!(ObjApiSolicitud == null))
|
||||
{
|
||||
resultSolicitud = ObjApiSolicitud.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
|
||||
ResultadoSolicitudOK = bool.Parse(resultSolicitud[0]);
|
||||
sbResultado.Append($"Solicitud {Folio} solicitada a SAT.<br>");
|
||||
}
|
||||
else
|
||||
{
|
||||
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resultSolicitud = new List<string>();
|
||||
resultSolicitud.Add("true");
|
||||
resultSolicitud.Add("");
|
||||
resultSolicitud.Add("");
|
||||
resultSolicitud.Add("");
|
||||
|
||||
ResultadoSolicitudOK = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (ResultadoSolicitudOK)
|
||||
{
|
||||
|
||||
JToken ObjApiVerificacion = (JToken)api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, CveTipoSolicitud, CveSolicitudActual);
|
||||
|
||||
|
||||
if (!(ObjApiVerificacion == null))
|
||||
{
|
||||
resultVerificacion = ObjApiVerificacion.Select(token => token.Values().Aggregate((i, j) => $"{i}|{j}").Value<string>()).ToList();
|
||||
ResultadoVerificaionOK = bool.Parse(resultVerificacion[0]);
|
||||
SeVerifico = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (resultSolicitud.Count >= 4)
|
||||
{
|
||||
sbResultado.Append($"({resultSolicitud[1]})<br> Folio:{Folio} <br> ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbResultado.Append($"Solicitud pendiente de verificar en SAT <br> Folio:{Folio} <br>");
|
||||
}
|
||||
|
||||
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
|
||||
}
|
||||
|
||||
|
||||
if (SeVerifico && resultVerificacion.Count >= 4)
|
||||
{
|
||||
if (ResultadoVerificaionOK)
|
||||
{
|
||||
sbResultado.Append($"Solicitud procesada.<br> Folio: {Folio} <br> {resultVerificacion[1]}");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbResultado.Append($"Solicitud no verificada <br> Folio: {Folio}{resultVerificacion[1]}.<br>");
|
||||
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sbResultado.Append($"Se presento un error al verificar la solicitud <br> Folio: {Folio}.");
|
||||
TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Alert(sbResultado.ToString(), TipoMensaje);
|
||||
|
||||
|
||||
|
||||
cargasolicitudes();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Alert(ex.StackTrace);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -307,14 +425,18 @@ public class GeneralesAPI : ADSNetLibrary.Helpers.Conexiones.SIGAPI.BaseSIGAPI
|
||||
|
||||
|
||||
|
||||
public object GeneraSolicitud(int CveEmpresa, int CveTipoSolicitud)
|
||||
public object GeneraSolicitud(int CveEmpresa, int CveTipoSolicitud, int CveSolicitud)
|
||||
{
|
||||
return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
|
||||
//return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
|
||||
return getData<object>($"GeneraSolicitud/{CveEmpresa}/{CveTipoSolicitud}/{CveSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
|
||||
|
||||
}
|
||||
public object VerificaSolicitudesNominas(int CveEmpresa, int CveTipoSolicitud)
|
||||
public object VerificaSolicitudesNominas(int CveEmpresa, int CveTipoSolicitud, int CveSolicitud)
|
||||
{
|
||||
return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
|
||||
///return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
|
||||
return getData<object>($"VerificaSolicitudesNominas/{CveEmpresa}/{CveTipoSolicitud}/{CveSolicitud}", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user