Commit 0225c9749d27e0904d9203a5d90b46474183f156

Authored by Eric Fernandez
1 parent 08cafb03f0
Exists in master

upstream

src/js/controller.js
... ... @@ -327,7 +327,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
327 327 plazosConcat += precioCondicion[j].dias + ' ';
328 328 }
329 329 cabecera = 'Ingreso manual ' + plazosConcat.trim();
330   - }
  330 + }
331 331 $scope.articulosTabla = [];
332 332 addCabecera('Precios y condiciones:', cabecera);
333 333 }, function() {
... ... @@ -393,6 +393,35 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
393 393 };
394 394  
395 395 addCabecera('Moneda:', moneda.DETALLE);
  396 + $scope.abrirModalCotizacion(moneda.ID);
  397 + }, function() {
  398 +
  399 + }
  400 + );
  401 + };
  402 +
  403 + $scope.abrirModalCotizacion = function(idMoneda) {
  404 + var modalInstance = $uibModal.open(
  405 + {
  406 + ariaLabelledBy: 'Busqueda de Cotización',
  407 + templateUrl: 'modal-cotizacion.html',
  408 + controller: 'focaModalCotizacionController',
  409 + size: 'lg',
  410 + resolve: {idMoneda: function() {return idMoneda;}}
  411 + }
  412 + );
  413 + modalInstance.result.then(
  414 + function(cotizacion) {
  415 + $scope.notaPedido.cotizacion = {
  416 + id: cotizacion.ID,
  417 + cotizacion: cotizacion.COTIZACION
  418 + };
  419 +
  420 + addCabecera(
  421 + 'Fecha cotizacion:',
  422 + $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy')
  423 + );
  424 + addCabecera('Cotizacion:', cotizacion.COTIZACION);
396 425 }, function() {
397 426  
398 427 }
... ... @@ -473,7 +502,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
473 502 };
474 503  
475 504 function addCabecera(label, valor) {
476   - var propiedad = $filter('filter')($scope.cabecera, {label: label});
  505 + var propiedad = $filter('filter')($scope.cabecera, {label: label}, true);
477 506 if(propiedad.length === 1) {
478 507 propiedad[0].valor = valor;
479 508 } else {
... ... @@ -482,7 +511,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
482 511 }
483 512  
484 513 function removeCabecera(label) {
485   - var propiedad = $filter('filter')($scope.cabecera, {label: label});
  514 + var propiedad = $filter('filter')($scope.cabecera, {label: label}, true);
486 515 if(propiedad.length === 1){
487 516 $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1);
488 517 }
src/views/nota-pedido.html
... ... @@ -25,6 +25,7 @@
25 25 ng-blur="datepickerAbierto = false"
26 26 class="form-control form-control-sm col-8 float-right"
27 27 foca-focus="datepickerAbierto"
  28 + hasta-hoy
28 29 />
29 30 </div>
30 31 </div>