Commit ca36b8ad9f6ded7022baa394d0cb1b2ceca91326

Authored by Nicolás Guarnieri
Exists in master and in 1 other branch develop

Merge branch 'master' into 'master'

Master(efernandez)

See merge request !20
src/js/controller.js
... ... @@ -75,13 +75,23 @@ angular.module('focaAdminSeguimiento') .controller('focaAdminSeguimientoControll
75 75 valor: ''
76 76 });
77 77 getSeguimiento();
  78 + if ($scope.actividad === 'Entrega de producto' && $scope.idUsuario != 0) {
  79 + focaAdminSeguimientoService.obtenerRemitosVehiculo($scope.idUsuario)
  80 + .then(function(res) {
  81 + var remitos = [];
  82 + for (var i = 0; i < res.data.length; i++) {
  83 + remitos = remitos.concat(res.data[i].remitos);
  84 + }
  85 + $scope.remitosVehiculo = remitos;
  86 + });
  87 + }
78 88 }
79 89 };
80 90  
81 91 $scope.fecha = function() {
82 92 getSeguimiento();
83 93 };
84   -
  94 +
85 95 function getSeguimiento() {
86 96 var now = $scope.now;
87 97 var desde = new Date(new Date(now.setHours(0)).setMinutes(0));
... ... @@ -91,7 +101,9 @@ angular.module(&#39;focaAdminSeguimiento&#39;) .controller(&#39;focaAdminSeguimientoControll
91 101 actividad: $scope.actividad,
92 102 idUsuario: $scope.idUsuario,
93 103 fechaDesde: desde,
94   - fechaHasta: new Date(new Date(now.setHours(23)).setMinutes(59))
  104 + fechaHasta: new Date(new Date(now.setHours(23)).setMinutes(59)),
  105 + entregado: $scope.filtroEstado ? true : ($scope.filtroEstado !== undefined ?
  106 + false : undefined)
95 107 };
96 108  
97 109 $scope.datosBuscados = {
src/js/osm-directive.js
... ... @@ -18,6 +18,14 @@ angular.module(&#39;focaAdminSeguimiento&#39;).directive(&#39;osm&#39;, function() {
18 18 var observacion = '';
19 19  
20 20 angular.forEach($scope.marcadores, function(marcador) {
  21 + var icon = new L.Icon({
  22 + iconUrl: 'img/marker-icon-2x-blue.png',
  23 + shadowUrl: 'img/marker-shadow.png',
  24 + iconSize: [25, 41],
  25 + iconAnchor: [12, 41],
  26 + popupAnchor: [1, -34],
  27 + shadowSize: [41, 41]
  28 + });
21 29 if ($scope.parametros.actividad === 'Nota de pedido') {
22 30 observacion = generarObservacion(getNotaPedido(marcador));
23 31 }
... ... @@ -28,11 +36,32 @@ angular.module(&#39;focaAdminSeguimiento&#39;).directive(&#39;osm&#39;, function() {
28 36  
29 37 if ($scope.parametros.actividad === 'Entrega de producto') {
30 38 observacion = getEntrega(marcador);
  39 + if (marcador.hojaRutaMovimiento.remito.rechazado) {
  40 + icon = new L.Icon({
  41 + iconUrl: 'img/marker-icon-2x-yellow.png',
  42 + shadowUrl: 'img/marker-shadow.png',
  43 + iconSize: [25, 41],
  44 + iconAnchor: [12, 41],
  45 + popupAnchor: [1, -34],
  46 + shadowSize: [41, 41]
  47 + });
  48 + } else {
  49 + icon = new L.Icon({
  50 + iconUrl: 'img/marker-icon-2x-green.png',
  51 + shadowUrl: 'img/marker-shadow.png',
  52 + iconSize: [25, 41],
  53 + iconAnchor: [12, 41],
  54 + popupAnchor: [1, -34],
  55 + shadowSize: [41, 41]
  56 + });
  57 + }
31 58 }
32 59  
33 60 if (observacion) {
34 61 $scope.markers.push(
35   - L.marker([marcador.latitud, marcador.longitud]).addTo($scope.map)
  62 + L.marker(
  63 + [marcador.latitud, marcador.longitud],
  64 + {icon: icon}).addTo($scope.map)
36 65 .bindPopup(observacion)
37 66 );
38 67  
... ... @@ -111,9 +140,9 @@ angular.module(&#39;focaAdminSeguimiento&#39;).directive(&#39;osm&#39;, function() {
111 140 marcador.recibo.PVE, marcador.recibo.NCO]) + '<br/>';
112 141 observacion += 'Cliente: ' + marcador.recibo.cliente.NOM + '<br/>';
113 142 var totalCobrado = 0;
114   - for (var i = 0; i < marcador.recibo.facturas.length; i++) {
115   - if (marcador.recibo.facturas[i].LOP === 'P') {
116   - totalCobrado += marcador.recibo.facturas[i].IMP;
  143 + for (var i = 0; i < marcador.recibo.cuerpos.length; i++) {
  144 + if (marcador.recibo.cuerpos[i].LOP === 'P') {
  145 + totalCobrado += marcador.recibo.cuerpos[i].IMP;
117 146 }
118 147 }
119 148  
... ... @@ -164,23 +193,24 @@ angular.module(&#39;focaAdminSeguimiento&#39;).directive(&#39;osm&#39;, function() {
164 193 remito.cliente.NOM + '<br/>';
165 194  
166 195 if ($scope.parametros.individual) {
167   - observacion += 'Producto: ' +
168   - remito.articulosRemito[0].descripcion + '<br/>';
169   - observacion += 'Cantidad entregada: ' +
170   - remito.carga + '<br/>';
  196 + // observacion += 'Producto: ' +
  197 + // remito.articulosRemito[0].descripcion + '<br/>';
  198 + // observacion += 'Cantidad entregada: ' +
  199 + // remito.carga + '<br/>';
171 200  
172 201 if (marcador.distancia) {
173 202 observacion += 'Distancia a casa central: ' + marcador.distancia +
174 203 'km <br/>';
175 204 }
176 205  
177   - if (marcador.observaciones) {
178   - observacion += 'Observaciones: ' + marcador.observaciones;
179   - }
180 206 observacion = 'Orden: ' + marcador.orden + '<br/>' + observacion;
181 207 } else {
182 208 observacion += 'Cantidad de entregas: ' + marcador.cantidad;
183 209 }
  210 + observacion += '<br/>';
  211 + if (remito.rechazado) {
  212 + observacion += '<strong>Motivo del rechazo: ' + remito.motivoRechazo;
  213 + }
184 214  
185 215 return observacion;
186 216 }
... ... @@ -5,6 +5,9 @@ angular.module(&#39;focaAdminSeguimiento&#39;)
5 5 return {
6 6 obtenerActividad: function(parametros) {
7 7 return $http.post(API_ENDPOINT.URL + '/seguimiento/filtros', parametros);
  8 + },
  9 + obtenerRemitosVehiculo: function(idVehiculo) {
  10 + return $http.get(API_ENDPOINT.URL + '/hoja-ruta/abierta/' + idVehiculo);
8 11 }
9 12 };
10 13 }]);
src/views/foca-admin-seguimiento.html
... ... @@ -41,7 +41,7 @@
41 41 class="btn col-12 my-1"
42 42 ng-click="individual()"
43 43 >Individual</button>
44   - <div class="form-group" ng-show="idUsuario == -1">
  44 + <div class="form-group" ng-show="idUsuario != 0">
45 45 <input
46 46 type="text"
47 47 placeholder="Vendedor"
... ... @@ -70,7 +70,7 @@
70 70 ng-show="actividad == 'Cobranza'"
71 71 >
72 72 </div>
73   - <div ng-show="actividad === 'Entrega de producto'">
  73 + <div ng-show="actividad === 'Entrega de producto' && idUsuario != 0">
74 74 <div class="custom-control custom-radio">
75 75 <input
76 76 type="radio"
... ... @@ -78,7 +78,7 @@
78 78 id="idTodos"
79 79 name="filtro"
80 80 ng-model="filtroEstado"
81   - ng-change="search()"
  81 + ng-change="search(13)"
82 82 checked>
83 83 <label class="custom-control-label pb-3" for="idTodos"></label>
84 84 <img src="img/marker-icon-grey.png">
... ... @@ -91,8 +91,8 @@
91 91 id="entregado"
92 92 name="filtro"
93 93 ng-model="filtroEstado"
94   - ng-change="search()"
95   - ng-value="false">
  94 + ng-change="search(13)"
  95 + ng-value="true">
96 96 <label class="custom-control-label pb-3" for="entregado"></label>
97 97 <img src="img/marker-icon-green.png">
98 98 <strong>Entregado</strong>
... ... @@ -104,8 +104,8 @@
104 104 id="noEntregado"
105 105 name="filtro"
106 106 ng-model="filtroEstado"
107   - ng-change="search()"
108   - ng-value="true">
  107 + ng-change="search(13)"
  108 + ng-value="false">
109 109 <label class="custom-control-label pb-3" for="noEntregado"></label>
110 110 <img src="img/marker-icon-yellow.png">
111 111 <strong>No entregado</strong>
... ... @@ -113,7 +113,7 @@
113 113 </div>
114 114 </div>
115 115 </div>
116   - <div ng-show="actividad === 'Entrega de producto'">
  116 + <div ng-show="actividad === 'Entrega de producto' && idUsuario != 0">
117 117 <strong>Remitos pendientes de entrega</strong>
118 118 <table class="table">
119 119 <thead>
... ... @@ -124,10 +124,10 @@
124 124 </tr>
125 125 </thead>
126 126 <tbody>
127   - <tr>
128   - <td>ejemplo</td>
129   - <td>ejemplo</td>
130   - <td>ejemplo</td>
  127 + <tr ng-repeat="remito in remitosVehiculo">
  128 + <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td>
  129 + <td ng-bind="remito.nombreCliente"></td>
  130 + <td ng-bind="remito.domicilioStamp"></td>
131 131 </tr>
132 132 </tbody>
133 133 </table>