controllerEstadoCuenta.js
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
angular.module('focaCrearFactura')
.controller('focaModalEstadoCuentaController', [
'$scope', '$uibModalInstance', 'crearFacturaService', 'parametros',
function ($scope, $uibModalInstance, crearFacturaService, parametros) {
$scope.estadoCuenta = {
autorizado: 0.0,
extracciones: 0.0,
saldo: 0.0,
situacion: false,
facturasVencidas: 0.0
};
$scope.cliente = parametros;
init();
function init() {
crearFacturaService.getResumenCuenta(parametros.idCliente)
.then(function (res) {
$scope.estadoCuenta = res.data[0];
if ($scope.estadoCuenta.saldo > 0) {
$scope.estadoCuenta.situacion = true;
} else {
$scope.estadoCuenta.situacion = false;
}
console.log($scope.estadoCuenta.situacion)
})
.catch(function (e) { console.error(e); });
}
$scope.elegirTipoDePago = function (tipoDePago) {
$uibModalInstance.close(tipoDePago);
};
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
}
]);