From 9372e7c8f14af216929268b3131a39d5d22690e0 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 16 May 2022 20:54:27 -0700 Subject: [PATCH 1/5] RepProductos servicios Ventas Fecha Ing, rdlc Factura Eclipse --- Empresas/15/Formatos/Factura.rdlc | 291 +------------------- Ventas/RepProductosServiciosDetalle.aspx | 33 +++ Ventas/RepProductosServiciosDetalle.aspx.vb | 1 + 3 files changed, 46 insertions(+), 279 deletions(-) diff --git a/Empresas/15/Formatos/Factura.rdlc b/Empresas/15/Formatos/Factura.rdlc index 76c1d01c9..7430540e6 100644 --- a/Empresas/15/Formatos/Factura.rdlc +++ b/Empresas/15/Formatos/Factura.rdlc @@ -1429,7 +1429,7 @@ true - 21.48868cm + 20.79018cm 0.0208cm 2.10099cm 20.06179cm @@ -2750,7 +2750,7 @@ DsOC - 4.77915cm + 4.08065cm 0.11516cm 2.29418cm 19.97108cm @@ -3175,7 +3175,7 @@ true - 14.08621cm + 13.38771cm 0.04257cm 3.74574cm 20.109cm @@ -4241,7 +4241,7 @@ true - 7.24707cm + 6.54857cm 0.11516cm 6.80033cm 20.03641cm @@ -4288,7 +4288,7 @@ Textbox8 - 20.29602cm + 19.59752cm 0.07003cm 1.01627cm 5.45089cm @@ -4749,7 +4749,7 @@ true - 17.84606cm + 17.14756cm 0.00547cm 2.25247cm 20.1554cm @@ -4763,273 +4763,6 @@ - - true - true - - - - - Nombre - - - - - - - - - - - - - - - #c4d79b - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Dirección - - - - - - - - - - - - - - - #c4d79b - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteDireccion.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Ciudad - - - - - - - - - - #c4d79b - 1.25pt - - - - - - - - #c4d79b - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteLugar.Value - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - true @@ -5059,11 +4792,11 @@ Textbox19 - 1.62495in - 5.61883in - 0.2092in - 2.26391in - 22 + 1.37495in + 5.662in + 0.23161in + 2.24597in + 16 - 23.58967cm + 22.89117cm - 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 @@ + + + + + + + + + + From b6a90d7b01ec25c81bb7ff20fca2cfa9a2b1a912 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 17 May 2022 16:45:52 -0700 Subject: [PATCH 3/5] Correcion de formato de cantidad al editar remision --- Ventas/Ventas.aspx | 2 +- Ventas/Ventas.aspx.vb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 879b6f7fd..573a49386 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1080,7 +1080,7 @@ - + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 302d66ca7..cdd38b500 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14193,6 +14193,7 @@ Partial Class Ventas If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9, TmpDTDetalle) Then OcurrioError = True ErrorList.Add("Ocurrió un error al verificar inventario de remisiones.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") + ModExtensiones.GuardaLog("Ocurrió un error al verificar inventario de remisiones.Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Exit For End If Next From 6d574f3b378e73de7922d9a3d79ccd72b3a23bf8 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 17 May 2022 17:13:08 -0700 Subject: [PATCH 4/5] Sucursales carta porte --- Ventas/Ventas.aspx.vb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index cdd38b500..2313b57c3 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -34252,11 +34252,11 @@ Partial Class Ventas Dim CveDireccionDestino As Integer = -1 If SucursalOrigenCP IsNot Nothing Then - CveDireccionOrigen = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa) + CveDireccionOrigen = ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa) End If If SucursalDestinoCP IsNot Nothing Then - CveDireccionDestino = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa) + CveDireccionDestino = ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa) End If If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then @@ -34371,9 +34371,9 @@ Partial Class Ventas SucursalOrigenCP.Colonia = Row("Colonia").ToString() SucursalOrigenCP.CP = Row("CP").ToString() SucursalOrigenCP.Municipio = Row("Municipio").ToString() - 'SucursalOrigenCP.CveEstado = Row("CveEstado").ToString().ToEntero() + SucursalOrigenCP.CveEstado = Row("CveEstado").ToString().ToEntero() SucursalOrigenCP.Estado = Row("Estado").ToString() - 'SucursalOrigenCP.CvePais = Row("CvePais").ToString().ToEntero() + SucursalOrigenCP.CvePais = Row("CvePais").ToString().ToEntero() SucursalOrigenCP.Pais = Row("Pais").ToString() SBDomicilioSucursal.AppendFormat("{0}", Row("Calle").ToString()) @@ -34435,9 +34435,9 @@ Partial Class Ventas SucursalDestinoCP.Direccion = Row("EnvioDireccion").ToString() SucursalDestinoCP.Colonia = Row("EnvioColonia").ToString() SucursalDestinoCP.Municipio = Row("EnvioCiudad").ToString() - 'SucursalDestinoCP.CveEstado = Row("CveEstado").ToString().ToEntero() + SucursalDestinoCP.CveEstado = Row("CveEstado").ToString().ToEntero() SucursalDestinoCP.Estado = Row("EnvioEstado").ToString() - 'SucursalDestinoCP.CvePais = Row("CvePais").ToString().ToEntero() + SucursalDestinoCP.CvePais = Row("CvePais").ToString().ToEntero() SucursalDestinoCP.Pais = Row("Pais").ToString() SucursalDestinoCP.CP = Row("EnvioCP").ToString() From 954ab44fc330d18df08f7b8f48e9be9af5b784de Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 17 May 2022 17:19:13 -0700 Subject: [PATCH 5/5] Movimiento de garantia en servicio a domicilio --- App_Code/Modelos.vb | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 7a6893c9d..bac3058ee 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -3825,6 +3825,49 @@ Namespace Modelos If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD2", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then OcurrioError = True End If + + ' COMIENZA: GARANTIAS + Dim CveAlmacenGarantia As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={factura.CveSubProyecto}").ToEntero() + Dim DtGarantias As DataTable = Nothing + + If ObjAcum.GetGarantiasDetalle(factura.CveVenta) Then + DtGarantias = ObjAcum.DtResultados.Copy() + End If + + If DtGarantias IsNot Nothing AndAlso DtGarantias.Rows.Count > 0 AndAlso CveAlmacenGarantia > 0 Then + Dim TotalGarantia As Decimal = 0 + Dim CveMovimientoGarantia = ObjInventario.AddMovimiento(CveAlmacenGarantia, 2, 1, factura.Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, factura.CveVenta, -1, -1, Observaciones:="", Guia:="", Modulo:="Modelos/SDGA") + Dim FolioGarantia = ObjInventario.Folio + + For Each RowGarantia As DataRow In DtGarantias.Rows + Dim CvePS = RowGarantia("CvePS").ToString().ToEntero() + Dim CveTamaño As Integer = RowGarantia("CveTamaño").ToString().ToEntero() + Dim CveUM As Integer = RowGarantia("CveUnidadMedida").ToString().ToEntero() + Dim PU As Decimal = RowGarantia("Importe").ToString().ToDecimal() ' / RowGarantia("Cantidad").ToString().ToDouble() + Dim Serie As String = RowGarantia("Comprobante").ToString + + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, Serie:=Serie, CveVentaDetalle:=RowGarantia("CveVentaDetalle").ToString.ToEntero) Then + OcurrioError = True + Exit For + End If + TotalGarantia += (RowGarantia("Cantidad").ToString().ToDecimal() * PU) + Next + + Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("EA/Gar", 53, 0, 0, 1, factura.Fecha, "Entrada Garantía", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CvePrePolizaTraspaso > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, TotalGarantia, "MOVIMIENTO DE GARANTIA", 68, "MOVIMIENTO DE GARANTIA", factura.Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then + OcurrioError = True + End If + + If Not OcurrioError AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, TotalGarantia, "MOVIMIENTO DE GARANTIA", 331, "MOVIMIENTO DE GARANTIA", factura.Fecha, -1, -1, CveMovimientoAlmacen:=CveMovimientoGarantia, Contabilizable:=True, ImporteMX:=TotalGarantia) Then + OcurrioError = True + End If + Else + OcurrioError = True + End If + + End If + Else OcurrioError = True End If