From c5477f397e6736df050c399a156bd077d8f18dbd Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 6 Sep 2019 18:31:13 -0500 Subject: [PATCH 1/4] agregando el aplical para ventas al ordenesServicios --- OS/OrdenesServicios.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index a90790e77..023027ecb 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -643,7 +643,7 @@ Partial Class OS_OrdenesServicios End Sub Private Sub CargaPS(CveClasificacion As Integer, Objeto As DropDownList) Objeto.Items.Clear() - Objeto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1).FiltraParametros(" CveTipoPS=1") + Objeto.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1, AplicaParaVenta:=1).FiltraParametros(" CveTipoPS=1") Objeto.DataBind() Objeto.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2")) Objeto.Items.Insert(0, New ListItem("Seleccione el Servicio", "-1")) From 9a0e7d03fc77b619c06d97f1b2a0bb02cdd6bf98 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 6 Sep 2019 23:02:09 -0700 Subject: [PATCH 2/4] Informacion de combustible en trayectos --- App_Code/ClsGPS.vb | 81 ++- App_Code/ClsPaginas.vb | 6 +- Ashx/SIGPolizaVirtual.ashx | 197 +++++++ GPS/TrayectoDetalle.aspx | 1021 +++++++++++++++++++---------------- GPS/TrayectoDetalle.aspx.vb | 14 +- 5 files changed, 838 insertions(+), 481 deletions(-) create mode 100644 Ashx/SIGPolizaVirtual.ashx diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb index 6d33bd8f3..68a050d1a 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -5028,10 +5028,85 @@ Public Class ClsGPS OnError("Ocurrió un error al obtener los clientes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno - End Function - + End Function + #End Region - + +#Region "G A S T O S" + Public Function AddGasto(Cantidad As Decimal, Precio As Decimal, Descripcion As String, Observaciones As String, Fecha As DateTime, TipoGasto As Integer, CveCliente As Integer, Optional CveDispositvo As Integer = -1, Optional CveTrayecto As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_GPS_GastosAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Cantidad", SqlDbType.Float).Value = Cantidad + .Add("@Precio", SqlDbType.Money).Value = Precio + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@TipoGasto", SqlDbType.TinyInt).Value = TipoGasto + .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo + .Add("@CveTrayecto", SqlDbType.Int).Value = CveTrayecto + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar el gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function GetGastos(CveGPSGasto As Integer, CveCliente As Integer, Optional CveDispositvo As Integer = -1, Optional CveTrayecto As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_GPS_RutasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGPSGasto", SqlDbType.Int).Value = CveGPSGasto + .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo + .Add("@CveTrayecto", SqlDbType.Int).Value = CveTrayecto + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function UpdateGasto(CveGPSGasto As Integer, Cantidad As Decimal, Precio As Decimal, Descripcion As String, Observaciones As String, Fecha As DateTime) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_GPS_GastosUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGPSGasto", SqlDbType.Int).Value = CveGPSGasto + .Add("@Cantidad", SqlDbType.Float).Value = Cantidad + .Add("@Precio", SqlDbType.Money).Value = Precio + .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + Public Function RemoveGasto(CveGPSGasto As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_GPS_GastosRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveGPSGasto", SqlDbType.Int).Value = CveGPSGasto + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el gasto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function +#End Region + #Region "F R E I G H T V E R I F Y A P I" Public Function AddShipment(CveDispositivo As Integer, Transmitir As Boolean, Customer As String, ShipmentID As String, AssetID As String, RouteID As String, TrailerID As String, Obs As String, CveCliente As Integer) As Integer Dim retorno As Integer = -1 diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ef2772013..4588d1c1e 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4019,9 +4019,11 @@ Public Class ClsPaginas PaginaDict.Add("/GPS/CatRutas.aspx".ToUpper(), 640) PaginaDict.Add("/GPS/CatGrupos.aspx".ToUpper(), 641) PaginaDict.Add("/GPS/Notificaciones.aspx".ToUpper(), -1) - PaginaDict.Add("/GPS/Shipments.aspx".ToUpper(), 673) + PaginaDict.Add("/GPS/Shipments.aspx".ToUpper(), 673) + PaginaDict.Add("/GPS/RepGastos.aspx".ToUpper(), 685) + #End Region - 'INVENTARIOS + 'INVENTARIOS #Region "Inventarios" PaginaDict.Add("/Inventarios/Fletes.aspx".ToUpper(), 550) PaginaDict.Add("/Inventarios/RepFletes.aspx".ToUpper(), 551) diff --git a/Ashx/SIGPolizaVirtual.ashx b/Ashx/SIGPolizaVirtual.ashx new file mode 100644 index 000000000..e7f2621e1 --- /dev/null +++ b/Ashx/SIGPolizaVirtual.ashx @@ -0,0 +1,197 @@ +<%@ WebHandler Language="VB" Class="SIGPolizaVirtual" %> + +Imports System +Imports System.Web +Imports System.Net.Http +Imports System.Web.Http +Imports System.Data +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq +Imports Extensiones +Imports System.IO + +Public Class SIGPolizaVirtual : Implements IHttpHandler, IRequiresSessionState + + Protected ReadOnly Property User As String = "cslth.2809@jcilink.com" + Protected ReadOnly Property Password As String = "ff31580a95f36b51ad27f970428b77a5a9245076" + + Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest + context.Response.ContentType = "application/json" + EnviarPolizaVentaWS(context) + EnviarPolizaVentaLTHWSD(context) + EnviarPolizaIndicadores(context) + End Sub + + Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable + Get + Return False + End Get + End Property + + Private Sub EnviarPolizaVentaLTHWSD(ByVal context As HttpContext) + Dim Retorno As String = "[]" + Try + Using wc As New HttpClient() + Dim Url = New Uri("http://polizavirtual.com.mx/lthwsd/api/Venta") + + Dim Parametros = New List(Of KeyValuePair(Of String, String)) + + Parametros.Add(New KeyValuePair(Of String, String)("User", User)) + Parametros.Add(New KeyValuePair(Of String, String)("password", Password)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_name", "JOSE ENRIQUE VIZCARA RENDON")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", "Prueba")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", "Prueba")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", "1900-01-01 00:00:00")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", "5417543010")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_email", "elunap@gmail.com")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", "02")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", "False")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_date", "2018-07-24 00:00:00")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("product_code", "174200")) + Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", "65047187")) + Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("used_product", "True")) + Parametros.Add(New KeyValuePair(Of String, String)("used_brand", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("used_bci", "25")) + Parametros.Add(New KeyValuePair(Of String, String)("used_month", "1")) + Parametros.Add(New KeyValuePair(Of String, String)("used_year", "2015")) + Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", "2018-07-24 00:00:00")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", "36")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", "741")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", "2015")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", "0")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_id", "32860")) + + Dim content As New FormUrlEncodedContent(Parametros) + Dim response = wc.PostAsync(Url, content).Result + + Retorno = response.Content.ReadAsStringAsync().Result + End Using + + Catch ex As Exception + ex.GuardaLog(ex.Message) + End Try + + context.Response.Write(Retorno) + End Sub + + Private Sub EnviarPolizaVentaWS(ByVal context As HttpContext) + Dim Retorno As String = "[]" + Try + Using wc As New HttpClient() + Dim Url = New Uri("http://polizavirtual.com.mx/webservice/api/Venta") + + Dim Parametros = New List(Of KeyValuePair(Of String, String)) + + Parametros.Add(New KeyValuePair(Of String, String)("User", User)) + Parametros.Add(New KeyValuePair(Of String, String)("password", Password)) + Parametros.Add(New KeyValuePair(Of String, String)("customer_name", "JOSE ENRIQUE ")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name1", "VIZCARA")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_last_name2", "RENDON")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_birthday", "1900-01-01 00:00:00")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_phone", "8186545256")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_email", "mail@mail.com")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_gender", "02")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_advertising", "False")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_date", "2018-07-24 00:00:00")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_paidby", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_type_service", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("product_code", "174925")) + Parametros.Add(New KeyValuePair(Of String, String)("product_unique_code", "65047187")) + Parametros.Add(New KeyValuePair(Of String, String)("product_sale_type", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_total", "0")) + Parametros.Add(New KeyValuePair(Of String, String)("used_product", "True")) + Parametros.Add(New KeyValuePair(Of String, String)("used_brand", "01")) + Parametros.Add(New KeyValuePair(Of String, String)("used_bci", "25")) + Parametros.Add(New KeyValuePair(Of String, String)("used_month", "1")) + Parametros.Add(New KeyValuePair(Of String, String)("used_year", "2015")) + Parametros.Add(New KeyValuePair(Of String, String)("used_sale_date", "2018-07-24 00:00:00")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_brand", "36")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_model", "741")) + Parametros.Add(New KeyValuePair(Of String, String)("customer_car_year", "2015")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_discount", "0")) + Parametros.Add(New KeyValuePair(Of String, String)("sale_id", "32860")) + + Dim content As New FormUrlEncodedContent(Parametros) + Dim response = wc.PostAsync(Url, content).Result + + Retorno = response.Content.ReadAsStringAsync().Result + End Using + + Catch ex As Exception + ex.GuardaLog(ex.Message) + End Try + + context.Response.Write(Retorno) + End Sub + + Private Sub EnviarPolizaIndicadores(ByVal context As HttpContext) + Dim Retorno As String = "[]" + Try + Using wc As New HttpClient() + Dim Url = New Uri("http://polizavirtual.com.mx/webservice/api/Indicadores") + + Dim Parametros = New List(Of KeyValuePair(Of String, String)) + + Parametros.Add(New KeyValuePair(Of String, String)("User", User)) + Parametros.Add(New KeyValuePair(Of String, String)("password", Password)) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_optima", "1")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_fullpower", "2")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_hitec", "3")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_agm", "4")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_suv", "5")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_taxi", "6")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_america", "7")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_lth", "8")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_cronos", "9")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_diener", "10")) + Parametros.Add(New KeyValuePair(Of String, String)("v_b_heavyduty", "11")) + Parametros.Add(New KeyValuePair(Of String, String)("v_m_lth", "12")) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_filtros", "13")) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_lub1", "14")) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_lubgalon", "15")) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_lub5", "16")) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_aa", "17")) + Parametros.Add(New KeyValuePair(Of String, String)("v_o_aaa", "18")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_optima", "19")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_fullpower", "20")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_hitec", "21")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_agm", "22")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_suv", "23")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_taxi", "24")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_america", "25")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_lth", "26")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_cronos", "27")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_diener", "28")) + Parametros.Add(New KeyValuePair(Of String, String)("g_b_heavyduty", "29")) + Parametros.Add(New KeyValuePair(Of String, String)("g_m_lth", "30")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_optima", "31")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_fullpower", "32")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_hitec", "33")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_agm", "34")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_suv", "35")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_taxi", "36")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_america", "37")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_lth", "38")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_cronos", "39")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_diener", "40")) + Parametros.Add(New KeyValuePair(Of String, String)("a_b_heavyduty", "41")) + + Dim content As New FormUrlEncodedContent(Parametros) + Dim response = wc.PostAsync(Url, content).Result + + Retorno = response.Content.ReadAsStringAsync().Result + End Using + + Catch ex As Exception + ex.GuardaLog(ex.Message) + End Try + + context.Response.Write(Retorno) + End Sub + +End Class \ No newline at end of file diff --git a/GPS/TrayectoDetalle.aspx b/GPS/TrayectoDetalle.aspx index aa5b05634..9ad04ede6 100644 --- a/GPS/TrayectoDetalle.aspx +++ b/GPS/TrayectoDetalle.aspx @@ -1,386 +1,461 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="TrayectoDetalle.aspx.vb" Inherits="GPS_TrayectoDetalle" %> - - - - - - - - - - - - -
  • - - - Terminar Trayecto - - -
  • -
    - - - - - - -
    -
    -
    -
    -
    - - Recorrido de la unidad: -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - - Datos del Trayecto: -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Historial de Estatus: -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - - - <%-- --%> - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    + }*/ + + .pac-container.pac-logo { + z-index: 100000; + } + + .v-center { + display: flex; + align-items: center; + } + + + + + + + + +
  • + + + Terminar Trayecto + + +
  • +
    + + + + + + +
    +
    +
    +
    +
    + + Recorrido de la unidad: +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + + Datos del Trayecto: +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + Historial de Estatus: +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + <%-- --%> + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    - Eventos de la unidad: -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - Ralentí: -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - Excesos de Velocidad: -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    -
    - - Igniciones -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - + fa-car font-green"> + Eventos de la unidad: +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + Ralentí: +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + Excesos de Velocidad: +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    + + Igniciones +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    + + Combustible +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + - - - + + + diff --git a/GPS/TrayectoDetalle.aspx.vb b/GPS/TrayectoDetalle.aspx.vb index 66b257ead..2b2344fa1 100644 --- a/GPS/TrayectoDetalle.aspx.vb +++ b/GPS/TrayectoDetalle.aspx.vb @@ -73,15 +73,20 @@ Partial Class GPS_TrayectoDetalle LtlDispositivo.Text = RowEstatus("Vehiculo").ToString() LtlFechaI.Text = If(String.IsNullOrEmpty(RowEstatus("FechaInicio").ToString()), "No ha ingresado a la geocerca de inicio", String.Format("{0:dd/MM/yyyy HH:mm tt}", RowEstatus("FechaInicio").ToString().ToDateTime())) LtlFechaF.Text = If(String.IsNullOrEmpty(RowEstatus("FechaFin").ToString()), "No ha Terminado", String.Format("{0:dd/MM/yyyy HH:mm tt}", RowEstatus("FechaFin").ToString().ToDateTime())) - LtlVMedia.Text = String.Format("{0:N2}", RowEstatus("VMedia")) - LtlVMax.Text = String.Format("{0:N2}", RowEstatus("VMax")) + LtlVMedia.Text = String.Format("{0:N2} KM/H", RowEstatus("VMedia")) + LtlVMax.Text = String.Format("{0:N2} KM/H", RowEstatus("VMax")) LtlTiempo.Text = String.Format("{0}", RowEstatus("TiempoOperativo")) - LtlKM.Text = String.Format("{0:N2}", RowEstatus("Dist")) + LtlKM.Text = String.Format("{0:N2} KM", RowEstatus("Dist")) LtlExcesosVelo.Text = String.Format("{0}", RowEstatus("ExcesosVelocidad")) LtlCombustibleI.Text = If(String.IsNullOrEmpty(RowEstatus("CombustibleInicial").ToString()), "No Disponible", String.Format("{0:N2}", RowEstatus("CombustibleInicial"))) LtlCombustibleF.Text = If(String.IsNullOrEmpty(RowEstatus("CombustibleFinal").ToString()), "No Disponible", String.Format("{0:N2}", RowEstatus("CombustibleFinal"))) + LtlCargas.Text = String.Format("{0:N0}", RowEstatus("Cargas")) + LtlDescargas.Text = String.Format("{0:N0}", RowEstatus("Descargas")) + LtlCombustibleConsumido.Text = String.Format("{0:N2} L", RowEstatus("CombustibleConsumido")) + LtlRendimiento.Text = String.Format("{0:N2} KM/L", RowEstatus("Rendimiento")) + GvIgnicion.DataSource = ObjGPS.DtSetResultados.Tables(1) GvIgnicion.DataBind() @@ -90,6 +95,9 @@ Partial Class GPS_TrayectoDetalle GvRalenti.DataSource = ObjGPS.DtSetResultados.Tables(3) GvRalenti.DataBind() + + GvCombustible.DataSource = ObjGPS.DtSetResultados.Tables(4) + GvCombustible.DataBind() End If End If Dim count = 0 From 6f54b0676dc8818cf723849aa88621060846ea43 Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Sat, 7 Sep 2019 12:05:51 -0700 Subject: [PATCH 3/4] concepto 205, en la empresa 72,80 --- Compras/Compras.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index fd069c6b0..ed0ba1c6a 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4213,7 +4213,7 @@ Partial Class Compras_Compras 'End If 'METODO DE PREPOLIZA DE ALMACEN - If UsuarioActual.CveEmpresa.Contiene(1, 119) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal If ImporteAlmacen > 0 Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then From 89fd41947800dbc23be78ae14aed1e03e1974649 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 7 Sep 2019 18:39:12 -0700 Subject: [PATCH 4/4] Gastos de Trayectos --- App_Code/ClsGPS.vb | 12 +-- GPS/RepGastos.aspx | 149 ++++++++++++++++++++++++++++++++++++ GPS/RepGastos.aspx.vb | 139 +++++++++++++++++++++++++++++++++ GPS/TrayectoDetalle.aspx | 43 ++++++++++- GPS/TrayectoDetalle.aspx.vb | 13 +++- 5 files changed, 349 insertions(+), 7 deletions(-) create mode 100644 GPS/RepGastos.aspx create mode 100644 GPS/RepGastos.aspx.vb diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb index 68a050d1a..9bffc2e1f 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -5033,7 +5033,7 @@ Public Class ClsGPS #End Region #Region "G A S T O S" - Public Function AddGasto(Cantidad As Decimal, Precio As Decimal, Descripcion As String, Observaciones As String, Fecha As DateTime, TipoGasto As Integer, CveCliente As Integer, Optional CveDispositvo As Integer = -1, Optional CveTrayecto As Integer = -1) As Boolean + Public Function AddGasto(Cantidad As Decimal, Precio As Decimal, Descripcion As String, Observaciones As String, Fecha As DateTime, TipoGasto As Integer, CveUsuario As Integer, CveCliente As Integer, Optional CveDispositivo As Integer = -1, Optional CveTrayecto As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GPS_GastosAdd") With SqlAdapter.SelectCommand.Parameters @@ -5045,6 +5045,7 @@ Public Class ClsGPS .Add("@TipoGasto", SqlDbType.TinyInt).Value = TipoGasto .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo .Add("@CveTrayecto", SqlDbType.Int).Value = CveTrayecto + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveCliente", SqlDbType.Int).Value = CveCliente End With Try @@ -5055,9 +5056,9 @@ Public Class ClsGPS End Try Return Retorno End Function - Public Function GetGastos(CveGPSGasto As Integer, CveCliente As Integer, Optional CveDispositvo As Integer = -1, Optional CveTrayecto As Integer = -1) As Boolean + Public Function GetGastos(CveGPSGasto As Integer, CveCliente As Integer, Optional CveDispositivo As Integer = -1, Optional CveTrayecto As Integer = -1) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_GPS_RutasGet") + DataAdapter("PA_GPS_GastosGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveGPSGasto", SqlDbType.Int).Value = CveGPSGasto .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo @@ -5072,7 +5073,7 @@ Public Class ClsGPS End Try Return Retorno End Function - Public Function UpdateGasto(CveGPSGasto As Integer, Cantidad As Decimal, Precio As Decimal, Descripcion As String, Observaciones As String, Fecha As DateTime) As Boolean + Public Function UpdateGasto(CveGPSGasto As Integer, Cantidad As Decimal, Precio As Decimal, Descripcion As String, Observaciones As String, Fecha As DateTime, CveUsuarioModifico As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_GPS_GastosUpdate") With SqlAdapter.SelectCommand.Parameters @@ -5081,7 +5082,8 @@ Public Class ClsGPS .Add("@Precio", SqlDbType.Money).Value = Precio .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones - .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico End With Try SqlAdapter.Fill(Data) diff --git a/GPS/RepGastos.aspx b/GPS/RepGastos.aspx new file mode 100644 index 000000000..a2110ee4f --- /dev/null +++ b/GPS/RepGastos.aspx @@ -0,0 +1,149 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepGastos.aspx.vb" Inherits="GPS_RepGastos" %> + + + + + + + Reporte de Gastos de Trayectos + + + + + + +
  • + Agregar Gasto
  • +
    +
    +
    + + + + + +
    +
    +
    + +
    +
    +
      +
    • Trayecto: + + + +
    • +
    • Fecha Inicio: +
      + + + +
      +
    • +
    • Fecha Fin: +
      + + + +
      +
    • +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + diff --git a/GPS/RepGastos.aspx.vb b/GPS/RepGastos.aspx.vb new file mode 100644 index 000000000..cff7b2e5b --- /dev/null +++ b/GPS/RepGastos.aspx.vb @@ -0,0 +1,139 @@ +Option Explicit On +Option Strict On +Imports Extensiones + +Partial Class GPS_RepGastos + Inherits ClsPaginas +#Region "PROPIEDADES" + Private Property CveGPSGasto() As Integer Get + Return If(IsNothing(ViewState("CveGPSGasto")), -1, CInt(ViewState("CveGPSGasto"))) + End Get Set + ViewState("CveGPSGasto") = Value End Set End Property + Private Property Modalidad() As String Get + Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString)) + End Get Set + ViewState("Modalidad") = Value End Set End Property +#End Region + + Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not IsPostBack Then + CargaCombos() + CargaDatos() + End If + End Sub + +#Region "CARGAS" + Private Sub CargaCombos() + + txtFechaI.Text = $"01/{DateTime.Now.ToString("MM")}/{DateTime.Now.Year} 00:00" + txtFechaF.Text = $"{DateTime.Now.ToString("dd/MM/yyyy")} 23:59" + + Dim ObjGPS As New ClsGPS() + If ObjGPS.GetTrayectos(-1, -1, UsuarioActual.CveCliente) Then + DdlTrayecto.DataSource = ObjGPS.DtResultados + DdlTrayectoFiltro.DataSource = ObjGPS.DtResultados + End If + ObjGPS.Dispose() + + DdlTrayecto.DataBind() + DdlTrayectoFiltro.DataBind() + + UPFiltros.Update() + UpModal.Update() + End Sub + Private Sub CargaDatos() + Dim ObjGral As New ClsGPS + If ObjGral.GetGastos(-1, UsuarioActual.CveCliente, CveTrayecto:=DdlTrayectoFiltro.SelectedValue.ToEntero()) Then + GvDatos.DataSource = ObjGral.DtResultados + End If + ObjGral.Dispose() + GvDatos.DataBind() + UpDatos.Update() + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + +#End Region + +#Region "BOTONES" + + Protected Sub LnkEditar_Click(sender As Object, e As EventArgs) + LimpiaModal() DivTrayecto.Visible = False Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + + CveGPSGasto = gvRow.DataKey("CveGPSGasto").ToEntero() TxtCantidad.Text = gvRow.DataKey("Cantidad") + TxtPrecio.Text = gvRow.DataKey("Precio") + TxtDescripcion.Text = gvRow.DataKey("Descripcion") + TxtObs.Text = gvRow.DataKey("Observaciones") + TxtFecha.Text = gvRow.DataKey("Fecha").ToDateTime().ToString("dd/MM/yyyy hh:mm:ss") + + Modalidad = "U" BtnGuardar.Text = "Actualizar" + ltlMotititulo.Text = "Actualizar Gasto" RegistraScript("$('#DModal').modal('show')") UpModal.Update() + End Sub + Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + Dim ObjPS As New ClsGPS + Dim CveGasto = gvRow.DataKey("CveGPSGasto").ToEntero + If ObjPS.RemoveGasto(CveGasto) Then + Alert("El gasto se eliminó correctamente.", TipoMensaje.MsgInformacion) + End If + ObjPS.Dispose() + CargaDatos() + End Sub + + Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs) + LimpiaModal() + DivTrayecto.Visible = True + Modalidad = "A" + BtnGuardar.Text = "Agregar" + ltlMotititulo.Text = "Agregar Gasto" + UpModal.Update() + RegistraScript("$('#DModal').modal()") End Sub + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + Dim ObjPS As New ClsGPS + If Modalidad = "A" Then + If ObjPS.AddGasto(TxtCantidad.Text.ToDecimal(), TxtPrecio.Text.Trim().ToDecimal(), TxtDescripcion.Text.Trim(), TxtObs.Text.Trim(), TxtFecha.Text.ToDateTime(), + 2, UsuarioActual.CveUsuario, UsuarioActual.CveCliente, CveTrayecto:=DdlTrayecto.SelectedValue.ToEntero()) Then + RegistraScript("$('#DModal').modal('hide')") + Alert("El Gasto se agregó correctamente.", TipoMensaje.MsgInformacion) + End If + ElseIf Modalidad = "U" Then + If ObjPS.UpdateGasto(CveGPSGasto, TxtCantidad.Text.ToDecimal(), TxtPrecio.Text.Trim().ToDecimal(), TxtDescripcion.Text.Trim(), TxtObs.Text.Trim(), TxtFecha.Text.ToDateTime(), UsuarioActual.CveUsuario) Then + RegistraScript("$('#DModal').modal('hide')") + Alert("El Gasto se agregó correctamente.", TipoMensaje.MsgInformacion) + End If + End If + ObjPS.Dispose() + CargaDatos() + End Sub + +#End Region + +#Region "LIMPIAR" + Protected Sub LimpiaModal() TxtCantidad.Text = "" + TxtPrecio.Text = "" + TxtDescripcion.Text = "" + TxtObs.Text = "" + TxtFecha.Text = "" DdlTrayecto.SelectedValueExist("-1") End Sub + +#End Region + +#Region "GRIDVIEW" + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + 'If e.Row.DBCampo("Estatus") = "True" Then + ' e.Row.Cells(1).ForeColor = Drawing.Color.Green + ' e.Row.Cells(1).Font.Bold = True + ' e.Row.Cells(1).Text = "Activo" + 'Else + ' e.Row.Cells(1).Text = "Inactivo" + ' e.Row.Cells(1).ForeColor = Drawing.Color.Red + ' e.Row.Cells(1).Font.Bold = True + 'End If + End If + End Sub + +#End Region + +End Class diff --git a/GPS/TrayectoDetalle.aspx b/GPS/TrayectoDetalle.aspx index 9ad04ede6..3c05926d2 100644 --- a/GPS/TrayectoDetalle.aspx +++ b/GPS/TrayectoDetalle.aspx @@ -425,7 +425,7 @@
    - + @@ -446,6 +446,47 @@ + + + + +
    +
    +
    + + Gastos +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    diff --git a/GPS/TrayectoDetalle.aspx.vb b/GPS/TrayectoDetalle.aspx.vb index 2b2344fa1..1498d5bb4 100644 --- a/GPS/TrayectoDetalle.aspx.vb +++ b/GPS/TrayectoDetalle.aspx.vb @@ -98,6 +98,10 @@ Partial Class GPS_TrayectoDetalle GvCombustible.DataSource = ObjGPS.DtSetResultados.Tables(4) GvCombustible.DataBind() + + GvGastos.DataSource = ObjGPS.DtSetResultados.Tables(5) + GvGastos.DataBind() + End If End If Dim count = 0 @@ -210,5 +214,12 @@ Partial Class GPS_TrayectoDetalle Alert("No se pudo obtener el estatus final", TipoMensaje.MsgError) End If ObjGPS.Dispose() - End Sub + End Sub + Protected Sub GvGastos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + If String.IsNullOrEmpty(e.Row.DBCampo("CveGPSGasto")) Then + e.Row.CssClass = "Totales" + End If + End If + End Sub End Class