diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 23bdee732..79167e0a2 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -134,6 +134,42 @@ Public Class ClsGenerales End Sub + Public Function RepConciliacionSatGET(cveEmpresa As Int32, tipoDocto As String, fechaI As String, fechaF As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RepConciliacionSatGET", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@TipoDocto", SqlDbType.VarChar).Value = tipoDocto + .Add("@FechaI", SqlDbType.VarChar).Value = fechaI + .Add("@FechaF", SqlDbType.VarChar).Value = fechaF + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de Conciliaciones SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function SAT_DescargaSolicitudesGET(CveEmpresa As Int32, tipo As Int32, fIngInicio As String, fIngFin As String, fSolInicio As String, fSolFin As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("[PA_SAT_DescargaSolicitudesGET]", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Tipo", SqlDbType.Int).Value = tipo + .Add("@FIngInicio", SqlDbType.VarChar).Value = fIngInicio + .Add("@FIngFin", SqlDbType.VarChar).Value = fIngFin + .Add("@FSolInicio", SqlDbType.VarChar).Value = fSolInicio + .Add("@FSolFin", SqlDbType.VarChar).Value = fSolFin + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los registros de solicitudes CFDI SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function #Region " I N D I C A D O R E S Y G R A F I C A S" Public Function GetIndicadores(CveEmpresa As Integer) As DataSet 'Dim Retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ae2a6e5ca..4f5286d59 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3473,6 +3473,8 @@ Public Class ClsPaginas PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/RepConciliacionEmitidosSat.aspx".ToUpper(), -1) + PaginaDict.Add("/Ventas/RepConciliacionSat.aspx".ToUpper(), 716) + PaginaDict.Add("/Ventas/SolicitudesSAT.aspx".ToUpper(), 717) PaginaDict.Add("/Nomina/CatConceptos2.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) diff --git a/Compras/RepRembolsoComprobaciones.aspx b/Compras/RepRembolsoComprobaciones.aspx index e55f48af0..854a49898 100644 --- a/Compras/RepRembolsoComprobaciones.aspx +++ b/Compras/RepRembolsoComprobaciones.aspx @@ -106,6 +106,7 @@
+
@@ -120,7 +121,7 @@
- +
diff --git a/Ventas/RepConciliacionSat.aspx b/Ventas/RepConciliacionSat.aspx index 234fbe0c8..77d257d1d 100644 --- a/Ventas/RepConciliacionSat.aspx +++ b/Ventas/RepConciliacionSat.aspx @@ -1,15 +1,188 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RepConciliacionSat.aspx.cs" Inherits="Ventas_RepConciliacionSat" %> +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepConciliacionSat.aspx.cs" Inherits="Ventas_RepConciliacionSat" %> - + + + + + + + Conciliación CFDI SAT + + + + +
  • Solicitudes SAT
  • + +
    + + + + + + +
    +
    +
    + + +
    +
    +
    + + +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + - - - - - -
    -
    -
    -
    - - diff --git a/Ventas/RepConciliacionSat.aspx.cs b/Ventas/RepConciliacionSat.aspx.cs index d0acae9eb..0ab06995d 100644 --- a/Ventas/RepConciliacionSat.aspx.cs +++ b/Ventas/RepConciliacionSat.aspx.cs @@ -4,11 +4,62 @@ using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using Extensiones; -public partial class Ventas_RepConciliacionSat : System.Web.UI.Page +public partial class Ventas_RepConciliacionSat : ClsPaginas { + const string rqFechaInicio = "FechaInicio"; + const string rqFechaFin = "FechaFin"; protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) + { + DateTime fecha; + DateTime fechaInicio = DateTime.Now; + DateTime fechaFin = DateTime.Now; + if (fechaInicio.Day < 5) { fechaInicio = fechaInicio.AddMonths(-1); } + fechaInicio = fechaInicio.AddDays(1 - fechaInicio.DayOfYear); + fechaFin = fechaInicio.AddYears(1).AddDays(-1); + if (Request[rqFechaInicio] != null) { DateTime.TryParse(Request[rqFechaInicio], out fecha); fechaInicio = fecha.Year > 1900 ? fecha : fechaInicio; } + if (Request[rqFechaFin] != null) { DateTime.TryParse(Request[rqFechaFin], out fecha); fechaFin = fecha.Year > 1900 ? fecha : fechaFin; } + txtFechaI.Text = string.Format("{0:dd/MM/yyyy}", fechaInicio); + txtFechaF.Text = string.Format("{0:dd/MM/yyyy}", fechaFin); + + } + CargaRepConciliacionSatGET(); + } + + + protected void CargaRepConciliacionSatGET() + { + string RtipoDocto, RfechaI, RfechaF; + RtipoDocto = "I"; + RfechaI = txtFechaI.Text.ToDateTime().ToString(); + RfechaF = txtFechaF.Text.ToDateTime().ToString(); + using (ClsGenerales ObjRepC = new ClsGenerales()) + { + ObjRepC.RepConciliacionSatGET(UsuarioActual.CveEmpresa, RtipoDocto, RfechaI, RfechaF); + GVRepConciliacionSatGET.DataSource = ObjRepC.DtResultados; + ObjRepC.Dispose(); + + } + GVRepConciliacionSatGET.DataBind(); + upDatosRepC.Update(); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaRepConciliacionSatGET(); + } + + protected void GVRepConciliacionSatGET_RowDataBound(object sender, GridViewRowEventArgs e) + { + if(e.Row.RowType == DataControlRowType.DataRow) + { + e.Row.CssClass = string.Format("Grupo{0}", e.Row.DBCampo("GRUPOCve")); + e.Row.Attributes.Add("ganio", string.Format("{0}", e.Row.DBCampo("anio"))); + e.Row.Attributes.Add("gMes", string.Format("{0}", e.Row.DBCampo("Mes"))); + } } } \ No newline at end of file diff --git a/Ventas/SolicitudesSAT.aspx b/Ventas/SolicitudesSAT.aspx new file mode 100644 index 000000000..209472801 --- /dev/null +++ b/Ventas/SolicitudesSAT.aspx @@ -0,0 +1,344 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="SolicitudesSAT.aspx.cs" Inherits="Ventas_SolicitudesSAT" %> + + + + + + + Solicitudes CFDI SAT + + + + + + +
  • + Verificar Solicitudes
  • +
  • + Solicitar SAT
  • +
    +
    +
    + + + + + +
    +
    +
    + + <%----%> +
    +
    +
    +
    + Tipo: +
    +
    + + + + + +
    +
    + Fecha Inicio(ing.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin(ing.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Inicio(Sol.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin(Sol.): +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + diff --git a/Ventas/SolicitudesSAT.aspx.cs b/Ventas/SolicitudesSAT.aspx.cs new file mode 100644 index 000000000..12aad683c --- /dev/null +++ b/Ventas/SolicitudesSAT.aspx.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Ventas_SolicitudesSAT : ClsPaginas +{ + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + //this.RegistraScript("$('#ModalSolicitarSat').modal();"); + int rtipo = Request["tipo"] == null ? -1 : Request["tipo"].ToString().ToEntero(); + string rfIngInicio = Request["fIngInicio"] == null ? "" : Request["fIngInicio"].ToString().Trim(); + string rfIngFin = Request["fIngFin"] == null ? "" : Request["fIngFin"].ToString().Trim(); + string rfSolInicio = Request["fSolInicio"] == null ? "" : Request["fSolInicio"].ToString().Trim(); + string rfSolFin = Request["fSolFin"] == null ? "" : Request["fSolFin"].ToString().Trim(); + + DateTime dValor = DateTime.Now; + dValor = DateTime.Now; if (DateTime.TryParse(rfIngInicio, out dValor)) { rfIngInicio = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfIngInicio = ""; } + dValor = DateTime.Now; if (DateTime.TryParse(rfIngFin, out dValor)) { rfIngFin = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfIngFin = ""; } + dValor = DateTime.Now; if (DateTime.TryParse(rfSolInicio, out dValor)) { rfSolInicio = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfSolInicio = ""; } + dValor = DateTime.Now; if (DateTime.TryParse(rfSolFin, out dValor)) { rfSolFin = string.Format("{0:dd/MM/yyyy}", dValor); } else { rfSolFin = ""; } + + DdlTipo.SelectedValueExist(rtipo); + txtFechaI.Text = rfIngInicio; + txtFechaF.Text = rfIngFin; + txtFechaISol.Text = rfSolInicio; + txtFechaFSol.Text = rfSolFin; + cargarDatos(); + } + } + + + private void cargarDatos() + { + int rtipo = DdlTipo.SelectedValue.ToEntero(); + string rfIngInicio = txtFechaI.Text; + string rfIngFin = txtFechaF.Text; + string rfSolInicio = txtFechaISol.Text; + string rfSolFin = txtFechaFSol.Text; + using (ClsGenerales objgral = new ClsGenerales()) + { + objgral.SAT_DescargaSolicitudesGET(UsuarioActual.CveEmpresa, rtipo, rfIngInicio, rfIngFin, rfSolInicio, rfSolFin); + GVSAT_DescargaSolicitudes.DataSource = objgral.DtResultados; + GVSAT_DescargaSolicitudes.DataBind(); + } + upDatosSAT.Update(); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + cargarDatos(); + } + + protected void LnkVerificarSolicitudes_Click(object sender, EventArgs e) + { + string direxe = string.Format("{0}{1}",AppDomain.CurrentDomain.BaseDirectory, "Utilerias\\ADSUtilerias.exe"); + + String json = string.Format("{{cveTareaProgramada:{0},cveEmpresa:{1},CveTareaProgramadaHistorial:{2},recursividad:{3},Resultado:{4},parametros:'Tipo=SP'}}", 1, UsuarioActual.CveEmpresa,-1, 0, 1);//Mod.ToLiteral(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(tarea)); + //this.Alert(string.Format("json:{0} : --mod TareaProgramada --Item {1}", DateTime.Now, json)); + try + { + string Mensajes = ""; + System.Diagnostics.Process ObjProcess = null; + { + ObjProcess = new System.Diagnostics.Process(); + ObjProcess.StartInfo.RedirectStandardOutput = true; + ObjProcess.StartInfo.FileName = direxe;//System.Configuration.ConfigurationManager.AppSettings["DirUtilerias"].ToString(); + ObjProcess.StartInfo.Arguments = $"--mod TareaProgramada --Item {json} "; + ObjProcess.StartInfo.UseShellExecute = false; + ObjProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; + ObjProcess.Start(); + } + using (System.IO.StreamReader myStreamReader = ObjProcess.StandardOutput) + { + Mensajes = myStreamReader.ReadLine(); + + } + } + catch (Exception ex) + { + ex.ToString().GuardaLog(); + } + cargarDatos(); + Alert("La solicitud ha sido enviada"); + } + + protected void LnkSolicitarCFDI_Click(object sender, EventArgs e) + { + string FechaI = string.Format("{0:yyyy-MM-ddTHH}:{0:mm}:{0:ss}", txtFechaIAdd.Text.ToDateTime()); + string FechaF = string.Format("{0:yyyy-MM-ddTHH}:{0:mm}:{0:ss}", txtFechaFAdd.Text.ToDateTime()); + + string direxe = string.Format("{0}{1}", AppDomain.CurrentDomain.BaseDirectory, "Utilerias\\ADSUtilerias.exe"); + + String json = string.Format("{{cveTareaProgramada:{0},cveEmpresa:{1},CveTareaProgramadaHistorial:{2},recursividad:{3},Resultado:{4},parametros:'Tipo={5}&fechai={6}&fechaf={7}'}}", 1, UsuarioActual.CveEmpresa, -1, 0, 1,DdlTipoAdd.SelectedValue, FechaI, FechaF);//Mod.ToLiteral(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(tarea)); + //this.Alert(string.Format("json:{0} : --mod TareaProgramada --Item {1}", DateTime.Now, json)); + try + { + string Mensajes = ""; + System.Diagnostics.Process ObjProcess = null; + { + ObjProcess = new System.Diagnostics.Process(); + ObjProcess.StartInfo.RedirectStandardOutput = true; + ObjProcess.StartInfo.FileName = direxe;//System.Configuration.ConfigurationManager.AppSettings["DirUtilerias"].ToString(); + ObjProcess.StartInfo.Arguments = $"--mod TareaProgramada --Item {json} "; + ObjProcess.StartInfo.UseShellExecute = false; + ObjProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; + ObjProcess.Start(); + } + using (System.IO.StreamReader myStreamReader = ObjProcess.StandardOutput) + { + Mensajes = myStreamReader.ReadLine(); + + } + } + catch (Exception ex) + { + ex.ToString().GuardaLog(); + } + cargarDatos(); + Alert("La solicitud ha sido enviada"); + } +} \ No newline at end of file