Commit b266ef32ab5d89e3bc6dfaefd2b2f4073d5d746b
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Masterfilter number a datos numericos, oculto pesos argentinos en cabecera See merge request !3
Showing
2 changed files
Show diff stats
src/js/controller.js
| ... | ... | @@ -23,8 +23,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 23 | 23 | {texto: '', accion: function() {}} |
| 24 | 24 | ]; |
| 25 | 25 | |
| 26 | + $scope.isNumber = angular.isNumber; | |
| 26 | 27 | $scope.datepickerAbierto = false; |
| 27 | - | |
| 28 | 28 | $scope.show = false; |
| 29 | 29 | $scope.cargando = true; |
| 30 | 30 | $scope.dateOptions = { |
| ... | ... | @@ -45,10 +45,6 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 45 | 45 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' |
| 46 | 46 | crearNotaPedidoService.getCotizacionByIdMoneda(1).then(function(res) { |
| 47 | 47 | monedaPorDefecto = res.data[0]; |
| 48 | - addCabecera('Moneda:', monedaPorDefecto.DETALLE); | |
| 49 | - addCabecera('Fecha cotizacion:', | |
| 50 | - new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); | |
| 51 | - addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].VENDEDOR); | |
| 52 | 48 | $scope.notaPedido.moneda = monedaPorDefecto; |
| 53 | 49 | $scope.notaPedido.cotizacion = monedaPorDefecto.cotizaciones[0]; |
| 54 | 50 | }); |
| ... | ... | @@ -582,12 +578,18 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 582 | 578 | $scope.articulosTabla = articulosTablaTemp; |
| 583 | 579 | $scope.notaPedido.moneda = moneda; |
| 584 | 580 | $scope.notaPedido.cotizacion = cotizacion; |
| 585 | - addCabecera('Moneda:', moneda.DETALLE); | |
| 586 | - addCabecera( | |
| 587 | - 'Fecha cotizacion:', | |
| 588 | - $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | |
| 589 | - ); | |
| 590 | - addCabecera('Cotizacion:', cotizacion.VENDEDOR); | |
| 581 | + if(moneda.DETALLE == "PESOS ARGENTINOS"){ | |
| 582 | + removeCabecera('Moneda:'); | |
| 583 | + removeCabecera('Fecha cotizacion:'); | |
| 584 | + removeCabecera('Cotizacion:'); | |
| 585 | + }else{ | |
| 586 | + addCabecera('Moneda:', moneda.DETALLE); | |
| 587 | + addCabecera( | |
| 588 | + 'Fecha cotizacion:', | |
| 589 | + $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | |
| 590 | + ); | |
| 591 | + addCabecera('Cotizacion:', cotizacion.VENDEDOR); | |
| 592 | + } | |
| 591 | 593 | }, function() { |
| 592 | 594 | |
| 593 | 595 | } |
src/views/nota-pedido.html
| ... | ... | @@ -41,7 +41,8 @@ |
| 41 | 41 | <div class="row"> |
| 42 | 42 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> |
| 43 | 43 | <span class="label" ng-bind="cab.label"></span> |
| 44 | - <span class="valor" ng-bind="cab.valor"></span> | |
| 44 | + <span class="valor" ng-bind="cab.valor" ng-if="!isNumber(cab.valor)"></span> | |
| 45 | + <span class="valor" ng-bind="cab.valor | number:2" ng-if="isNumber(cab.valor)"></span> | |
| 45 | 46 | </div> |
| 46 | 47 | <a |
| 47 | 48 | class="btn col-12 btn-secondary d-sm-none" |