controller.js
1.81 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
41
42
43
44
45
46
47
48
49
50
angular.module('focaModalFacturaDetalle')
.controller('focaModalFacturaDetalleController',
[
'$scope',
'$uibModalInstance',
'focaModalFacturaDetalleService',
'factura',
function($scope, $uibModalInstance,
focaModalFacturaDetalleService, factura
) {
$scope.factura = factura;
$scope.detalles = [];
focaModalFacturaDetalleService
.getFacturasDetalleByNCO({
tip: factura.TIP,
tco: factura.TCO,
suc: factura.SUC,
nco: factura.NCO
})
.then(function(res) {
$scope.detalles = res.data;
});
$scope.cerrar = function() {
$uibModalInstance.dismiss();
};
switch(factura.TCO){
case 'NC':
$scope.factura.tipoComprobante = 'Nota de crédito';
break;
case 'CI':
$scope.factura.tipoComprobante = 'Comprobante interno';
break;
case 'ND':
$scope.factura.tipoComprobante = 'Nota de débito';
break;
case 'NI':
$scope.factura.tipoComprobante = 'No de débito interno';
break;
case 'TI':
$scope.factura.tipoComprobante = 'Ticket';
break;
case 'FT':
$scope.factura.tipoComprobante = 'Factura';
break;
}
}
]
);