();
+
+ DataTable DtTrackings = null;
+ var ObjGPS = new ClsGPS();
+ try
+ {
+ if (ObjGPS.GetRCTracking(-1, -1, 1, -1, -1))
+ {
+ DtTrackings = ObjGPS.DtResultados.Copy();
+ }
+
+ if (DtTrackings != null)
+ {
+ foreach (DataRow RowTrack in DtTrackings.Rows)
+ {
+ DataTable dtTracking = null;
+ if (ObjGPS.GetRCTrackingDatos(RowTrack["CveRCTracking"].ToString().ToEntero()))
+ {
+ dtTracking = ObjGPS.DtResultados.Copy();
+ }
+ if (dtTracking != null)
+ {
+ foreach (DataRow Row in dtTracking.Rows)
+ {
+ ListaEventos.Add(new RCGPSService.Event()
+ {
+ code = "STT",
+ date = Row["Fecha"].ToString().ToDateTime(),
+ latitude = Row["Latitud"].ToString(),
+ longitude = Row["Longitud"].ToString(),
+ asset = Row["PlacasVehiculo"].ToString(),
+ speed = Row["Velocidad"].ToString(),
+ shipment = Row["Shipment"].ToString()
+ });
+ }
+ }
+ dtTracking.Dispose();
+ dtTracking = null;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ this.OnError("Ocurrió un error al enviar los datos", ex);
+ }
+ ObjGPS.Dispose();
+ DtTrackings.Dispose();
+ DtTrackings = null;
+
+ var respuesta = WS.GPSAssetTracking(Token.token, ListaEventos.ToArray());
+
+ WS.Close();
+ context.Response.Write(JsonConvert.SerializeObject(respuesta));
+
+ }
+
+ private string UserService => "demo_cedis_corp";
+ private string PasswordService => "xxxxxxxx";
+}
\ No newline at end of file
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 3a56568cf..ce6ccabce 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -19493,7 +19493,7 @@ Partial Class Compras_Compras
Dim IdCtaContableRecepcionOCER = -1
Dim IdCtaContableRecepcionOCERME = -1
Dim IdCtaContableRecepcionOCERComplementaria = -1
- Dim Fecha As Date = Now
+ Dim Fecha As Date = TxtFecha.Text.ToDate
Dim CveProveedorInvOC As Integer = -1
Dim ProveedorNombre As String = ""
Dim SerieFolio As String = ""
@@ -19542,7 +19542,7 @@ Partial Class Compras_Compras
PUCompra = DrDiferencias("PUCompra").ToString.ToDecimal
PS = DrDiferencias("PS").ToString
- Fecha = Now
+ Fecha = TxtFecha.Text.ToDate
SerieFolio = $"OC: {DrDiferencias("FolioOC").ToString}"
CveProveedor = DrDiferencias("CveProveedor").ToString.ToEntero
ProveedorNombre = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", $"CveProveedor = {CveProveedor}").ToString
diff --git a/GPS/RecursoConfiableTracking.aspx b/GPS/RecursoConfiableTracking.aspx
new file mode 100644
index 000000000..2326002ed
--- /dev/null
+++ b/GPS/RecursoConfiableTracking.aspx
@@ -0,0 +1,153 @@
+<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RecursoConfiableTracking.aspx.vb" Inherits="GPS_RecursoConfiableTracking" %>
+
+
+
+
+
+
+ Recurso Confiable con Prestadores AVL
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Vehículo:
+
+
+
+ - Estatus:
+
+
+
+
+
+
+ - Fecha Inicio:
+
+
+ - Fecha Fin:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GPS/RecursoConfiableTracking.aspx.vb b/GPS/RecursoConfiableTracking.aspx.vb
new file mode 100644
index 000000000..7faaaf405
--- /dev/null
+++ b/GPS/RecursoConfiableTracking.aspx.vb
@@ -0,0 +1,119 @@
+Option Strict On
+Option Explicit On
+
+Imports System.Data
+Imports System.IO
+Imports System.Net
+Imports Extensiones
+Imports Microsoft.Reporting.WebForms
+Imports Newtonsoft.Json.Linq
+Imports System.Linq
+Imports System.Net.Http
+
+Partial Class GPS_RecursoConfiableTracking
+ Inherits ClsPaginas
+
+ Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
+ If Not Page.IsPostBack Then
+ CargaDatos()
+ End If
+ End Sub
+ Private Sub CargaDatos()
+ CargaDispositivos()
+ CargaTracking()
+ End Sub
+
+ Public Sub CargaDispositivos()
+
+ DdlDispositivoFiltro.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
+ DdlDispositivoFiltro.DataBind()
+ DdlDispositivoFiltro.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ DdlDispositivo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("PlacasVehiculo <> ''")
+ DdlDispositivo.DataBind()
+ DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
+ UpAgregar.Update()
+ End Sub
+ Private Sub CargaTracking()
+ Dim FechaI As DateTime = If(IsDate(txtFechaI.Text), txtFechaI.Text.ToDateTime(), MinFecha)
+ Dim FechaF As DateTime = If(IsDate(txtFechaF.Text), txtFechaF.Text.ToDateTime(), MaxFecha)
+
+ Dim ObjGPS As New ClsGPS
+ If ObjGPS.GetRCTracking(-1, DdlDispositivoFiltro.SelectedValue.ToEntero(), DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveCliente, UsuarioActual.CveEmpresa, FechaI, FechaF) Then
+ GvDatos.DataSource = ObjGPS.DtResultados
+ End If
+ ObjGPS.Dispose()
+ GvDatos.DataBind()
+ UpDatos.Update()
+ End Sub
+
+ Protected Sub LnkAgregarTracking_Click(sender As Object, e As EventArgs)
+ RegistraScript("$('#DivAgregar').modal('show');")
+ End Sub
+
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+ CargaTracking()
+ End Sub
+ Protected Sub LnkCambiarEstatus_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ Dim CveRCTracking As Integer = GvRow.DataKey("CveRCTracking").ToEntero()
+ Dim Estatus As Boolean = CBool(GvRow.DataKey("CveEstatus").ToEntero())
+
+ Dim ObjGPS As New ClsGPS
+ If ObjGPS.UpdateRCTrackingEstatus(CveRCTracking, Not Estatus, UsuarioActual.CveUsuario) Then
+ Alert("El tracking fue desactivado correctamente")
+ Else
+ Alert("Ocurrió un error al actualizar el estatus", TipoMensaje.MsgError)
+ End If
+ ObjGPS.Dispose()
+
+ CargaDatos()
+ End Sub
+ Protected Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
+
+ End Sub
+ Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
+ Dim Nombre As String = TxtNombre.Text.Trim()
+ Dim CveDispositivo As Integer = DdlDispositivo.SelectedValue.ToEntero()
+ Dim Shipment As String = TxtShipment.Text.Trim()
+
+ Dim ObjGPS As New ClsGPS
+ Dim CveRCTracking As Integer = ObjGPS.AddRCTracking(Nombre, CveDispositivo, Shipment, UsuarioActual.CveUsuario, UsuarioActual.CveCliente, UsuarioActual.CveEmpresa)
+ If CveRCTracking > 0 Then
+ Alert("El tracking fue agregado correctamente")
+ Else
+ Alert("Ocurrió un error el tracking", TipoMensaje.MsgError)
+ End If
+ ObjGPS.Dispose()
+
+ CargaDatos()
+ RegistraScript("$('#DivAgregar').modal('hide');")
+ End Sub
+
+ Protected Sub DdlDispositivo_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Dim CveDispositivo As Integer = DdlDispositivo.SelectedValue.ToEntero()
+
+ Dim RowDispositivo As DataRow = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltroPrimero($"CveDispositivo = {CveDispositivo}")
+
+ If RowDispositivo IsNot Nothing Then
+ If String.IsNullOrEmpty(RowDispositivo("PlacasVehiculo").ToString()) Then
+ Alert("El vehiculo no tiene placas asignadas", TipoMensaje.MsgAdvertencia)
+ BtnAgregar.Enabled = False
+ Else
+ BtnAgregar.Enabled = True
+ End If
+ End If
+ UpAgregar.Update()
+ End Sub
+ Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.DBCampo("CveEstatus") = "1" Then
+ e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success"
+ ElseIf e.Row.DBCampo("CveEstatus") = "0" Then
+ e.Row.FCLabel("LblEstatus").CssClass = "badge badge-secondary"
+ End If
+ End If
+ End Sub
+End Class
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index fa0be78b9..9cb9ddc3a 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -940,7 +940,7 @@ Partial Class Inventarios_TraspasoAlmacen
If dr IsNot Nothing Then
IdCuentaCostos = dr("IdCuentaCostos").ToString.ToEntero
End If
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=-importe) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
ErrorMovInv = True
End If
Contabilizable = False
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index d6baf47b7..d8d8caf02 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -1314,7 +1314,7 @@
-
+
@@ -5265,6 +5265,7 @@
+
<%--FLETES--%>
@@ -7394,6 +7395,9 @@
function Recargar() {
$('#BtnRefrescarPagina').click();
}
+ function BtnAplicaNuevaNC() {
+ $('#BtnAplicaNuevaNC').click();
+ }
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$('.DdlPSPyME').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 583103124..6bf46ad1a 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -10343,18 +10343,33 @@ Partial Class Ventas
Next
- If ImporteConcepto12 < ImporteAcumulado91 Then
- Dim ImporteOtrosIngresos As Decimal = ImporteConcepto12 - ImporteAcumulado91
- If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteOtrosIngresos, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=CveUltimaVenta, ImporteMX:=ImporteOtrosIngresos, ImporteME:=0, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
- If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, ImporteOtrosIngresos, Referencia, 211, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, ImporteME:=0, ImporteMX:=ImporteOtrosIngresos, CveSubProyecto:=CveSubProyectoContabilizar) Then
- ErrorPrepoliza = True
- End If
+ If ImporteConcepto12 <> ImporteAcumulado91 Then
+ Dim CveConceptoOtIngresos As Integer = 0
+ Dim IdCuentaContableOt As Integer = 0
+ Dim TipoMovtoOt As Boolean = False
+
+ If ImporteConcepto12 > ImporteAcumulado91 Then
+ IdCuentaContableOt = UsuarioActual.Empresa.Funcionalidad(559).ToEntero()
+ CveConceptoOtIngresos = 211
+ TipoMovtoOt = False
Else
+ IdCuentaContableOt = UsuarioActual.Empresa.IdCuentaOtrosIngresos
+ CveConceptoOtIngresos = 78
+ TipoMovtoOt = True
+ End If
+
+
+ Dim ImporteOtrosIngresos As Decimal = ImporteConcepto12 - ImporteAcumulado91
+ ' If ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ImporteOtrosIngresos, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=CveUltimaVenta, ImporteMX:=ImporteOtrosIngresos, ImporteME:=0, CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then
+ If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovtoOt, ImporteOtrosIngresos, Referencia, CveConceptoOtIngresos, Concepto, FechaMovimiento, IdCuentaContableOt, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, ImporteME:=0, ImporteMX:=ImporteOtrosIngresos, CveSubProyecto:=CveSubProyectoContabilizar) Then
ErrorPrepoliza = True
End If
+ 'Else
+ ' ErrorPrepoliza = True
+ 'End If
End If
- If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then
+ If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
'ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
@@ -11344,6 +11359,12 @@ Partial Class Ventas
End If
End If
+ 'Simplificacion de PrePolizas
+ If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
+ If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
+ Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
+ End If
+ End If
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
@@ -11361,13 +11382,6 @@ Partial Class Ventas
End If
End If
- 'Simplificacion de PrePolizas
- If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
- If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
- Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
- End If
- End If
-
'EN CASO DE SER REFACTURACION DE ANTICIPO SE ACTUALIZAN LAS VENTAS APLICADAS HACIA EL NUEVO
If NuevaFactura = 1 AndAlso CveDevolucion > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ant") Then
If Not ObjVentas.TraspasaVentasAplicadasAnt(ObjFactura.CveVenta, CveDevolucion, UsuarioActual.CveEmpresa) Then
@@ -22288,6 +22302,31 @@ Partial Class Ventas
End If
End If
End If
+
+ 'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
+ If UsuarioActual.CveEmpresa = 140 Then
+ If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
+ Alert("No se ha seleccionado ninguna nota de crédito, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
+ Else
+ AplicarNotaCreditoDesdeVenta()
+ End If
+ Else
+ AplicarNotaCreditoDesdeVenta()
+ End If
+
+ End Sub
+
+ Private Sub BtnAplicaNuevaNC_Click(sender As Object, e As EventArgs) Handles BtnAplicaNuevaNC.Click
+ If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then
+ AplicarNotaCreditoDesdeVenta(AplicaNuevoDocumento:=True)
+ Else
+ Alert("No ha seleccionado ninguna remisión de nota de crédito", TipoMensaje.MsgAdvertencia)
+ End If
+ End Sub
+
+ Private Sub AplicarNotaCreditoDesdeVenta(Optional AplicaNuevoDocumento As Boolean = False)
+ RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
+
DdlTipoComprobante.SelectedValue = "Egs"
Dim AplicaImpuestosLocales As Boolean = False
@@ -22299,16 +22338,8 @@ Partial Class Ventas
End If
ObjCliente.Dispose()
- Dim AplicaNuevoDocumento As Boolean = False
-
- 'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
- If UsuarioActual.CveEmpresa = 140 AndAlso GvCxC.Rows.Count = 0 Then
- AplicaNuevoDocumento = True
- End If
-
AplicarNC(DdlNCPS.SelectedValue.ToEntero(), EsNCAmortizacion:=ChkAplicaNCAnticipo.Checked, AplicaImpuestosLocales:=AplicaImpuestosLocales, AplicaNuevoDocumento:=AplicaNuevoDocumento)
- RegistraScript("$('#ModalAplicarNC').modal('hide');", "EscondeModalNC")
End Sub
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False)