diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 53cc36e26..6eb54e465 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3146,11 +3146,11 @@ Public Class ClsNominas addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto) - retorno = RunQuery("Ocurrió un error al obtener el PA_AGRO_Embarque_ManifiestoGet.") + retorno = RunQuery("Ocurrió un error al obtener el Embarque Manifiesto .") Return retorno End Function - Public Function PA_Agro_Embarque_PalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32) As Boolean + Public Function PA_Agro_Embarque_PalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32, Optional agrupado As Boolean = False) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Agro_Embarque_PalletGet", CommandType.StoredProcedure) addParameters("@CvePallet", SqlDbType.Int, cvePallet) @@ -3165,7 +3165,8 @@ Public Class ClsNominas addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto) addParameters("@CveTemporada", SqlDbType.Int, cveTemporada) - retorno = RunQuery("Ocurrió un error al obtener el PA_Agro_Embarque_PalletGet.") + addParameters("@Agrupado", SqlDbType.Bit, agrupado) + retorno = RunQuery("Ocurrió un error al obtener el Embarque Pallet .") Return retorno End Function #Region "Visor sat" diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 4f3f81a2c..96ccb4953 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -247,6 +247,7 @@ Partial Class PopUpVerFactura Dim SCAC As String = "" Dim CAAT As String = "" Dim NumeroTrailer As String = "" + Dim Permiso As String = "" Dim tablaReporte As New DataTable @@ -282,7 +283,7 @@ Partial Class PopUpVerFactura LineaTransportacion = row("LineaTransportacion").ToString() SCAC = row("SCAC").ToString() CAAT = row("CAAT").ToString() - + Permiso = row("Permiso").ToString() 'If row("CveCamionRemolque1").ToString() = "1" Then ' Rem1Placa = "12-TF-5E" ' Remolque1 = "Remolque 1" @@ -292,8 +293,8 @@ Partial Class PopUpVerFactura 'End If - If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1) And objnom.DtResultados.Rows.Count > 0 Then - NoPallets = objnom.DtResultados.Rows.Count.ToString() + If objnom.PA_Agro_Embarque_PalletGet(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, cveEmbarqueManifiesto, -1, True) And objnom.DtResultados.Rows.Count > 0 Then + NoPallets = objnom.DtResultados.SUM("NoPallets").ToString() NoKgManifiesto = objnom.DtResultados.SUM("Peso").ToString("N2") NoBultos = objnom.DtResultados.SUM("NoCajas").ToString("N0") @@ -317,6 +318,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Camion", Camion)) params.Add(New ReportParameter("Rem1Placa", Rem1Placa)) params.Add(New ReportParameter("Remolque1", Remolque1)) + params.Add(New ReportParameter("Permiso", Permiso)) params.Add(New ReportParameter("LongitudCaja", LongitudCaja)) diff --git a/Compras/RepProductosServiciosDetalle.aspx.vb b/Compras/RepProductosServiciosDetalle.aspx.vb index 879869d8f..953b668dc 100644 --- a/Compras/RepProductosServiciosDetalle.aspx.vb +++ b/Compras/RepProductosServiciosDetalle.aspx.vb @@ -123,6 +123,9 @@ Partial Class Compras_RepProductosServiciosDetalle txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text) txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text) + If CveCultivo.ToEntero() > 0 AndAlso FechaI = "-1" AndAlso Anio = "-1" AndAlso Mes = "-1" AndAlso AnioMes = "-1" Then + txtFechaI.Text = "01/01/1900" + End If If Fecha <> "-1" Then txtFechaI.Text = Fecha txtFechaF.Text = Fecha diff --git a/GPS/EmbarqueManifiesto.rdlc b/GPS/EmbarqueManifiesto.rdlc index 0a2aa63f6..6a0389c5e 100644 --- a/GPS/EmbarqueManifiesto.rdlc +++ b/GPS/EmbarqueManifiesto.rdlc @@ -4561,13 +4561,15 @@ - + GGN: - Textbox209 @@ -4602,7 +4604,7 @@ - + =Parameters!Permiso.Value @@ -7146,7 +7148,6 @@ 2pt - true @@ -7179,7 +7180,6 @@ 2pt - true @@ -7212,7 +7212,6 @@ 2pt - true @@ -7245,7 +7244,6 @@ 2pt - true @@ -7278,7 +7276,6 @@ 2pt - true @@ -7334,6 +7331,12 @@ + + String + true + true + ReportParameter1 + String true diff --git a/SAT/SolicitudesNominaSat.aspx b/SAT/SolicitudesNominaSat.aspx index 0ea64a4d1..5a7f80ed6 100644 --- a/SAT/SolicitudesNominaSat.aspx +++ b/SAT/SolicitudesNominaSat.aspx @@ -451,9 +451,16 @@ +
+
+ + + +
+
- Solicitar + Solicitar
diff --git a/SAT/SolicitudesNominaSat.aspx.cs b/SAT/SolicitudesNominaSat.aspx.cs index 89225bcd0..f29aa6cef 100644 --- a/SAT/SolicitudesNominaSat.aspx.cs +++ b/SAT/SolicitudesNominaSat.aspx.cs @@ -2,6 +2,11 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading; +using System.Threading.Tasks; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; @@ -44,9 +49,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas { if (!IsPostBack) { - TxtRpdFechaInicio.Text = string.Format("01/01/{0}", DateTime.Now.Year - 1); - TxtRpdFechaFin.Text = string.Format("31/12/{0}", DateTime.Now.Year - 1); - LnkConsultar_Click(null, null); + 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()); + //LnkConsultar_Click(null, null); } } @@ -174,6 +179,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas } } UPModalViewSolicitudes.Update(); + var api = new GeneralesAPI(); + api.GeneraSolicitud(); + api.VerificaSolicitudesNominas(); } protected void LnkShowSolicitudes_Click(object sender, EventArgs e) { @@ -196,6 +204,9 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas using (ClsNominas nom = new ClsNominas()) { Continuar = nom.SolicitudesNominasAdd(idSolicitudCFDI, idSolicitudMetadata, estatus, observaciones, fechaInicio, fechaFin, cveUsuarioIng, cveEmpresa); + var api = new GeneralesAPI(); + api.GeneraSolicitud(); + api.VerificaSolicitudesNominas(); } if (Continuar) { @@ -207,4 +218,198 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas } } -} \ No newline at end of file +} + +public class GeneralesAPI : ADSNetLibrary.Helpers.Conexiones.SIGAPI.BaseSIGAPI +{ + public GeneralesAPI(string domainApi = "http://localhost:4001/", string token = "") : base(domainApi, token) { } + + + public object GeneraSolicitud() + { + return getData("GeneraSolicitud", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET,false); + } + public object VerificaSolicitudesNominas() + { + return getData("VerificaSolicitudesNominas", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET, false); + } +} + + +//using ADSNetLibrary. SIGAPI; +//using ADSNetLibrary. SIGAPI.Models; +//using ADSNetLibrary. SIGAPI.Models.Request; +//using ADSNetLibrary.SIGAPI.Models.Sistema; +//using System; +//using System.Collections.Generic; +////using System.IdentityModel.Tokens.Jwt; +//using System.Linq; +//using System.Net.Http; +//using System.Net.Http.Headers; +//using System.Text; +//using System.Threading; +//using System.Threading.Tasks; + +namespace ADSNetLibraryzd.Helpers.Conexiones.SIGAPI +{ + + public enum requestMethod + { + POST = 1, + GET = 2 + } + public class BaseSIGAPI + { + private const string tituloLog = "ADSNetLibrary.Helpers.Conexiones.SIGAPI"; + public string domainApi; + public string authorization; + protected string RouteController = ""; + protected string FullRoute = ""; + public string GetRoutbyclass() { string classname = this.GetType().Name; return classname.Substring(0, classname.Length - 3); } + public string GetRoute(string path) + { + if (string.IsNullOrEmpty(FullRoute)) + { + return string.Format("api/{0}/{1}", (string.IsNullOrEmpty(RouteController) ? GetRoutbyclass() : RouteController), path); + } + else + { + return string.Format("{0}{1}", FullRoute, path); + } + } + /// + /// nueva instancia de conexion para una api + /// + /// url de la api + /// llenar si se tiene si se desea obtner usuar campos usuario y pasword + public BaseSIGAPI(string domainApi, string authorization = null, string fullRoute = null) + { + if (string.IsNullOrEmpty(domainApi)) + { + domainApi = "http://localhost:4001/";//"http://jam.adssistemas.mx:4001/";//Helpers.ModVars.UrlApi; + } + this.authorization = authorization; + this.domainApi = domainApi; + this.FullRoute = fullRoute; + } + + //public string GetSIGToken(string userName, string password, int cveEmpresa) + //{ + // var objauth = new RequestLogin() { UserName = userName, Password = password, CveEmpresa = cveEmpresa }; + // var retorno = getData>("api/Usuario/Login", objauth, requestMethod.POST, false, true); + // if (retorno != null && retorno.IsSuccess) + // { + // return retorno.Result.AccessToken; + // } + // else + // { + // return null; + // } + //} + + + /// + /// Obtiene datos de la api asincrono. + /// + /// Clase genérica en donde se obtiene la información del SqlDataReader. + /// ruta sin domino ejemplo "/api/usuarios/login". + /// request object. + /// Lista de objetos. + public async Task getDataAsync(string path, object requestobject, requestMethod reqmet = requestMethod.POST, bool needauthorization = true, bool isfullpath = false) where T : class, new() + { + T objreturn = null; + using ( + HttpClient client = new HttpClient()) + { + // Setting Base address. + client.BaseAddress = new Uri(domainApi); + // Setting content type. + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + // Setting Authorization. + if (needauthorization) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", authorization); } + client.Timeout = TimeSpan.FromMinutes(15); + HttpResponseMessage response = new HttpResponseMessage(); + + var strjsonreq = Newtonsoft.Json.JsonConvert.SerializeObject(requestobject); + StringContent content = new StringContent(strjsonreq, Encoding.UTF8, "application/json"); + string route = isfullpath ? path : GetRoute(path); + try + { + + switch (reqmet) + { + case requestMethod.POST: + response = await client.PostAsync(route, content); + break; + case requestMethod.GET: + response = await client.GetAsync(route); + break; + } + if (response.IsSuccessStatusCode) + { + string jsondata = await response.Content.ReadAsStringAsync(); + + + Newtonsoft.Json.JsonSerializerSettings settings = new Newtonsoft.Json.JsonSerializerSettings + { + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore + }; + objreturn = Newtonsoft.Json.JsonConvert.DeserializeObject(jsondata, settings); + } + else { + //ModExtensiones.GuardaLog(string.Format("{0}{1}{2}{1}StatusCode:{3}{1}{4}{1}{5}{1}", tituloLog, ModVars.NewLine, route, response.StatusCode, response.RequestMessage, strjsonreq), ModVars.ADSNetLibraryLog); + } + } + catch (Exception e) { + //ModExtensiones.GuardaLog(string.Format("{0}{1}{2}{1}{3}{1}{4}{1}", tituloLog, ModVars.NewLine, route, e, strjsonreq), ModVars.ADSNetLibraryLog); + } + + } + return objreturn; + } + + /// + /// Obtiene datos de la api. + /// + /// Clase genérica en donde se obtiene la información del SqlDataReader. + /// ruta sin domino ejemplo "/api/usuarios/login". + /// request object. + /// Lista de objetos. + public T getData(string path, object requestobject, requestMethod reqmet = requestMethod.POST, bool needauthorization = true, bool isfullpath = false) where T : class, new() + { + return AsyncHelper.RunSync(() => getDataAsync(path, requestobject, reqmet, needauthorization, isfullpath)); + } + } + internal static class AsyncHelper + { + private static readonly TaskFactory _myTaskFactory = new + TaskFactory(CancellationToken.None, + TaskCreationOptions.None, + TaskContinuationOptions.None, + TaskScheduler.Default); + + public static TResult RunSync(Func> func) + { + return AsyncHelper._myTaskFactory + .StartNew>(func) + .Unwrap() + .GetAwaiter() + .GetResult(); + } + + public static void RunSync(Func func) + { + AsyncHelper._myTaskFactory + .StartNew(func) + .Unwrap() + .GetAwaiter() + .GetResult(); + } + } +} + + + + + diff --git a/vwd.webinfo b/vwd.webinfo index 2c23b8e40..9faa4bbed 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -474,6 +474,16 @@ + + + + + + + + + +