From 0225c9749d27e0904d9203a5d90b46474183f156 Mon Sep 17 00:00:00 2001 From: efernandez Date: Wed, 31 Oct 2018 17:53:16 -0300 Subject: [PATCH] upstream --- src/js/controller.js | 35 ++++++++++++++++++++++++++++++++--- src/views/nota-pedido.html | 1 + 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index 0e098cb..9096916 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -327,7 +327,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', plazosConcat += precioCondicion[j].dias + ' '; } cabecera = 'Ingreso manual ' + plazosConcat.trim(); - } + } $scope.articulosTabla = []; addCabecera('Precios y condiciones:', cabecera); }, function() { @@ -393,6 +393,35 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }; addCabecera('Moneda:', moneda.DETALLE); + $scope.abrirModalCotizacion(moneda.ID); + }, function() { + + } + ); + }; + + $scope.abrirModalCotizacion = function(idMoneda) { + var modalInstance = $uibModal.open( + { + ariaLabelledBy: 'Busqueda de Cotización', + templateUrl: 'modal-cotizacion.html', + controller: 'focaModalCotizacionController', + size: 'lg', + resolve: {idMoneda: function() {return idMoneda;}} + } + ); + modalInstance.result.then( + function(cotizacion) { + $scope.notaPedido.cotizacion = { + id: cotizacion.ID, + cotizacion: cotizacion.COTIZACION + }; + + addCabecera( + 'Fecha cotizacion:', + $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') + ); + addCabecera('Cotizacion:', cotizacion.COTIZACION); }, function() { } @@ -473,7 +502,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', }; function addCabecera(label, valor) { - var propiedad = $filter('filter')($scope.cabecera, {label: label}); + var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); if(propiedad.length === 1) { propiedad[0].valor = valor; } else { @@ -482,7 +511,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', } function removeCabecera(label) { - var propiedad = $filter('filter')($scope.cabecera, {label: label}); + var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); if(propiedad.length === 1){ $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); } diff --git a/src/views/nota-pedido.html b/src/views/nota-pedido.html index f68af15..da97d16 100644 --- a/src/views/nota-pedido.html +++ b/src/views/nota-pedido.html @@ -25,6 +25,7 @@ ng-blur="datepickerAbierto = false" class="form-control form-control-sm col-8 float-right" foca-focus="datepickerAbierto" + hasta-hoy /> -- 1.9.1