diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb
index 0a3410f83..65c7ac3e5 100644
--- a/App_Code/ClsCompras.vb
+++ b/App_Code/ClsCompras.vb
@@ -3295,6 +3295,32 @@ Public Class ClsCompras
End Function
+ Public Function GetRepSATSolicitudesRecibidas(CveEmpresa As Integer, FechaInicio As Date, FechaFin As DateTime, Opcion As Integer, Vista As Integer) As Boolean
+
+ Dim retorno As Boolean = False
+ Try
+ DataAdapter("PA_SAT_SolicitudesRecibidasRepGet", CommandType.StoredProcedure)
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
+ .Add("@Vista", SqlDbType.Int).Value = Vista
+ End With
+ SqlAdapter.Fill(Data)
+
+ retorno = True
+
+ Catch ex As Exception
+ retorno = False
+ OnError("Ocurrió un error al consultar el reporte de CFDI contra compras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return retorno
+
+
+ End Function
+
End Class
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 1da462c12..dbe3a8552 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -8545,6 +8545,7 @@ Public Class ClsPaginas
PaginaDict.Add("/OI/CircularDetalle.aspx".ToUpper(), 756)
PaginaDict.Add("/OI/CircularDetalleB.aspx".ToUpper(), 756)
PaginaDict.Add("/Compras/CatTipoGasto.aspx".ToUpper(), 759)
+ PaginaDict.Add("/SAT/SolicitudesRecibidasSAT.aspx".ToUpper(), 1339)
#End Region
#Region "Contabilidad"
PaginaDict.Add("/Contabilidad/ContabilidadElectronica.aspx".ToUpper(), 566)
diff --git a/Bancos/ConciliacionesBancarias.aspx b/Bancos/ConciliacionesBancarias.aspx
index f3eb42492..a15d0dc0c 100644
--- a/Bancos/ConciliacionesBancarias.aspx
+++ b/Bancos/ConciliacionesBancarias.aspx
@@ -145,7 +145,7 @@
-
+
diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb
index 20ba7ac10..584d740c0 100644
--- a/Bancos/ConciliacionesBancarias.aspx.vb
+++ b/Bancos/ConciliacionesBancarias.aspx.vb
@@ -102,6 +102,10 @@ Partial Class Bancos_ConciliacionesBancariasaspx
ObjBancos.Dispose()
GvDatos.DataBind()
UpDatos.Update()
+ CeFechaAplicado.StartDate = txtFechaI.Text.ToDate
+ CeFechaAplicado.EndDate = txtFechaF.Text.ToDate
+ CeFechaDesconciliado.StartDate = txtFechaI.Text.ToDate
+ CeFechaDesconciliado.EndDate = txtFechaF.Text.ToDate
If GvDatos.Rows.Count > 0 Then RegistraScript("CalculaSeleccionados();", "1")
End Sub
@@ -178,8 +182,9 @@ Partial Class Bancos_ConciliacionesBancariasaspx
If Not CBool(Dr("FueConciliado").ToString) And Dr("CveIE").ToString.ToEntero > 0 Then
For Each DrE As DataRow In DtDatosEdoCuenta.Rows
If ((Dr("FechaDocumento").ToString.ToDate = DrE("FechaDocumento").ToString.ToDate And Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 1) Or (Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 2)) And Not CBool(DrE("Seleccionado").ToString) And Not CBool(DrE("FueConciliado").ToString) And Not CBool(Dr("Seleccionado").ToString) Then
- If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate), -1, 1, 1, UsuarioActual.CveUsuario) Or
- Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate), DrE("CveIEEstadoCuenta").ToString.ToEntero, 1, 2, UsuarioActual.CveUsuario) Then
+ Dim FechaConciliado As Date = TxtFechaAplicado.Text.ToDate 'If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate)
+ If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, FechaConciliado, -1, 1, 1, UsuarioActual.CveUsuario) Or
+ Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, FechaConciliado, DrE("CveIEEstadoCuenta").ToString.ToEntero, 1, 2, UsuarioActual.CveUsuario) Then
ErrorTrans = True
Else
If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Dr("CveIE").ToString.ToEntero) Then
@@ -283,7 +288,8 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Dim CveIE As Integer = 0
For Each Gvr As GridViewRow In GvDatos.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
- If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate), -1, 1, 1, UsuarioActual.CveUsuario) Then
+ Dim FechaConciliado As Date = TxtFechaAplicado.Text.ToDate 'If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate)
+ If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, FechaConciliado, -1, 1, 1, UsuarioActual.CveUsuario) Then
ErrorTrans = True
Else
If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then
@@ -296,8 +302,10 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Next
For Each Gvr As GridViewRow In GvEdoConciliacion.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
- If Not ObjBancos.UpdateIEEstadoCuenta(Gvr.DataKey("CveIEEstadoCuenta").ToEntero, Gvr.DataKey("Importe").ToDouble, True, CveIE, Gvr.DataKey("Referencia").ToString,
- Gvr.DataKey("Tipo").ToString, Gvr.DataKey("FechaDocumento").ToDate, Gvr.DataKey("CveCuenta").ToEntero) Then
+ Dim FechaConciliado As Date = TxtFechaAplicado.Text.ToDate 'If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate)
+ If Not ObjBancos.UpdateConciliacionBancaria(CveIE, FechaConciliado, Gvr.DataKey("CveIEEstadoCuenta").ToEntero, 1, 2, UsuarioActual.CveUsuario) Then
+ 'If Not ObjBancos.UpdateIEEstadoCuenta(Gvr.DataKey("CveIEEstadoCuenta").ToEntero, Gvr.DataKey("Importe").ToDouble, True, CveIE, Gvr.DataKey("Referencia").ToString,
+ ' Gvr.DataKey("Tipo").ToString, Gvr.DataKey("FechaDocumento").ToDate, Gvr.DataKey("CveCuenta").ToEntero) Then
ErrorTrans = True
End If
End If
@@ -382,7 +390,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Protected Sub LnkDesconciliar_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
ModalidadDesconciliar = "D"
- TxtFechaDesconciliado.Text = Now.ToShortDateString
+ TxtFechaDesconciliado.Text = txtFechaF.Text
CveIEDesconciliar = gvRow.DataKey("CveIE").ToEntero
UpDesconciliar.Update()
RegistraScript("$('#DModalDesconciliar').modal()")
diff --git a/Bancos/RepProgramarRecursos.aspx b/Bancos/RepProgramarRecursos.aspx
index c8073cca1..909bba2e7 100644
--- a/Bancos/RepProgramarRecursos.aspx
+++ b/Bancos/RepProgramarRecursos.aspx
@@ -3,7 +3,14 @@
<%@ Import Namespace="Extensiones" %>
-
+
+
+ Comparativo compras
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SAT/SolicitudesRecibidasSAT.aspx.vb b/SAT/SolicitudesRecibidasSAT.aspx.vb
new file mode 100644
index 000000000..8c8e6834b
--- /dev/null
+++ b/SAT/SolicitudesRecibidasSAT.aspx.vb
@@ -0,0 +1,222 @@
+Imports Extensiones
+
+Partial Class SAT_SolicitudesRecibidasSAT
+ Inherits ClsPaginas
+
+ Public Property clasegrid As String
+ Get
+
+ If ViewState("clasegrid") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("clasegrid").ToString()
+ End If
+ End Get
+ Set(ByVal value As String)
+ ViewState("clasegrid") = value
+ End Set
+ End Property
+
+ Public Property fechaInicio As String
+ Get
+
+ If ViewState("fechaInicio") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("fechaInicio").ToString()
+ End If
+ End Get
+ Set(ByVal value As String)
+ ViewState("fechaInicio") = value
+ End Set
+ End Property
+
+ Public Property fechaFin As String
+ Get
+
+ If ViewState("fechaFin") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("fechaFin").ToString()
+ End If
+ End Get
+ Set(ByVal value As String)
+ ViewState("fechaFin") = value
+ End Set
+ End Property
+
+ Public Property TipoDescarga As Integer
+ Get
+
+ If ViewState("TipoDescarga") Is Nothing Then
+ Return 0
+ Else
+ Return ViewState("TipoDescarga").ToString().ToEntero()
+ End If
+ End Get
+ Set(ByVal value As Integer)
+ ViewState("TipoDescarga") = CInt(value)
+ End Set
+ End Property
+
+ Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+ If Not IsPostBack Then
+ TxtRpdFechaInicio.Text = String.Format("01/{0:MM/yyyy}", DateTime.Now.AddMonths(-1))
+ TxtRpdFechaFin.Text = String.Format("{0:dd/MM/yyyy}", DateTime.Now.AddMonths(-1).LastDayOfMonth())
+ End If
+
+ End Sub
+
+
+ Protected Sub LnkDownloadExcel_Click(sender As Object, e As EventArgs)
+ If TipoDescarga = 1 Then
+ GvResumen.ExportToExcel2($"Resumen{DateTime.Now.ToString("yyyyMMddhhmmss")}")
+ End If
+
+ If TipoDescarga = 2 Then
+ GvDatos.ExportToExcel2($"PorComprobante{DateTime.Now.ToString("yyyyMMddhhmmss")}")
+ End If
+ End Sub
+ Protected Sub GvResumen_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ If e.Row.DataKey("Fecha") = "" Then
+ e.Row.Attributes.Add("class", "Totales")
+ End If
+ End If
+ End Sub
+ Protected Sub GvDatos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ If e.Row.DataKey("UUID") = "Totales" Then
+ e.Row.Font.Bold = True
+ e.Row.Cells(1).Text = e.Row.DataKey("CountRegistrosSIG")
+ e.Row.Cells(2).Text = e.Row.DataKey("CountRegistrosSAT")
+ e.Row.Attributes.Add("class", "Totales")
+ End If
+
+ If e.Row.DataKey("UUID").ToUpper() <> "TOTALES" Then
+ Dim SBMsgToolTip As StringBuilder = New StringBuilder()
+
+ If e.Row.DataKey("DifImporte").ToDecimal() <> 0 OrElse (e.Row.DataKey("Abreviatura").ToUpper().Trim() <> e.Row.DataKey("CBTMoneda").ToUpper().Trim()) Then
+ e.Row.CssClass = "bg-yellow-casablanca bg-font-yellow-casablanca"
+ End If
+
+ e.Row.Attributes.Add("data-html", "true")
+ e.Row.Attributes.Add("data-toggle", "tooltip")
+ e.Row.Attributes.Add("data-placement", "top")
+
+ If e.Row.DataKey("Sistema").ToUpper() = "NO" OrElse e.Row.DataKey("CFDIData").ToUpper() = "NO" Then
+
+ If e.Row.DataKey("Sistema").ToUpper() = "NO" Then
+ SBMsgToolTip.AppendLine("Comprobante no se encuentra en SIG. ")
+ End If
+
+ If e.Row.DataKey("CFDIData").ToUpper() = "NO" Then
+ SBMsgToolTip.AppendLine("Comprobante no encontrado. ")
+ End If
+ Else
+
+ If e.Row.DataKey("DifImporte").ToDecimal() <> 0 Then
+ SBMsgToolTip.AppendLine($" Diferencia importes {e.Row.DataKey("DifImporte").ToDecimal().ToString("###,###,###.00")}")
+ End If
+
+ If e.Row.DataKey("Abreviatura").ToUpper().Trim() <> e.Row.DataKey("CBTMoneda").ToUpper().Trim() Then
+ SBMsgToolTip.AppendLine($"Diferencia en monedas.")
+ End If
+ End If
+
+ If SBMsgToolTip.ToString().Length > 0 Then
+ e.Row.Attributes.Add("title", SBMsgToolTip.ToString())
+ End If
+
+ Dim LnkCFDIData As LinkButton = e.Row.FCLinkButton("LnkCFDIData")
+
+ If (e.Row.DataKey("CFDIData").ToUpper() = "SI") Then
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkCFDIData)
+ LnkCFDIData.CssClass = "Texto"
+ Else
+ LnkCFDIData.PostBackUrl = "#"
+ End If
+ End If
+ End If
+
+ If e.Row.RowType = DataControlRowType.Header Then
+ e.Row.Cells(1).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(2).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(3).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(4).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(5).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(6).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(7).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(8).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(9).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(10).BackColor = System.Drawing.Color.FromName("#3598dc")
+ e.Row.Cells(11).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(12).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(13).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(14).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(15).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(16).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(17).BackColor = System.Drawing.Color.FromName("#C46B06")
+ e.Row.Cells(1).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(2).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(3).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(4).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(5).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(6).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(7).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(8).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(9).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(10).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(11).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(12).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(13).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(14).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(15).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(16).ForeColor = System.Drawing.Color.FromName("white")
+ e.Row.Cells(17).ForeColor = System.Drawing.Color.FromName("white")
+ End If
+ End Sub
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+ DvDatos1.Visible = False
+ DvDatos2.Visible = False
+ DVResumen1.Visible = False
+ DVResumen2.Visible = False
+
+ TipoDescarga = 0
+
+ LnkDownloadExcel.Visible = False
+
+ If (DdlReporte.SelectedValue.ToEntero() = 1 OrElse DdlReporte.SelectedValue.ToEntero() = 3) Then
+ DVResumen1.Visible = True
+ DVResumen2.Visible = True
+ DvDatos1.Visible = False
+ DvDatos2.Visible = False
+ Else
+ DVResumen1.Visible = False
+ DVResumen2.Visible = False
+ DvDatos1.Visible = True
+ DvDatos2.Visible = True
+ End If
+
+ Using ObjCompras As New ClsCompras
+ If ObjCompras.GetRepSATSolicitudesRecibidas(UsuarioActual.CveEmpresa, TxtRpdFechaInicio.Text.ToDate(), TxtRpdFechaFin.Text.ToDate(), DdlReporte.SelectedValue.ToEntero(), -1) Then
+ If DdlReporte.SelectedValue.ToEntero() = 1 OrElse DdlReporte.SelectedValue.ToEntero() = 3 Then
+ GvResumen.DataSource = ObjCompras.DtResultados
+ TipoDescarga = If(ObjCompras.DtResultados.Rows.Count > 0, 1, 0)
+ LnkDownloadExcel.Visible = True
+ ElseIf DdlReporte.SelectedValue.ToEntero() = 2 Then
+ GvDatos.DataSource = ObjCompras.DtResultados
+ TipoDescarga = If(ObjCompras.DtResultados.Rows.Count > 0, 2, 0)
+ LnkDownloadExcel.Visible = True
+ End If
+ End If
+ End Using
+
+ GvResumen.DataBind()
+ GvDatos.DataBind()
+ UpDatos.Update()
+ UpAcciones.Update()
+ End Sub
+End Class