This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-05-17 08:48:09 -07:00
parent 7beb3c3f03
commit b05ce51533
7 changed files with 250 additions and 19 deletions

View File

@@ -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"

View File

@@ -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))

View File

@@ -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

View File

@@ -4561,13 +4561,15 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Value>GGN:</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox209</rd:DefaultName>
@@ -4602,7 +4604,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Value>=Parameters!Permiso.Value</Value>
<Style>
<FontSize>8pt</FontSize>
</Style>
@@ -7146,7 +7148,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7179,7 +7180,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7212,7 +7212,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7245,7 +7244,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
<TablixCell>
@@ -7278,7 +7276,6 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
</TablixCells>
@@ -7334,6 +7331,12 @@
</ReportSection>
</ReportSections>
<ReportParameters>
<ReportParameter Name="Permiso">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="NoEmbarque">
<DataType>String</DataType>
<Nullable>true</Nullable>

View File

@@ -451,9 +451,16 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaFAdd" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaFAdd" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-2" style="padding-top: 14px; padding-left: 0px;">
<div class="input-group input-sm input-small date date-picker " style="padding-left: 0px;" data-date-format="dd/mm/yyyy">
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaFAdd" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
</div>
</div>
<div class="text-right">
<asp:LinkButton ID="LnkSolicitarSat" OnClick="LnkSolicitarSat_Click" runat="server">Solicitar</asp:LinkButton>
<asp:LinkButton ID="LnkSolicitarSat" CssClass="btn btn-primary" OnClick="LnkSolicitarSat_Click" runat="server">Solicitar</asp:LinkButton>
</div>
</div>
</div>

View File

@@ -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)
{
@@ -208,3 +219,197 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
}
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<object>("GeneraSolicitud", null, ADSNetLibrary.Helpers.Conexiones.SIGAPI.requestMethod.GET,false);
}
public object VerificaSolicitudesNominas()
{
return getData<object>("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);
}
}
/// <summary>
/// nueva instancia de conexion para una api
/// </summary>
/// <param name="domainApi"> url de la api</param>
/// <param name="authorization"> llenar si se tiene si se desea obtner usuar campos usuario y pasword</param>
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<ResponseModel<ResponseLogin>>("api/Usuario/Login", objauth, requestMethod.POST, false, true);
// if (retorno != null && retorno.IsSuccess)
// {
// return retorno.Result.AccessToken;
// }
// else
// {
// return null;
// }
//}
/// <summary>
/// Obtiene datos de la api asincrono.
/// </summary>
/// <typeparam name="T">Clase genérica en donde se obtiene la información del SqlDataReader.</typeparam>
/// <param name="path">ruta sin domino ejemplo "/api/usuarios/login".</param>
/// <param name="requestobject">request object.</param>
/// <returns>Lista de objetos.</returns>
public async Task<T> getDataAsync<T>(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<T>(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;
}
/// <summary>
/// Obtiene datos de la api.
/// </summary>
/// <typeparam name="T">Clase genérica en donde se obtiene la información del SqlDataReader.</typeparam>
/// <param name="path">ruta sin domino ejemplo "/api/usuarios/login".</param>
/// <param name="requestobject">request object.</param>
/// <returns>Lista de objetos.</returns>
public T getData<T>(string path, object requestobject, requestMethod reqmet = requestMethod.POST, bool needauthorization = true, bool isfullpath = false) where T : class, new()
{
return AsyncHelper.RunSync<T>(() => getDataAsync<T>(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<TResult>(Func<Task<TResult>> func)
{
return AsyncHelper._myTaskFactory
.StartNew<Task<TResult>>(func)
.Unwrap<TResult>()
.GetAwaiter()
.GetResult();
}
public static void RunSync(Func<Task> func)
{
AsyncHelper._myTaskFactory
.StartNew<Task>(func)
.Unwrap()
.GetAwaiter()
.GetResult();
}
}
}

View File

@@ -474,6 +474,16 @@