Commit bc3d89d890e82375f80f9ddc3dc2c9582200e29e
Exists in
master
and in
2 other branches
Merge branch 'master' into 'master'
filter 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('focaCrearRemito') .controller('remitoController', |
| 23 | 23 | varlidarRemitoFacturado($scope.abrirModalFlete);}}, |
| 24 | 24 | {texto: '', accion: function() {}} |
| 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 = { |
| ... | ... | @@ -50,10 +50,6 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 50 | 50 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' |
| 51 | 51 | crearRemitoService.getCotizacionByIdMoneda(1).then(function(res) { |
| 52 | 52 | monedaPorDefecto = res.data[0]; |
| 53 | - addCabecera('Moneda:', monedaPorDefecto.DETALLE); | |
| 54 | - addCabecera('Fecha cotizacion:', | |
| 55 | - new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); | |
| 56 | - addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].VENDEDOR); | |
| 57 | 53 | $scope.remito.moneda = monedaPorDefecto; |
| 58 | 54 | $scope.remito.cotizacion = monedaPorDefecto.cotizaciones[0]; |
| 59 | 55 | }); |
| ... | ... | @@ -388,6 +384,7 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 388 | 384 | } |
| 389 | 385 | |
| 390 | 386 | $scope.cabecera = []; |
| 387 | + | |
| 391 | 388 | addCabecera('Moneda:', $scope.remito.moneda.DETALLE); |
| 392 | 389 | addCabecera( |
| 393 | 390 | 'Fecha cotizacion:', |
| ... | ... | @@ -720,12 +717,18 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 720 | 717 | $scope.articulosTabla = articulosTablaTemp; |
| 721 | 718 | $scope.remito.moneda = moneda; |
| 722 | 719 | $scope.remito.cotizacion = cotizacion; |
| 723 | - addCabecera('Moneda:', moneda.DETALLE); | |
| 724 | - addCabecera( | |
| 725 | - 'Fecha cotizacion:', | |
| 726 | - $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | |
| 727 | - ); | |
| 728 | - addCabecera('Cotizacion:', cotizacion.COTIZACION); | |
| 720 | + if(moneda.DETALLE === 'PESOS ARGENTINOS') { | |
| 721 | + removeCabecera('Moneda:'); | |
| 722 | + removeCabecera('Fecha cotizacion:'); | |
| 723 | + removeCabecera('Cotizacion:'); | |
| 724 | + }else { | |
| 725 | + addCabecera('Moneda:', moneda.DETALLE); | |
| 726 | + addCabecera( | |
| 727 | + 'Fecha cotizacion:', | |
| 728 | + $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | |
| 729 | + ); | |
| 730 | + addCabecera('Cotizacion:', cotizacion.COTIZACION); | |
| 731 | + } | |
| 729 | 732 | }, function() { |
| 730 | 733 | |
| 731 | 734 | } |
src/views/remito.html
| ... | ... | @@ -42,7 +42,8 @@ |
| 42 | 42 | <div class="row"> |
| 43 | 43 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> |
| 44 | 44 | <span class="label" ng-bind="cab.label"></span> |
| 45 | - <span class="valor" ng-bind="cab.valor"></span> | |
| 45 | + <span class="valor" ng-bind="cab.valor" ng-if="!isNumber(cab.valor)"></span> | |
| 46 | + <span class="valor" ng-bind="cab.valor | number:2" ng-if="isNumber(cab.valor)"></span> | |
| 46 | 47 | </div> |
| 47 | 48 | <a |
| 48 | 49 | class="btn col-12 btn-secondary d-sm-none" |