GeoRutas en rastreo,correciones en al facturar remisiones
This commit is contained in:
@@ -4105,6 +4105,11 @@ Namespace Modelos
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Modelos/CancelarDocumento", CvePlantillaPoliza, ObjFactura.Total, ObjFactura.Total, ObjFactura.CveMoneda, Now, ObjFactura.Cliente.Nombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
|
||||
ObjFactura.CvePrePoliza = CvePrePoliza
|
||||
|
||||
If ObjFactura.CvePrePoliza <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al generar la prepoliza de cancelación."
|
||||
End If
|
||||
|
||||
'CANCELAR PAGOS
|
||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
If Not ErrorCancelar Then
|
||||
@@ -4315,6 +4320,7 @@ Namespace Modelos
|
||||
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen AndAlso CveMovimiento > 0 Then
|
||||
Dim MensajeBitacora = "Devuelta"
|
||||
If Not ObjEventos.AddEventoBitacora(String.Format("Venta {2} en Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimiento, Folio, MensajeBitacora), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVenta) Then
|
||||
MensajeError = "Ocurrió un error al agregar la bitacora."
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
@@ -4327,12 +4333,16 @@ Namespace Modelos
|
||||
If Not ErrorCancelar Then
|
||||
If ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then
|
||||
ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, -1, True)
|
||||
ErrorCancelar = ErrorList.Count > 0
|
||||
MensajeError = "Ocurrió un error al cancelar las estimaciones del contrato."
|
||||
If ErrorList.Count > 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar las estimaciones del contrato."
|
||||
End If
|
||||
ElseIf ObjFactura.CveContrato > 0 AndAlso ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
ObjFactura.GuardarContratoAvanceEstimaciones(ObjContrato, ErrorList, 1, True)
|
||||
ErrorCancelar = ErrorList.Count > 0
|
||||
MensajeError = "Ocurrió un error al cancelar los avances del contrato."
|
||||
If ErrorList.Count > 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al cancelar los avances del contrato."
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
3871
GPS/Rastreo.aspx
3871
GPS/Rastreo.aspx
File diff suppressed because it is too large
Load Diff
@@ -617,10 +617,16 @@ Partial Class GPS_Rastreo
|
||||
|
||||
AddRowPosiciones(Vehiculo, Coord, row("SPD").ToString.ToDouble, Fecha, row("CveDispositivo").ToString.ToEntero, row("TiempoDetenido").ToString.ToDouble)
|
||||
Next
|
||||
|
||||
If ChkTrazarGeocercas.Checked Then
|
||||
Dim Dispositivos As String = Equipos.Replace(";", ",").Remove(Equipos.Length - 1, 1)
|
||||
CargaGeocercas(Dispositivos)
|
||||
End If
|
||||
|
||||
If ChkTrazarGeorutas.Checked Then
|
||||
MostarGeoRutas()
|
||||
End If
|
||||
|
||||
RegistraScript("setTimeout(function(){ $('#LnkMostarGeocercas').css('display', 'block'); },1000);")
|
||||
Else
|
||||
Alert($"No se encontraron resultados", TipoMensaje.MsgAdvertencia)
|
||||
@@ -715,6 +721,21 @@ Partial Class GPS_Rastreo
|
||||
SbJS.Append(" VerGeocercas(); },1000);")
|
||||
RegistraScript(SbJS.ToString)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub MostarGeoRutas()
|
||||
Dim count = 0
|
||||
RegistraScript($"initGeoRutas();", count.ToString())
|
||||
|
||||
For Each GvRow As GridViewRow In GvGeorutas.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
If GvRow.FCCheckBox("ChkRutas").Checked Then
|
||||
count += 1
|
||||
Dim Coord As String = SQLToGmaps(GvRow.DataKey("Coordenadas").ToString, "LINESTRING")
|
||||
RegistraScript($"creaPolylineRuta({Coord}, '{GvRow.DataKey("Color").ToString}', '{GvRow.DataKey("GeoReferencia")}')", count.ToString())
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
Protected Sub TimmerRefresh_Tick(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -1136,6 +1157,7 @@ Partial Class GPS_Rastreo
|
||||
dvDispositivos.Visible = True
|
||||
dvTrazo.Visible = False
|
||||
dvTrazoGeo.Visible = True
|
||||
dvTrazoRutas.Visible = True
|
||||
ChkTrazarGeocercas.Visible = True
|
||||
dvMinutos.Visible = False
|
||||
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
|
||||
@@ -1148,7 +1170,8 @@ Partial Class GPS_Rastreo
|
||||
dvDispositivos.Visible = True
|
||||
txtFechaF.Text = ""
|
||||
dvTrazo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoRutas.Visible = False
|
||||
dvMinutos.Visible = False
|
||||
BtnRastrear.ValidationGroup = "GrpFechas"
|
||||
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
|
||||
@@ -1160,6 +1183,7 @@ Partial Class GPS_Rastreo
|
||||
txtFechaF.Text = ""
|
||||
dvTrazo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoRutas.Visible = False
|
||||
dvDispositivos.Visible = True
|
||||
dvMinutos.Visible = False
|
||||
GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1 AND LimiteVelocidad = 1")
|
||||
@@ -1175,7 +1199,8 @@ Partial Class GPS_Rastreo
|
||||
txtFechaF.Text = ""
|
||||
dvDispositivos.Visible = True
|
||||
dvTrazo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoRutas.Visible = False
|
||||
dvMinutos.Visible = True
|
||||
dvEventos.Visible = False
|
||||
BtnRastrear.ValidationGroup = "GrpFechas"
|
||||
@@ -1188,6 +1213,7 @@ Partial Class GPS_Rastreo
|
||||
dvDispositivos.Visible = True
|
||||
dvTrazo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoRutas.Visible = False
|
||||
dvMinutos.Visible = False
|
||||
dvEventos.Visible = False
|
||||
BtnRastrear.ValidationGroup = "GrpFechas"
|
||||
@@ -1198,6 +1224,7 @@ Partial Class GPS_Rastreo
|
||||
dvDispositivos.Visible = True
|
||||
dvTrazo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoRutas.Visible = False
|
||||
dvMinutos.Visible = False
|
||||
dvEventos.Visible = False
|
||||
BtnRastrear.ValidationGroup = "xx"
|
||||
@@ -1208,6 +1235,7 @@ Partial Class GPS_Rastreo
|
||||
dvMinutos.Visible = False
|
||||
dvTrazo.Visible = True
|
||||
dvTrazoGeo.Visible = True
|
||||
dvTrazoRutas.Visible = True
|
||||
dvEventos.Visible = False
|
||||
BtnRastrear.ValidationGroup = "xx"
|
||||
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
|
||||
@@ -1219,7 +1247,8 @@ Partial Class GPS_Rastreo
|
||||
dvDispositivos.Visible = True
|
||||
dvMinutos.Visible = False
|
||||
dvTrazo.Visible = True
|
||||
dvTrazoGeo.Visible = True
|
||||
dvTrazoGeo.Visible = True
|
||||
dvTrazoRutas.Visible = True
|
||||
dvEventos.Visible = False
|
||||
BtnRastrear.ValidationGroup = "xx"
|
||||
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
|
||||
@@ -1229,7 +1258,8 @@ Partial Class GPS_Rastreo
|
||||
dvDispositivos.Visible = False
|
||||
dvMinutos.Visible = False
|
||||
dvTrazo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoGeo.Visible = False
|
||||
dvTrazoRutas.Visible = False
|
||||
dvEventos.Visible = False
|
||||
BtnRastrear.ValidationGroup = "xx"
|
||||
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
|
||||
@@ -1246,6 +1276,11 @@ Partial Class GPS_Rastreo
|
||||
RegistraScript("$('#dvConsulta').modal();TerminaDibujado();")
|
||||
myModalLabel2.InnerHtml = "Contador de pasajeros"
|
||||
End If
|
||||
If dvTrazoRutas.Visible Then
|
||||
CargaGeoRutas()
|
||||
Else
|
||||
RegistraScript("$('#LnkMostarGeoRutas').css('display', 'none');")
|
||||
End If
|
||||
If opcion <> "Speed" AndAlso opcion <> "TPS" AndAlso Filtrado Then
|
||||
CargaDispositivos()
|
||||
Filtrado = False
|
||||
@@ -2122,5 +2157,24 @@ Partial Class GPS_Rastreo
|
||||
End Try
|
||||
End Using
|
||||
Return retorno
|
||||
End Function
|
||||
End Function
|
||||
#Region "G E O R U T A S"
|
||||
Protected Sub ChkTrazarGeorutas_CheckedChanged(sender As Object, e As EventArgs)
|
||||
If ChkTrazarGeorutas.Checked Then
|
||||
RegistraScript("$('#DivGeoRutas').modal('show');")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGeoRutas()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GeoReferenciaGet(-1, 1, "Ruta", UsuarioActual.CveCliente) Then
|
||||
GvGeorutas.DataSource = ObjGPS.DtResultados
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
GvGeorutas.DataBind()
|
||||
|
||||
UpGeorutas.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
145
GPS/Rastreo/JS/GeoRutas.js
Normal file
145
GPS/Rastreo/JS/GeoRutas.js
Normal file
@@ -0,0 +1,145 @@
|
||||
//REGION GEORUTAS
|
||||
var markersRutas = [];
|
||||
var polylinesGeoRutas = [];
|
||||
var polybounds = [];
|
||||
|
||||
function initGeoRutas() {
|
||||
NuevaConsultaGeoRutas();
|
||||
var upRutasDiv = document.createElement('div');
|
||||
var upRutas = new ControlGeoRutas(upRutasDiv, map);
|
||||
|
||||
map.controls[google.maps.ControlPosition.TOP_LEFT].push(upRutasDiv);
|
||||
}
|
||||
|
||||
function creaPolylineRuta(coords, color, GeoCerca) {
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
|
||||
polyline.setMap(map);
|
||||
polylinesGeoRutas.push(polyline);
|
||||
polybounds.push(coords[0]);
|
||||
polybounds.push(coords[coords.length - 1]);
|
||||
CreaMarcadorPoligonoRuta(coords, GeoCerca);
|
||||
}
|
||||
|
||||
function CreaMarcadorPoligonoRuta(coords, GeoCerca) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
}
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: bounds.getCenter(),
|
||||
title: GeoCerca,
|
||||
map: map
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: '<h4><b>' + GeoCerca + '</b></h4>'
|
||||
});
|
||||
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
|
||||
markersRutas.push(marker);
|
||||
}
|
||||
|
||||
function NuevaConsultaGeoRutas() {
|
||||
|
||||
for (var i = 0; i < polylinesGeoRutas.length; i++) {
|
||||
polylinesGeoRutas[i].setMap(null);
|
||||
}
|
||||
|
||||
for (var i = 0; i < markersRutas.length; i++) {
|
||||
markersRutas[i].setMap(null);
|
||||
}
|
||||
|
||||
polylinesGeoRutas = [];
|
||||
polybounds = [];
|
||||
markersRutas = [];
|
||||
}
|
||||
|
||||
function ControlGeoRutas(controlDiv, map) {
|
||||
|
||||
// Set CSS for the control border.
|
||||
var controlUI = document.createElement('div');
|
||||
controlUI.style.marginLeft = '10px';
|
||||
controlUI.style.zIndex = '0';
|
||||
controlUI.style.cursor = 'pointer';
|
||||
// controlUI.style.position = 'absolute';
|
||||
controlUI.style.left = "0px";
|
||||
controlUI.style.width = "150px";
|
||||
controlUI.style.marginTop = "10px"
|
||||
controlUI.style.top = "0px";
|
||||
controlUI.className = 'gmnoprint';
|
||||
|
||||
controlDiv.appendChild(controlUI);
|
||||
|
||||
var ControlSub1 = document.createElement('div')
|
||||
ControlSub1.style.float = 'left';
|
||||
ControlSub1.className = 'gm-style-mtc'
|
||||
controlUI.appendChild(ControlSub1)
|
||||
|
||||
var ControlSub2 = document.createElement('div')
|
||||
ControlSub2.style.direction = 'ltr';
|
||||
ControlSub2.style.overflow = 'hidden';
|
||||
ControlSub2.id = "LnkMostarGeoRutas"
|
||||
ControlSub2.style.textAlign = 'center';
|
||||
ControlSub2.style.position = 'relative';
|
||||
ControlSub2.style.color = 'rgb(0,0,0)';
|
||||
ControlSub2.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
ControlSub2.style.msUserSelect = 'none;';
|
||||
ControlSub2.style.fontSize = '11px'
|
||||
ControlSub2.style.display = 'block'
|
||||
ControlSub2.style.backgroundColor = 'rgb(255,255,255)'
|
||||
ControlSub2.style.padding = '11px'
|
||||
ControlSub2.style.backgroundClip = 'padding-box'
|
||||
ControlSub2.style.minWidth = '28px'
|
||||
ControlSub2.style.fontWeight = '500'
|
||||
ControlSub2.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
|
||||
ControlSub2.innerHTML = 'Mostrar GeoRutas'
|
||||
ControlSub1.appendChild(ControlSub2)
|
||||
|
||||
ControlSub1.addEventListener('click', function () {
|
||||
VerGeoRutas();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var IsRutasVisibles = false;
|
||||
|
||||
function VerGeoRutas() {
|
||||
if (IsRutasVisibles) {
|
||||
HideGeoRutas();
|
||||
IsRutasVisibles = false;
|
||||
} else {
|
||||
CargaGeoRutas();
|
||||
IsRutasVisibles = true;
|
||||
}
|
||||
}
|
||||
|
||||
function HideGeoRutas() {
|
||||
for (var i = 0; i < polylinesGeoRutas.length; i++) {
|
||||
polylinesGeoRutas[i].setMap(null);
|
||||
}
|
||||
for (var j = 0; j < markersRutas.length; j++) {
|
||||
markersRutas[j].setMap(null);
|
||||
}
|
||||
}
|
||||
|
||||
function CargaGeoRutas() {
|
||||
for (var i = 0; i < polylinesGeoRutas.length; i++) {
|
||||
polylinesGeoRutas[i].setMap(map);
|
||||
}
|
||||
for (var j = 0; j < markersRutas.length; j++) {
|
||||
markersRutas[j].setMap(map);
|
||||
}
|
||||
}
|
||||
@@ -4362,7 +4362,7 @@
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GvRem" runat="server" AutoGenerateColumns="false" GridLines="None"
|
||||
CssClass="table table-grid table-striped table-advance table-hover Widthall"
|
||||
DataKeyNames="CveVenta, SubTotal, IVA,Total, CveContrato" AllowPaging="False">
|
||||
DataKeyNames="CveVenta, SubTotal, IVA,Total, CveContrato,Surtido" AllowPaging="False">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -4377,11 +4377,12 @@
|
||||
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="IVA" DataField="Iva" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Surtido" HeaderText="Surtido" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
<asp:GridView ID="GvRemPS" runat="server" AutoGenerateColumns="false" GridLines="None" Visible="false" CssClass="table table-grid table-striped table-advance table-hover Widthall"
|
||||
DataKeyNames="CveVentaDetalle, PU, Total, Cantidad, CveContrato" AllowPaging="False">
|
||||
DataKeyNames="CveVentaDetalle, PU, Total, Cantidad, CveContrato,Surtido" AllowPaging="False">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
@@ -4406,6 +4407,7 @@
|
||||
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="PU" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Surtido" HeaderText="Surtido" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
@@ -22485,6 +22485,25 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'VERIFICA QUE LAS FACTURAS TENGAN EL MISMO ESTATUS EN ALMACEN (NO MEZCLAR REMISIONES 'SURTIDAS' CON 'NO SURTIDAS')
|
||||
If dtSeleccionadas.COUNT("Surtido", "Surtido = 'Si'") > 0 AndAlso dtSeleccionadas.COUNT("Surtido", "Surtido = 'No'") > 0 Then
|
||||
Dim SbRem As New StringBuilder
|
||||
SbRem.Append("Solo debe seleccionar remisiones con el mismo estatus de almacen. Por favor verifique y vuelva a intentar.</br>")
|
||||
|
||||
SbRem.Append("<b>Remisiones Surtidas:</b></br>")
|
||||
For Each RowSurtida As DataRow In dtSeleccionadas.FiltraParametros("Surtido = 'Si'", DistinctColumns:={"Folio"}).Rows
|
||||
SbRem.AppendFormat("{0}</br>", RowSurtida("Folio"))
|
||||
Next
|
||||
|
||||
SbRem.Append("<b>Remisiones No Surtidas:</b></br>")
|
||||
For Each RowSurtida As DataRow In dtSeleccionadas.FiltraParametros("Surtido = 'No'", DistinctColumns:={"Folio"}).Rows
|
||||
SbRem.AppendFormat("{0}</br>", RowSurtida("Folio"))
|
||||
Next
|
||||
|
||||
Alert(SbRem.ToString(), TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
DdlMoneda.SelectedValue = GlobalDTMonedas.FiltroPrimeroValor("CveMoneda", $"Abreviatura = '{dtSeleccionadas.FiltroPrimeroValor("Abreviatura")}'")
|
||||
DdlMoneda.Enabled = False
|
||||
CambiaMoneda()
|
||||
|
||||
Reference in New Issue
Block a user