diff --git a/src/js/controller.js b/src/js/controller.js index cdfed11..6578b76 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -145,10 +145,10 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', focaModalService.alert('Ingrese Cliente'); return; } - if (!$scope.notaPedido.vendedor.id) { - focaModalService.alert('Este cliente no tiene vendedor asignado'); - return; - } else if ($scope.notaPedido.idRemito === -1) { + // if (!$scope.notaPedido.vendedor.id) { + // focaModalService.alert('Este cliente no tiene vendedor asignado'); + // return; + if ($scope.notaPedido.idRemito === -1) { focaBotoneraLateralService.alert('No se puede modificar esta nota de pedido'); return; } else if (!$scope.notaPedido.proveedor.COD) { @@ -181,7 +181,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', id: $scope.notaPedido.id, fechaCarga: new Date($scope.notaPedido.fechaCarga) .toISOString().slice(0, 19).replace('T', ' '), - idVendedor: $scope.notaPedido.vendedor.id, + // idVendedor: $scope.notaPedido.vendedor.id, idCliente: $scope.notaPedido.cliente.COD, nombreCliente: $scope.notaPedido.cliente.NOM, cuitCliente: $scope.notaPedido.cliente.CUIT, @@ -236,8 +236,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', crearNotaPedidoService.crearPlazosParaNotaPedido(plazosACrear); } - notaPedidoBusinessService.addEstado(data.data.id, - $scope.notaPedido.vendedor.id); + notaPedidoBusinessService.addEstado(data.data.id); focaBotoneraLateralService.endGuardar(true); $scope.saveLoading = false; @@ -507,7 +506,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', resolve: { parametros: function () { return { - vendedor: $scope.idVendedor, + // vendedor: $scope.idVendedor, cobrador: null, searchText: $scope.notaPedido.cliente ? $scope.notaPedido.cliente.NOM : '' @@ -516,7 +515,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', }, size: 'lg' } - ); + ); modalInstance.result.then( function (cliente) { @@ -534,15 +533,15 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', }); } - if (angular.equals({}, cliente.vendedor)) { + // if (angular.equals({}, cliente.vendedor)) { - focaModalService - .alert('El cliente seleccionado no tiene tiene ' + - 'vendedor asignado.') - .then($scope.seleccionarCliente); + // focaModalService + // .alert('El cliente seleccionado no tiene tiene ' + + // 'vendedor asignado.') + // .then($scope.seleccionarCliente); - return; - } + // return; + // } $scope.abrirModalDomicilios(cliente); }, function () { } @@ -610,14 +609,14 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', $scope.notaPedido.domicilio = domicilio; $scope.notaPedido.cliente = cliente; - $scope.notaPedido.vendedor = cliente.vendedor; + // $scope.notaPedido.vendedor = cliente.vendedor; - $scope.$broadcast('addCabecera', { - label: 'Vendedor:', - valor: $filter('rellenarDigitos') - ($scope.notaPedido.vendedor.NUM, 3) + - ' - ' + $scope.notaPedido.vendedor.NOM - }); + // $scope.$broadcast('addCabecera', { + // label: 'Vendedor:', + // valor: $filter('rellenarDigitos') + // ($scope.notaPedido.vendedor.NUM, 3) + + // ' - ' + $scope.notaPedido.vendedor.NOM + // }); var domicilioStamp = domicilio.Calle + ' ' + domicilio.Numero + ', ' + @@ -957,7 +956,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', $scope.cabeceras = []; - if (notaPedido.cotizacion.moneda.CODIGO_AFIP !== 'PES') { + if (notaPedido.cotizacion.moneda.codigo !== 'PES') { $scope.cabeceras.push({ label: 'Moneda:', valor: notaPedido.cotizacion.moneda.DETALLE @@ -978,13 +977,13 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', $filter('filter')($scope.botonera, { label: 'Moneda' })[0].checked = true; } - if (notaPedido.vendedor.NUM) { - $scope.cabeceras.push({ - label: 'Vendedor:', - valor: $filter('rellenarDigitos')(notaPedido.vendedor.NUM, 3) + - ' - ' + notaPedido.vendedor.NOM - }); - } + // if (notaPedido.vendedor.NUM) { + // $scope.cabeceras.push({ + // label: 'Vendedor:', + // valor: $filter('rellenarDigitos')(notaPedido.vendedor.NUM, 3) + + // ' - ' + notaPedido.vendedor.NOM + // }); + // } if (notaPedido.cliente.COD) { $scope.cabeceras.push({