Commit 31c67c04ddba4992be16903862a819ff06791ccd
1 parent
4a44bdb256
Exists in
master
borro console.log
Showing
1 changed file
with
0 additions
and
1 deletions
Show diff stats
src/js/controllerEstadoCuenta.js
1 | angular.module('focaCrearFactura') | 1 | angular.module('focaCrearFactura') |
2 | .controller('focaModalEstadoCuentaController', [ | 2 | .controller('focaModalEstadoCuentaController', [ |
3 | '$scope', '$uibModalInstance', 'crearFacturaService', 'parametros', | 3 | '$scope', '$uibModalInstance', 'crearFacturaService', 'parametros', |
4 | function ($scope, $uibModalInstance, crearFacturaService, parametros) { | 4 | function ($scope, $uibModalInstance, crearFacturaService, parametros) { |
5 | 5 | ||
6 | $scope.estadoCuenta = { | 6 | $scope.estadoCuenta = { |
7 | autorizado: 0.0, | 7 | autorizado: 0.0, |
8 | extracciones: 0.0, | 8 | extracciones: 0.0, |
9 | saldo: 0.0, | 9 | saldo: 0.0, |
10 | situacion: false, | 10 | situacion: false, |
11 | facturasVencidas: 0.0 | 11 | facturasVencidas: 0.0 |
12 | }; | 12 | }; |
13 | $scope.cliente = parametros; | 13 | $scope.cliente = parametros; |
14 | 14 | ||
15 | init(); | 15 | init(); |
16 | 16 | ||
17 | function init() { | 17 | function init() { |
18 | 18 | ||
19 | crearFacturaService.getResumenCuenta(parametros.idCliente) | 19 | crearFacturaService.getResumenCuenta(parametros.idCliente) |
20 | .then(function (res) { | 20 | .then(function (res) { |
21 | $scope.estadoCuenta = res.data[0]; | 21 | $scope.estadoCuenta = res.data[0]; |
22 | if ($scope.estadoCuenta.saldo > 0) { | 22 | if ($scope.estadoCuenta.saldo > 0) { |
23 | $scope.estadoCuenta.situacion = true; | 23 | $scope.estadoCuenta.situacion = true; |
24 | } else { | 24 | } else { |
25 | $scope.estadoCuenta.situacion = false; | 25 | $scope.estadoCuenta.situacion = false; |
26 | } | 26 | } |
27 | console.log($scope.estadoCuenta.situacion) | ||
28 | }) | 27 | }) |
29 | .catch(function (e) { console.error(e); }); | 28 | .catch(function (e) { console.error(e); }); |
30 | } | 29 | } |
31 | 30 | ||
32 | $scope.elegirTipoDePago = function (tipoDePago) { | 31 | $scope.elegirTipoDePago = function (tipoDePago) { |
33 | $uibModalInstance.close(tipoDePago); | 32 | $uibModalInstance.close(tipoDePago); |
34 | }; | 33 | }; |
35 | 34 | ||
36 | $scope.cancel = function () { | 35 | $scope.cancel = function () { |
37 | $uibModalInstance.dismiss('cancel'); | 36 | $uibModalInstance.dismiss('cancel'); |
38 | }; | 37 | }; |
39 | } | 38 | } |
40 | ]); | 39 | ]); |
41 | 40 |