From 1ea97c8632ff827d1a19a88bacf529cfd0f97987 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 15 Mar 2019 15:35:18 -0300 Subject: [PATCH] code review --- src/js/controllerCisterna.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/controllerCisterna.js b/src/js/controllerCisterna.js index c679843..c967b02 100644 --- a/src/js/controllerCisterna.js +++ b/src/js/controllerCisterna.js @@ -3,7 +3,7 @@ angular.module('focaAbmVehiculo') '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', 'focaModalService', 'focaBotoneraLateralService', '$timeout', function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, - focaModalService, focaBotoneraLateralService, $timeout) { + focaModalService, focaBotoneraLateralService, $timeout) { $scope.nuevo = ($routeParams.idx > -1) ? false : true; $scope.editar = false; $scope.now = new Date(); @@ -24,7 +24,7 @@ angular.module('focaAbmVehiculo') focaBotoneraLateralService.showGuardar(true, $scope.guardar); }); - if($routeParams.idx !== -1) { + if ($routeParams.idx !== -1) { $scope.cisterna = [$routeParams.idx]; focaAbmVehiculoService .getCisternas($routeParams.idVehiculo) @@ -55,12 +55,12 @@ angular.module('focaAbmVehiculo') }; $scope.guardar = function() { - if($scope.formCisterna.$pristine) { + if ($scope.formCisterna.$pristine) { $scope.cancelar(); return; } - if(!$scope.cisterna.unidadMedida) { + if (!$scope.cisterna.unidadMedida) { focaModalService.alert('Ingrese unidad de medida'); return; } @@ -71,7 +71,7 @@ angular.module('focaAbmVehiculo') focaAbmVehiculoService .guardarCisterna($scope.cisterna, $routeParams.idx); - + $timeout(function() { $location.path('/vehiculo/' + $routeParams.idVehiculo + '/' + $scope.transportista); @@ -106,12 +106,12 @@ angular.module('focaAbmVehiculo') var totalCargado = 0; cisternas.forEach(function(cisterna, idx) { //SI EL CODIGO YA EXISTE - if(cisterna.codigo === $scope.cisterna.codigo && + if (cisterna.codigo === $scope.cisterna.codigo && idx !== $routeParams.idx && !cisterna.desactivado) { reject('Código de cisterna existente'); } - if(idx !== $routeParams.idx && + if (idx !== $routeParams.idx && !cisterna.desactivado) { totalCargado += cisterna.capacidad; } -- 1.9.1