Commit 25a16b22f163aefe233ee39e486f2dc16a131a26
1 parent
1e29f17902
Exists in
master
Se muestra por defecto el contenido de los surtidores.
Showing
1 changed file
with
9 additions
and
8 deletions
Show diff stats
src/js/controllerCombustibles.js
| ... | ... | @@ -9,26 +9,27 @@ angular.module('focaCrearFactura') |
| 9 | 9 | $scope.mangueras = []; |
| 10 | 10 | $scope.colorTexto = { color: 'black' }; |
| 11 | 11 | var productosByMangera = []; |
| 12 | - | |
| 12 | + | |
| 13 | 13 | config(); |
| 14 | - | |
| 14 | + | |
| 15 | 15 | function config() { |
| 16 | 16 | |
| 17 | 17 | $scope.nombreProducto = parametros.nombreProducto; |
| 18 | 18 | setColorNombreProducto(); |
| 19 | 19 | parametros.despachos.forEach(function (despacho) { |
| 20 | - | |
| 20 | + | |
| 21 | 21 | var findCsu = productosByMangera.filter(function (csu) { |
| 22 | - return csu.csu == despacho.CSU.trim(); | |
| 22 | + return csu.csu === despacho.CSU.trim(); | |
| 23 | 23 | })[0]; |
| 24 | - | |
| 24 | + | |
| 25 | 25 | if (!findCsu) { |
| 26 | - | |
| 26 | + | |
| 27 | 27 | var mangera = { |
| 28 | 28 | csu: despacho.CSU.trim(), |
| 29 | - despachos: [despacho] | |
| 29 | + despachos: [despacho], | |
| 30 | + show: true | |
| 30 | 31 | }; |
| 31 | - | |
| 32 | + | |
| 32 | 33 | productosByMangera.unshift(mangera); |
| 33 | 34 | } else { |
| 34 | 35 | findCsu.despachos.push(despacho); |