Commit 3b404e5734e8a0e09b0678a5ef4928ba3868323d
1 parent
d9a8ec7d1e
Exists in
master
ver detalles boton
Showing
4 changed files
with
40 additions
and
6 deletions
Show diff stats
gulpfile.js
| ... | ... | @@ -45,7 +45,7 @@ gulp.task('uglify', ['templates'], function() { |
| 45 | 45 | ]), |
| 46 | 46 | concat('foca-modal-factura.js'), |
| 47 | 47 | replace('src/views/', ''), |
| 48 | - replace("['ui.bootstrap', 'focaDirectivas', 'angular-ladda']", '[]'), | |
| 48 | + replace("['ui.bootstrap', 'focaDirectivas', 'angular-ladda', 'focaModal']", '[]'), | |
| 49 | 49 | gulp.dest(paths.tmp), |
| 50 | 50 | rename('foca-modal-factura.min.js'), |
| 51 | 51 | uglify(), |
src/js/app.js
src/js/controller.js
| ... | ... | @@ -6,8 +6,9 @@ angular.module('focaModalFactura') |
| 6 | 6 | '$uibModalInstance', |
| 7 | 7 | 'focaModalFacturaService', |
| 8 | 8 | 'parametrosFactura', |
| 9 | + '$uibModal', | |
| 9 | 10 | function($filter, $scope, $uibModalInstance, |
| 10 | - focaModalFacturaService, parametrosFactura | |
| 11 | + focaModalFacturaService, parametrosFactura, $uibModal | |
| 11 | 12 | ) { |
| 12 | 13 | var fecha = new Date(); |
| 13 | 14 | $scope.fechaHasta = new Date(); |
| ... | ... | @@ -44,7 +45,7 @@ angular.module('focaModalFactura') |
| 44 | 45 | //TODO hacer filtro de fecha |
| 45 | 46 | focaModalFacturaService |
| 46 | 47 | .getFacturasByIdCliente( |
| 47 | - parametrosFactura.cliente, | |
| 48 | + parametrosFactura.cliente.COD, | |
| 48 | 49 | parametrosFactura.moneda, |
| 49 | 50 | '2001-01-01', |
| 50 | 51 | '2100-12-31' |
| ... | ... | @@ -74,6 +75,23 @@ angular.module('focaModalFactura') |
| 74 | 75 | $scope.search(); |
| 75 | 76 | primera(); |
| 76 | 77 | } |
| 78 | + | |
| 79 | + $scope.verFactura = function(factura) { | |
| 80 | + var modalInstance = $uibModal.open( | |
| 81 | + { | |
| 82 | + ariaLabelledBy: 'Detalle de factura', | |
| 83 | + templateUrl: 'foca-modal-factura-detalle.html', | |
| 84 | + controller: 'focaModalFacturaDetalleController', | |
| 85 | + size: 'md', | |
| 86 | + resolve: { | |
| 87 | + factura: factura, | |
| 88 | + cliente: parametrosFactura.cliente | |
| 89 | + } | |
| 90 | + } | |
| 91 | + ); | |
| 92 | + modalInstance.result.then(); | |
| 93 | + }; | |
| 94 | + | |
| 77 | 95 | $scope.search = function() { |
| 78 | 96 | if($scope.facturas.length > 0) { |
| 79 | 97 | $scope.filteredFacturas = $filter('filter')( |
src/views/foca-modal-factura.html
| ... | ... | @@ -14,6 +14,8 @@ |
| 14 | 14 | <th class="text-right">Importe</th> |
| 15 | 15 | <th class="text-right">Saldo</th> |
| 16 | 16 | <th class="text-right"></th> |
| 17 | + <th class="text-right"></th> | |
| 18 | + <th class="text-right"></th> | |
| 17 | 19 | </tr> |
| 18 | 20 | </thead> |
| 19 | 21 | <tbody> |
| ... | ... | @@ -23,8 +25,7 @@ |
| 23 | 25 | </td> |
| 24 | 26 | </tr> |
| 25 | 27 | <tr class="selectable" |
| 26 | - ng-repeat="(key,factura) in currentPageFacturas" | |
| 27 | - ng-click="factura.checked = !factura.checked"> | |
| 28 | + ng-repeat="(key,factura) in currentPageFacturas"> | |
| 28 | 29 | <td>{{factura.numeroFactura}} {{factura.FECHA_COMPROBANTE | date : 'dd/MM/yyyy' : 'GMT'}}</td> |
| 29 | 30 | <td>{{(factura.TCO == 'FT') ? factura.NCU + ' - ' : ''}}{{factura.FEV | date : 'dd/MM/yyyy' : 'GMT'}}</td> |
| 30 | 31 | <td class="text-right"> |
| ... | ... | @@ -46,6 +47,21 @@ |
| 46 | 47 | ng-model="factura.checked" |
| 47 | 48 | /> |
| 48 | 49 | </td> |
| 50 | + <td> | |
| 51 | + <button | |
| 52 | + class="btn p-1" | |
| 53 | + ng-click="verFactura(factura)" | |
| 54 | + > | |
| 55 | + <i class="fa fa-eye" aria-hidden="true"></i> | |
| 56 | + </button> | |
| 57 | + </td> | |
| 58 | + <td> | |
| 59 | + <button | |
| 60 | + class="btn p-1" | |
| 61 | + > | |
| 62 | + <i class="fa fa-envelope-o" aria-hidden="true"></i> | |
| 63 | + </button> | |
| 64 | + </td> | |
| 49 | 65 | </tr> |
| 50 | 66 | </tbody> |
| 51 | 67 | </table> |