Commit 804598639cc15b158dd26a8b5d5781a86fb0df57
1 parent
f3d479d2a5
Exists in
master
edicion cheque
Showing
1 changed file
with
19 additions
and
17 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -5,26 +5,28 @@ angular.module('focaModalCheque') |
| 5 | 5 | '$scope', |
| 6 | 6 | '$uibModalInstance', |
| 7 | 7 | '$uibModal', |
| 8 | - 'sugerido', | |
| 8 | + 'cheque', | |
| 9 | 9 | 'focaModalService', |
| 10 | - function($filter, $scope, $uibModalInstance, $uibModal, sugerido, focaModalService) { | |
| 11 | - $scope.cheque = { | |
| 12 | - banco: { | |
| 13 | - desbco: ''//Nombre del banco | |
| 14 | - }, | |
| 15 | - provincia: { | |
| 16 | - NOMBRE:'' | |
| 17 | - }, | |
| 18 | - localidad: { | |
| 19 | - NOMBRE: '' | |
| 20 | - }, | |
| 21 | - fechaEmision: new Date() | |
| 22 | - }; | |
| 10 | + function($filter, $scope, $uibModalInstance, $uibModal, cheque, focaModalService) { | |
| 11 | + if(cheque.esNuevo) { | |
| 12 | + $scope.cheque = { | |
| 13 | + banco: { | |
| 14 | + desbco: ''//Nombre del banco | |
| 15 | + }, | |
| 16 | + provincia: { | |
| 17 | + NOMBRE:'' | |
| 18 | + }, | |
| 19 | + localidad: { | |
| 20 | + NOMBRE: '' | |
| 21 | + }, | |
| 22 | + fechaEmision: new Date(), | |
| 23 | + importe: cheque.importe | |
| 24 | + }; | |
| 25 | + } else { | |
| 26 | + $scope.cheque = cheque; | |
| 27 | + } | |
| 23 | 28 | $scope.focused = 1; |
| 24 | 29 | |
| 25 | - if(sugerido && sugerido < 0) { | |
| 26 | - $scope.cheque.importe = Math.abs(sugerido); | |
| 27 | - } | |
| 28 | 30 | $scope.next = function(key) { |
| 29 | 31 | if(key === 13) $scope.focused++; |
| 30 | 32 | }; |