Commit 48241719586e284ac1b822b98a775cf946298ba8

Authored by Eric
1 parent 81cc98782d
Exists in master

edición, precio sugerido

src/js/controller.js
... ... @@ -6,14 +6,11 @@ angular.module('focaModalDetalles')
6 6 'focaModalService',
7 7 'APP',
8 8 '$timeout',
9   - 'sugerido',
10   - function($scope, $uibModalInstance, focaModalService, APP, $timeout, sugerido) {
  9 + 'parametros',
  10 + function($scope, $uibModalInstance, focaModalService, APP, $timeout, parametros) {
  11 +
11 12 $scope.mobile = APP === 'cobranza';
12   - $scope.detalles = {
13   - files: [],
14   - observaciones: '',
15   - importe: Math.abs(sugerido) || 0
16   - };
  13 + $scope.detalles = parametros;
17 14  
18 15 $scope.$watch('detalles.files', function() {
19 16 validarExtSize();
... ... @@ -28,6 +25,8 @@ angular.module('focaModalDetalles')
28 25 };
29 26  
30 27 $scope.aceptar = function() {
  28 +
  29 + $scope.detalles.importe = parseFloat($scope.detalles.importe);
31 30 $uibModalInstance.close($scope.detalles);
32 31 };
33 32  
... ... @@ -75,7 +74,6 @@ angular.module('focaModalDetalles')
75 74 };
76 75 return options;
77 76 }
78   -
79 77 function validarExtSize() {
80 78 var totalSize = 0;
81 79 var invalidExt = false;
src/views/modal-detalles.html
... ... @@ -11,7 +11,7 @@
11 11 <textarea
12 12 teclado-virtual
13 13 rows="5"
14   - ng-model="detalles.observaciones"
  14 + ng-model="detalles.observacion"
15 15 class="form-control form-control-sm"
16 16 foca-focus="focused == 9"
17 17 ng-focus="focused = 9"
... ... @@ -36,7 +36,7 @@
36 36 ng-focus="focused = 6"/>
37 37 </div>
38 38 <div class="col-md-5" ng-if="!mobile">
39   - <input
  39 + <input
40 40 type="file"
41 41 class="form-control-file"
42 42 ng-file-model="detalles.files"