Commit 9782c260169b4ed9ed91072739ab99d0a0c2853d

Authored by Benjamin Rodriguez
1 parent b0269211d2
Exists in master and in 1 other branch develop

al cambiar de cliente setea lista de precio a ninguna

Showing 1 changed file with 26 additions and 1 deletions   Show diff stats
src/js/controller.js
... ... @@ -128,6 +128,17 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl',
128 128 });
129 129 }, true);
130 130  
  131 + $scope.$watch('NotaPedido', function (newValue) {
  132 + focaBotoneraLateralService.setPausarData({
  133 + label: 'notaPedido',
  134 + val: newValue
  135 + });
  136 + focaBotoneraLateralService.setRutasPausadas({
  137 + label: 'rutas',
  138 + val: 'venta-nota-pedido/crear'
  139 + });
  140 + }, true);
  141 +
131 142 $scope.crearNotaPedido = function () {
132 143 if (!$scope.notaPedido.cliente.COD) {
133 144 focaModalService.alert('Ingrese Cliente');
... ... @@ -503,6 +514,20 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl',
503 514 modalInstance.result.then(
504 515 function (cliente) {
505 516  
  517 + if ($scope.notaPedido.precioCondicion !== undefined) {
  518 + focaModalService
  519 + .alert('Debe agregar lista de precio de cliente actual')
  520 + .then(function () {
  521 + $scope.notaPedido.precioCondicion = undefined;
  522 + $scope.$broadcast('removeCabecera',
  523 + 'Precios y Condiciones:');
  524 + $filter('filter')($scope.botonera,
  525 + { label: 'Precios y Condiciones' })[0].checked = false;
  526 + })
  527 + .catch(function () {
  528 + });
  529 + }
  530 +
506 531 if (angular.equals({}, cliente.vendedor)) {
507 532  
508 533 focaModalService
... ... @@ -744,7 +769,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl',
744 769 cotizacionPArgentino.moneda = moneda;
745 770  
746 771 actualizarCabeceraMoneda(cotizacionPArgentino);
747   - $filter('filter')($scope.botonera,
  772 + $filter('filter')($scope.botonera,
748 773 { label: 'Moneda' })[0].checked = true;
749 774 $scope.notaPedido.cotizacion = cotizacionPArgentino;
750 775 });