Commit 0cf3df0ce6d78a624e1b2b122a05a89c08801eac
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !5
Showing
5 changed files
Show diff stats
.jshintrc
1 | { | 1 | { |
2 | /* | 2 | /* |
3 | * ENVIRONMENTS | 3 | * ENVIRONMENTS |
4 | * ================= | 4 | * ================= |
5 | */ | 5 | */ |
6 | 6 | ||
7 | // Define globals exposed by modern browsers. | 7 | // Define globals exposed by modern browsers. |
8 | "browser": true, | 8 | "browser": true, |
9 | 9 | ||
10 | // Define globals exposed by jQuery. | 10 | // Define globals exposed by jQuery. |
11 | "jquery": true, | 11 | "jquery": true, |
12 | 12 | ||
13 | // Define globals exposed by Node.js. | 13 | // Define globals exposed by Node.js. |
14 | "node": true, | 14 | "node": true, |
15 | 15 | ||
16 | // Allow ES6. | 16 | // Allow ES6. |
17 | "esversion": 6, | 17 | "esversion": 6, |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * ENFORCING OPTIONS | 20 | * ENFORCING OPTIONS |
21 | * ================= | 21 | * ================= |
22 | */ | 22 | */ |
23 | 23 | ||
24 | // Force all variable names to use either camelCase style or UPPER_CASE | 24 | // Force all variable names to use either camelCase style or UPPER_CASE |
25 | // with underscores. | 25 | // with underscores. |
26 | "camelcase": true, | 26 | "camelcase": false, |
27 | 27 | ||
28 | // Prohibit use of == and != in favor of === and !==. | 28 | // Prohibit use of == and != in favor of === and !==. |
29 | "eqeqeq": true, | 29 | "eqeqeq": true, |
30 | 30 | ||
31 | // Enforce tab width of 2 spaces. | 31 | // Enforce tab width of 2 spaces. |
32 | "indent": 4, | 32 | "indent": 4, |
33 | 33 | ||
34 | // Prohibit use of a variable before it is defined. | 34 | // Prohibit use of a variable before it is defined. |
35 | "latedef": false, | 35 | "latedef": false, |
36 | 36 | ||
37 | // Enforce line length to 100 characters | 37 | // Enforce line length to 100 characters |
38 | "maxlen": 100, | 38 | "maxlen": 100, |
39 | 39 | ||
40 | // Require capitalized names for constructor functions. | 40 | // Require capitalized names for constructor functions. |
41 | "newcap": true, | 41 | "newcap": true, |
42 | 42 | ||
43 | // Enforce use of single quotation marks for strings. | 43 | // Enforce use of single quotation marks for strings. |
44 | "quotmark": "single", | 44 | "quotmark": "single", |
45 | 45 | ||
46 | // Enforce placing 'use strict' at the top function scope | 46 | // Enforce placing 'use strict' at the top function scope |
47 | "strict": false, | 47 | "strict": false, |
48 | 48 | ||
49 | // Prohibit use of explicitly undeclared variables. | 49 | // Prohibit use of explicitly undeclared variables. |
50 | "undef": true, | 50 | "undef": true, |
51 | 51 | ||
52 | // Warn when variables are defined but never used. | 52 | // Warn when variables are defined but never used. |
53 | "unused": true, | 53 | "unused": true, |
54 | 54 | ||
55 | // Para que funcione en angular | 55 | // Para que funcione en angular |
56 | "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"], | 56 | "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"], |
57 | /* | 57 | /* |
58 | * RELAXING OPTIONS | 58 | * RELAXING OPTIONS |
59 | * ================= | 59 | * ================= |
60 | */ | 60 | */ |
61 | 61 | ||
62 | // Suppress warnings about == null comparisons. | 62 | // Suppress warnings about == null comparisons. |
63 | "eqnull": true | 63 | "eqnull": true |
64 | } | 64 | } |
65 | 65 |
gulpfile.js
1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
2 | const clean = require('gulp-clean'); | 2 | const clean = require('gulp-clean'); |
3 | const concat = require('gulp-concat'); | 3 | const concat = require('gulp-concat'); |
4 | const htmlmin = require('gulp-htmlmin'); | 4 | const htmlmin = require('gulp-htmlmin'); |
5 | const rename = require('gulp-rename'); | 5 | const rename = require('gulp-rename'); |
6 | const uglify = require('gulp-uglify'); | 6 | const uglify = require('gulp-uglify'); |
7 | const gulp = require('gulp'); | 7 | const gulp = require('gulp'); |
8 | const pump = require('pump'); | 8 | const pump = require('pump'); |
9 | const jshint = require('gulp-jshint'); | 9 | const jshint = require('gulp-jshint'); |
10 | const replace = require('gulp-replace'); | 10 | const replace = require('gulp-replace'); |
11 | const connect = require('gulp-connect'); | 11 | const connect = require('gulp-connect'); |
12 | 12 | ||
13 | var paths = { | 13 | var paths = { |
14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
16 | tmp: 'tmp', | 16 | tmp: 'tmp', |
17 | dist: 'dist/' | 17 | dist: 'dist/' |
18 | }; | 18 | }; |
19 | 19 | ||
20 | gulp.task('templates', ['clean'], function() { | 20 | gulp.task('templates', ['clean'], function() { |
21 | return pump( | 21 | return pump( |
22 | [ | 22 | [ |
23 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
24 | htmlmin(), | 24 | htmlmin(), |
25 | templateCache('views.js', { | 25 | templateCache('views.js', { |
26 | module: 'focaCrearCobranza', | 26 | module: 'focaCrearCobranza', |
27 | root: '' | 27 | root: '' |
28 | }), | 28 | }), |
29 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
30 | ] | 30 | ] |
31 | ); | 31 | ); |
32 | }); | 32 | }); |
33 | 33 | ||
34 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
35 | return pump( | 35 | return pump( |
36 | [ | 36 | [ |
37 | gulp.src([ | 37 | gulp.src([ |
38 | paths.srcJS, | 38 | paths.srcJS, |
39 | 'tmp/views.js' | 39 | 'tmp/views.js' |
40 | ]), | 40 | ]), |
41 | concat('foca-crear-cobranza.js'), | 41 | concat('foca-crear-cobranza.js'), |
42 | replace('src/views/', ''), | 42 | replace('src/views/', ''), |
43 | gulp.dest(paths.tmp), | 43 | gulp.dest(paths.tmp), |
44 | rename('foca-crear-cobranza.min.js'), | 44 | rename('foca-crear-cobranza.min.js'), |
45 | uglify(), | 45 | uglify(), |
46 | replace('"ngRoute","ui.bootstrap","focaModal","focaModalFactura","focaBusquedaCliente",'+ | 46 | replace('"ngRoute","ui.bootstrap","focaModal","focaModalFactura","focaBusquedaCliente",'+ |
47 | '"focaDirectivas","focaModalMoneda","focaModalCotizacion"', ''), | 47 | '"focaDirectivas","focaModalMoneda","focaModalCotizacion"', ''), |
48 | gulp.dest(paths.dist) | 48 | gulp.dest(paths.dist) |
49 | |||
49 | ] | 50 | ] |
50 | ); | 51 | ); |
51 | }); | 52 | }); |
52 | 53 | ||
53 | gulp.task('clean', function() { | 54 | gulp.task('clean', function() { |
54 | return gulp.src(['tmp', 'dist'], {read: false}) | 55 | return gulp.src(['tmp', 'dist'], {read: false}) |
55 | .pipe(clean()); | 56 | .pipe(clean()); |
56 | }); | 57 | }); |
57 | 58 | ||
58 | gulp.task('pre-commit', function() { | 59 | gulp.task('pre-commit', function() { |
59 | return pump( | 60 | return pump( |
60 | [ | 61 | [ |
61 | gulp.src(paths.srcJS), | 62 | gulp.src(paths.srcJS), |
62 | jshint('.jshintrc'), | 63 | jshint('.jshintrc'), |
63 | jshint.reporter('default'), | 64 | jshint.reporter('default'), |
64 | jshint.reporter('fail') | 65 | jshint.reporter('fail') |
65 | ] | 66 | ] |
66 | ); | 67 | ); |
67 | 68 | ||
68 | gulp.start('uglify'); | 69 | gulp.start('uglify'); |
69 | }); | 70 | }); |
70 | 71 | ||
71 | gulp.task('webserver', function() { | 72 | gulp.task('webserver', function() { |
72 | pump [ | 73 | pump [ |
73 | connect.server({port: 3300, host: '0.0.0.0'}) | 74 | connect.server({port: 3300, host: '0.0.0.0'}) |
74 | ] | 75 | ] |
75 | }); | 76 | }); |
76 | 77 | ||
77 | gulp.task('clean-post-install', function() { | 78 | gulp.task('clean-post-install', function() { |
78 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 79 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', |
79 | 'index.html'], {read: false}) | 80 | 'index.html'], {read: false}) |
80 | .pipe(clean()); | 81 | .pipe(clean()); |
81 | }); | 82 | }); |
82 | 83 | ||
83 | gulp.task('default', ['webserver']); | 84 | gulp.task('default', ['webserver']); |
84 | 85 | ||
85 | gulp.task('watch', function() { | 86 | gulp.task('watch', function() { |
86 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | 87 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); |
87 | }); | 88 | }); |
88 | 89 |
src/js/controller.js
1 | angular.module('focaCrearCobranza') .controller('cobranzaController', | 1 | angular.module('focaCrearCobranza') .controller('cobranzaController', |
2 | [ | 2 | [ |
3 | '$scope', | 3 | '$scope', |
4 | '$uibModal', | 4 | '$uibModal', |
5 | '$location', | 5 | '$location', |
6 | '$filter', | 6 | '$filter', |
7 | 'focaCrearCobranzaService', | 7 | 'focaCrearCobranzaService', |
8 | 'focaModalService', | 8 | 'focaModalService', |
9 | function($scope, $uibModal, $location, $filter, focaCrearCobranzaService, focaModalService) | 9 | '$cookies', |
10 | 'focaSeguimientoService', | ||
11 | function($scope, $uibModal, $location, $filter, focaCrearCobranzaService, focaModalService, | ||
12 | $cookies, focaSeguimientoService) | ||
10 | { | 13 | { |
11 | $scope.botonera = [ | 14 | $scope.botonera = [ |
12 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, | 15 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, |
13 | {texto: 'Cobrador', accion: function() {$scope.seleccionarCobrador();}}, | 16 | {texto: 'Cobrador', accion: function() {$scope.seleccionarCobrador();}}, |
14 | {texto: 'Comprobantes', accion: function() {$scope.swichDeuda();}}, | 17 | {texto: 'Comprobantes', accion: function() {$scope.swichDeuda();}}, |
15 | {texto: 'Cobros', accion: function() {$scope.swichCobro();}}, | 18 | {texto: 'Cobros', accion: function() {$scope.swichCobro();}}, |
16 | {texto: 'Moneda', accion: function() {$scope.seleccionarMoneda();}}, | 19 | {texto: 'Moneda', accion: function() {$scope.seleccionarMoneda();}}, |
17 | {texto: '', accion: function() {}}, | 20 | {texto: '', accion: function() {}}, |
18 | {texto: '', accion: function() {}}, | 21 | {texto: '', accion: function() {}}, |
19 | {texto: '', accion: function() {}} | 22 | {texto: '', accion: function() {}} |
20 | ]; | 23 | ]; |
21 | $scope.datepickerAbierto = false; | 24 | $scope.datepickerAbierto = false; |
22 | $scope.cobroDeuda = true; | 25 | $scope.cobroDeuda = true; |
23 | $scope.show = false; | 26 | $scope.show = false; |
24 | $scope.cargando = true; | 27 | $scope.cargando = true; |
25 | $scope.dateOptions = { | 28 | $scope.dateOptions = { |
26 | maxDate: new Date(), | 29 | maxDate: new Date(), |
27 | minDate: new Date(2010, 0, 1) | 30 | minDate: new Date(2010, 0, 1) |
28 | }; | 31 | }; |
29 | 32 | ||
30 | $scope.cobranza = { | ||
31 | fecha: new Date() | ||
32 | }; | ||
33 | |||
34 | $scope.cabecera = []; | 33 | $scope.cabecera = []; |
35 | $scope.showCabecera = true; | 34 | $scope.showCabecera = true; |
36 | 35 | ||
37 | $scope.now = new Date(); | 36 | $scope.cobranza = {}; |
37 | |||
38 | $scope.fecha = new Date(); | ||
38 | $scope.puntoVenta = '0000'; | 39 | $scope.puntoVenta = '0000'; |
39 | $scope.comprobante = '00000000'; | 40 | $scope.comprobante = '00000000'; |
40 | $scope.facturaTabla = []; | 41 | $scope.facturaTabla = []; |
41 | $scope.cobrosTabla = []; | 42 | $scope.cobrosTabla = []; |
42 | 43 | ||
43 | var monedaPorDefecto; | 44 | focaCrearCobranzaService.getUsuario($cookies.get('idUsuario')).then(function(data) { |
44 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' | 45 | $scope.usuario = data.data; |
45 | focaCrearCobranzaService.getCotizacionByIdMoneda(1).then(function(res) { | ||
46 | monedaPorDefecto = res.data[0]; | ||
47 | addCabecera('Moneda:', monedaPorDefecto.DETALLE); | ||
48 | addCabecera('Fecha cotizacion:', | ||
49 | new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); | ||
50 | addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].VENDEDOR); | ||
51 | $scope.cobranza.moneda = monedaPorDefecto; | ||
52 | $scope.cobranza.cotizacion = monedaPorDefecto.cotizaciones[0]; | ||
53 | }); | 46 | }); |
54 | 47 | ||
55 | focaCrearCobranzaService.getNumeroRecibo().then( | ||
56 | function(res) { | ||
57 | $scope.puntoVenta = $scope.rellenar(res.data.sucursal, 4); | ||
58 | $scope.comprobante = $scope.rellenar(res.data.numeroRecibo, 8); | ||
59 | }, | ||
60 | function(err) { | ||
61 | focaModalService.alert('La terminal no esta configurada correctamente'); | ||
62 | console.info(err); | ||
63 | } | ||
64 | ); | ||
65 | $scope.crearCobranza = function() { | 48 | $scope.crearCobranza = function() { |
66 | if(!$scope.cobranza.cliente) { | 49 | if(!$scope.cobranza.cliente) { |
67 | focaModalService.alert('Ingrese Cliente'); | 50 | focaModalService.alert('Ingrese Cliente'); |
68 | return; | 51 | return; |
69 | } | 52 | } |
53 | if(!$scope.cobranza.cobrador) { | ||
54 | focaModalService.alert('Ingrese Cobrador'); | ||
55 | return; | ||
56 | } | ||
70 | if($scope.facturaTabla.length < 1) { | 57 | if($scope.facturaTabla.length < 1) { |
71 | focaModalService.alert('Ingrese al menos una factura'); | 58 | focaModalService.alert('Ingrese al menos una factura'); |
72 | return; | 59 | return; |
73 | } | 60 | } |
74 | if($scope.getTotalCobrado() - $scope.getTotalDeuda() !== 0) { | 61 | if($scope.getTotalCobrado() - $scope.getTotalDeuda() !== 0) { |
75 | focaModalService.alert('La diferencia debe ser ' + | 62 | focaModalService.alert('La diferencia debe ser ' + |
76 | $scope.cobranza.moneda.SIMBOLO + '0,00'); | 63 | $scope.cobranza.moneda.SIMBOLO + '0,00'); |
77 | return; | 64 | return; |
78 | } | 65 | } |
79 | //TODO: Guarda cobranza | 66 | var cobranza = {}; |
80 | // var date = new Date(); | 67 | var cheques = []; |
81 | // var cobranza = { | 68 | var cuerpos = []; |
82 | // }; | 69 | |
70 | for (var i = 0; i < $scope.facturaTabla.length; i++) { | ||
71 | var cuerpoFactura = { | ||
72 | CYV: 'V', | ||
73 | TIP: 'C', | ||
74 | TCO: 'RC', | ||
75 | PVE: $scope.puntoVenta, | ||
76 | NCO: $scope.comprobante, | ||
77 | LOP: 'L', | ||
78 | TIL: $scope.facturaTabla[i].TCO, | ||
79 | COM: $scope.facturaTabla[i].numeroFactura, | ||
80 | FEC: $scope.fecha.toISOString().slice(0, 19).replace('T', ' '), | ||
81 | IMP: $scope.facturaTabla[i].IPA, | ||
82 | RES: 0,//caja de tesorería | ||
83 | SUBM: 0 | ||
84 | }; | ||
85 | cuerpos.push(cuerpoFactura); | ||
86 | } | ||
87 | |||
88 | for (var j = 0; j < $scope.cobrosTabla.length; j++) { | ||
89 | |||
90 | var efectivo = $scope.cobrosTabla[j].tipo === 'Efectivo' ? true : false; | ||
91 | |||
92 | var cuerpoCobros = { | ||
93 | CYV: 'V', | ||
94 | TIP: 'C', | ||
95 | TCO: 'RC', | ||
96 | PVE: $scope.puntoVenta, | ||
97 | NCO: $scope.comprobante, | ||
98 | LOP: 'P', | ||
99 | TIL: 'EF', | ||
100 | COM: efectivo ? 'ef(COBRO EN EFECTIVO)' : 'ch(' + | ||
101 | $scope.cobrosTabla[j].numero + ')' + $scope.cobrosTabla[j].banco.desbco, | ||
102 | FEC: efectivo ? | ||
103 | $scope.cobrosTabla[j].fecha | ||
104 | .toISOString().slice(0, 19).replace('T', ' ') : | ||
105 | $scope.cobrosTabla[j].fechaPresentacion | ||
106 | .toISOString().slice(0, 19).replace('T', ' '), | ||
107 | IMP: $scope.cobrosTabla[j].importe, | ||
108 | RES: 0,//caja de tesorería | ||
109 | SUBM: 0 | ||
110 | }; | ||
111 | cuerpos.push(cuerpoCobros); | ||
112 | |||
113 | if(!efectivo) { | ||
114 | var cheque = { | ||
115 | BCO: $scope.cobrosTabla[j].banco.ID, | ||
116 | NUM: $scope.comprobante, | ||
117 | FEP: $scope.cobrosTabla[j].fechaPresentacion | ||
118 | .toISOString().slice(0, 19).replace('T', ' '), | ||
119 | FEE: $scope.cobrosTabla[j].fechaEmision | ||
120 | .toISOString().slice(0, 19).replace('T', ' '), | ||
121 | LUG: $scope.cobrosTabla[j].localidad.NOMBRE, | ||
122 | IMP: $scope.cobrosTabla[j].importe, | ||
123 | LIB: $scope.cobrosTabla[j].librador, | ||
124 | EST: 'C',//'D' depositado, 'E' entregado, 'C' en cartera | ||
125 | PCI: $scope.cobrosTabla[j].provincia.ID, | ||
126 | LPLA: 0, | ||
127 | PLA: 0, | ||
128 | VEN: $scope.usuario.CodVen,//Id vendedor | ||
129 | CCLIE: $scope.cobranza.cliente.COD,//Id cliente | ||
130 | REN: 0, | ||
131 | PVEC: $scope.puntoVenta, | ||
132 | NCOC: $scope.comprobante, | ||
133 | OBSE: $scope.cobrosTabla[j].observaciones, | ||
134 | LUV: 0, | ||
135 | ORI: 've', | ||
136 | FER: '', | ||
137 | BIMP: 0, | ||
138 | COMP: 'C ' +'RC ' + $scope.puntoVenta + '-' + $scope.comprobante, | ||
139 | VAL_E: '',//Cuando egresa por ingresos y egresos en el numero de egreso | ||
140 | VAL_I: '',//Cuando Ingresa por ingresos y egresos en el numero ingreso | ||
141 | REC_CAJ: 'D', | ||
142 | TIPO_C: 0,//?? | ||
143 | SALDO_CAJ: 'S', | ||
144 | FECHA_INGRESO: $scope.fecha | ||
145 | .toISOString().slice(0, 19).replace('T', ' '), | ||
146 | Vendedor_valor: 0, | ||
147 | FAMILIA: 0, | ||
148 | CUIT_LIB: '', | ||
149 | COD_LUG: $scope.cobrosTabla[j].localidad.ID,//código lugar | ||
150 | SEN: '', | ||
151 | NRC: 0, | ||
152 | COD_LARGO: '', | ||
153 | VN: 0, | ||
154 | ID_LECTOR: 0, | ||
155 | NATHB: '' | ||
156 | }; | ||
157 | cheques.push(cheque); | ||
158 | } | ||
159 | } | ||
160 | |||
161 | cobranza = { | ||
162 | recibo: { | ||
163 | CYV: 'V', | ||
164 | TIP: 'C', | ||
165 | TCO: 'RC', | ||
166 | PVE: $scope.puntoVenta, //Sucursar, punto de venta | ||
167 | NCO: $scope.comprobante, //Numero de comprobante | ||
168 | FEC: $scope.fecha.toISOString().slice(0, 19).replace('T', ' '), | ||
169 | CLI: $scope.cobranza.cliente.COD, | ||
170 | ATO: 0, //número de asiento | ||
171 | CFE: $scope.usuario.NomVen.trim(), | ||
172 | PLA: '',//Numero de planilla, sin uso | ||
173 | ID_MONEDA: $scope.cobranza.moneda.ID, | ||
174 | COTIZACION: $scope.cobranza.cotizacion.VENDEDOR | ||
175 | }, | ||
176 | cuerpo: cuerpos, | ||
177 | cheques: cheques, | ||
178 | acobypag: { | ||
179 | CYV: 'V', | ||
180 | COD: $scope.cobranza.cliente.COD, | ||
181 | FEP: $scope.fecha.toISOString().slice(0, 19).replace('T', ' '), | ||
182 | TIP: '',//?? | ||
183 | TCO: 'RC', | ||
184 | SUC: $scope.puntoVenta, | ||
185 | NCO: $scope.comprobante, | ||
186 | IPA: $scope.getTotalCobrado(), | ||
187 | SAL: '',//?? | ||
188 | TCA: 1, | ||
189 | ZONA: 1, | ||
190 | FPA: 2,//Forma de pago | ||
191 | REC: 0, | ||
192 | REP: 0, | ||
193 | FER: null, | ||
194 | REM: 0, | ||
195 | FRE: null,//?? | ||
196 | PRO: 'N', | ||
197 | FEV: $scope.fecha.toISOString().slice(0, 19).replace('T', ' ') | ||
198 | }, | ||
199 | datosCobrador: { | ||
200 | COD: $scope.cobranza.cobrador.id, | ||
201 | PVE: $scope.puntoVenta, | ||
202 | NUM: $scope.comprobante, | ||
203 | EST: 'C', | ||
204 | OBS: 'RC: ' + $scope.comprobante + '-' + $scope.fecha.toLocaleDateString(), | ||
205 | DAT1: 'C', | ||
206 | CLI: $scope.cobranza.cliente.COD | ||
207 | } | ||
208 | }; | ||
209 | focaCrearCobranzaService.guardarCobranza(cobranza).then(function() { | ||
210 | focaModalService.alert('Cobranza guardada con éxito'); | ||
211 | |||
212 | focaSeguimientoService.guardarPosicion( | ||
213 | $scope.sucursal+$scope.comprobante, | ||
214 | 'Cobranza', | ||
215 | 'Nº: ' + $filter('comprobante')([ | ||
216 | $scope.puntoVenta, | ||
217 | $scope.comprobante | ||
218 | ]) + '<br/>' + | ||
219 | 'Vendedor: ' + $scope.usuario.NomVen + '<br/>' + | ||
220 | 'Total: ' + $filter('currency')($scope.getTotalCobrado()) | ||
221 | ); | ||
222 | |||
223 | $scope.cobranza = { | ||
224 | fecha: new Date() | ||
225 | }; | ||
226 | setearMonedaPorDefecto(); | ||
227 | obtenerNumeroComprobante(); | ||
228 | |||
229 | $scope.cabecera = []; | ||
230 | $scope.fecha = new Date(); | ||
231 | $scope.facturaTabla = []; | ||
232 | $scope.cobrosTabla = []; | ||
233 | }); | ||
83 | }; | 234 | }; |
84 | 235 | ||
85 | $scope.swichCobro = function() { | 236 | $scope.swichCobro = function() { |
86 | $scope.cobroDeuda = false; | 237 | $scope.cobroDeuda = false; |
87 | }; | 238 | }; |
88 | 239 | ||
89 | $scope.swichDeuda = function() { | 240 | $scope.swichDeuda = function() { |
90 | $scope.cobroDeuda = true; | 241 | $scope.cobroDeuda = true; |
91 | }; | 242 | }; |
92 | 243 | ||
93 | $scope.seleccionarCliente = function() { | 244 | $scope.seleccionarCliente = function() { |
94 | 245 | ||
95 | var modalInstance = $uibModal.open( | 246 | var modalInstance = $uibModal.open( |
96 | { | 247 | { |
97 | ariaLabelledBy: 'Busqueda de Cliente', | 248 | ariaLabelledBy: 'Busqueda de Cliente', |
98 | templateUrl: 'foca-busqueda-cliente-modal.html', | 249 | templateUrl: 'foca-busqueda-cliente-modal.html', |
99 | controller: 'focaBusquedaClienteModalController', | 250 | controller: 'focaBusquedaClienteModalController', |
100 | size: 'lg' | 251 | size: 'lg' |
101 | } | 252 | } |
102 | ); | 253 | ); |
103 | modalInstance.result.then( | 254 | modalInstance.result.then( |
104 | function(cliente) { | 255 | function(cliente) { |
105 | addCabecera('Cliente:', cliente.nom); | 256 | addCabecera('Cliente:', cliente.nom); |
106 | $scope.cobranza.cliente = { | 257 | $scope.cobranza.cliente = { |
107 | COD: cliente.cod, | 258 | COD: cliente.cod, |
108 | CUIT: cliente.cuit, | 259 | CUIT: cliente.cuit, |
109 | NOM: cliente.nom | 260 | NOM: cliente.nom |
110 | }; | 261 | }; |
111 | }, function() { | 262 | }, function() { |
112 | 263 | ||
113 | } | 264 | } |
114 | ); | 265 | ); |
115 | }; | 266 | }; |
116 | 267 | ||
117 | $scope.seleccionarFactura = function() { | 268 | $scope.seleccionarFactura = function() { |
118 | if(!$scope.cobranza.cliente) { | 269 | if(!$scope.cobranza.cliente) { |
119 | focaModalService.alert('Seleccione primero un cliente'); | 270 | focaModalService.alert('Seleccione primero un cliente'); |
120 | return; | 271 | return; |
121 | } | 272 | } |
122 | var modalInstance = $uibModal.open( | 273 | var modalInstance = $uibModal.open( |
123 | { | 274 | { |
124 | ariaLabelledBy: 'Busqueda de Facturas', | 275 | ariaLabelledBy: 'Busqueda de Facturas', |
125 | templateUrl: 'foca-modal-factura.html', | 276 | templateUrl: 'foca-modal-factura.html', |
126 | controller: 'focaModalFacturaController', | 277 | controller: 'focaModalFacturaController', |
127 | size: 'lg', | 278 | size: 'lg', |
128 | resolve: { | 279 | resolve: { |
129 | parametrosFactura: { | 280 | parametrosFactura: { |
130 | cliente: $scope.cobranza.cliente.COD, | 281 | cliente: $scope.cobranza.cliente.COD, |
131 | simbolo: $scope.cobranza.moneda.SIMBOLO, | 282 | simbolo: $scope.cobranza.moneda.SIMBOLO, |
132 | cotizacion: $scope.cobranza.cotizacion.VENDEDOR | 283 | cotizacion: $scope.cobranza.cotizacion.VENDEDOR |
133 | } | 284 | } |
134 | } | 285 | } |
135 | } | 286 | } |
136 | ); | 287 | ); |
137 | modalInstance.result.then( | 288 | modalInstance.result.then( |
138 | function(facturas) { | 289 | function(facturas) { |
139 | $scope.facturaTabla = $scope.facturaTabla.concat(facturas); | 290 | $scope.facturaTabla = $scope.facturaTabla.concat(facturas); |
140 | }, function() { | 291 | }, function() { |
141 | 292 | ||
142 | } | 293 | } |
143 | ); | 294 | ); |
144 | }; | 295 | }; |
145 | 296 | ||
146 | $scope.seleccionarCheque = function() { | 297 | $scope.seleccionarCheque = function() { |
147 | var modalInstance = $uibModal.open( | 298 | var modalInstance = $uibModal.open( |
148 | { | 299 | { |
149 | ariaLabelledBy: 'Carga de cheques', | 300 | ariaLabelledBy: 'Carga de cheques', |
150 | templateUrl: 'modal-cheque.html', | 301 | templateUrl: 'modal-cheque.html', |
151 | controller: 'focaModalChequeController', | 302 | controller: 'focaModalChequeController', |
152 | size: 'lg' | 303 | size: 'lg' |
153 | } | 304 | } |
154 | ); | 305 | ); |
155 | modalInstance.result.then( | 306 | modalInstance.result.then( |
156 | function(cheque) { | 307 | function(cheque) { |
157 | var cobro = { | 308 | var cobro = { |
158 | tipo: 'Ch' + '(' + cheque.numero + ')' + ' ' + cheque.banco, | 309 | tipo: 'Ch' + '(' + cheque.numero + ')' + ' ' + cheque.banco.desbco, |
159 | fecha: cheque.fechaPresentacion, | 310 | numero: cheque.numero, |
160 | importe: cheque.importe * $scope.cobranza.cotizacion.VENDEDOR | 311 | banco: cheque.banco, |
312 | fecha: cheque.fechaEmision.toLocaleDateString() + '-' + | ||
313 | cheque.fechaPresentacion.toLocaleDateString(), | ||
314 | fechaPresentacion: cheque.fechaPresentacion, | ||
315 | fechaEmision: cheque.fechaEmision, | ||
316 | importe: cheque.importe * $scope.cobranza.cotizacion.VENDEDOR, | ||
317 | localidad: cheque.localidad, | ||
318 | librador: cheque.librador, | ||
319 | provincia: cheque.provincia, | ||
320 | observaciones: cheque.observaciones | ||
161 | }; | 321 | }; |
162 | $scope.cobrosTabla.push(cobro); | 322 | $scope.cobrosTabla.push(cobro); |
163 | }, function() { | 323 | }, function() { |
164 | 324 | ||
165 | } | 325 | } |
166 | ); | 326 | ); |
167 | }; | 327 | }; |
168 | 328 | ||
169 | $scope.seleccionarEfectivo = function() { | 329 | $scope.seleccionarEfectivo = function() { |
170 | var modalInstance = $uibModal.open( | 330 | var modalInstance = $uibModal.open( |
171 | { | 331 | { |
172 | ariaLabelledBy: 'Carga de cheques', | 332 | ariaLabelledBy: 'Carga de cheques', |
173 | templateUrl: 'modal-efectivo.html', | 333 | templateUrl: 'modal-efectivo.html', |
174 | controller: 'focaModalEfectivoController', | 334 | controller: 'focaModalEfectivoController', |
175 | size: 'sm' | 335 | size: 'sm' |
176 | } | 336 | } |
177 | ); | 337 | ); |
178 | modalInstance.result.then( | 338 | modalInstance.result.then( |
179 | function(efectivo) { | 339 | function(efectivo) { |
180 | var cobro = { | 340 | var cobro = { |
181 | tipo: 'Efectivo', | 341 | tipo: 'Efectivo', |
182 | fecha: new Date(), | 342 | fecha: new Date(), |
183 | importe: efectivo * $scope.cobranza.cotizacion.VENDEDOR | 343 | importe: efectivo * $scope.cobranza.cotizacion.VENDEDOR |
184 | }; | 344 | }; |
185 | $scope.cobrosTabla.push(cobro); | 345 | $scope.cobrosTabla.push(cobro); |
186 | }, function() { | 346 | }, function() { |
187 | 347 | ||
188 | } | 348 | } |
189 | ); | 349 | ); |
190 | }; | 350 | }; |
191 | 351 | ||
192 | $scope.seleccionarMoneda = function() { | 352 | $scope.seleccionarMoneda = function() { |
193 | var modalInstance = $uibModal.open( | 353 | var modalInstance = $uibModal.open( |
194 | { | 354 | { |
195 | ariaLabelledBy: 'Busqueda de Moneda', | 355 | ariaLabelledBy: 'Busqueda de Moneda', |
196 | templateUrl: 'modal-moneda.html', | 356 | templateUrl: 'modal-moneda.html', |
197 | controller: 'focaModalMonedaController', | 357 | controller: 'focaModalMonedaController', |
198 | size: 'lg' | 358 | size: 'lg' |
199 | } | 359 | } |
200 | ); | 360 | ); |
201 | modalInstance.result.then( | 361 | modalInstance.result.then( |
202 | function(moneda) { | 362 | function(moneda) { |
203 | $scope.seleccionarCotizacion(moneda); | 363 | $scope.seleccionarCotizacion(moneda); |
204 | }, function() { | 364 | }, function() { |
205 | 365 | ||
206 | } | 366 | } |
207 | ); | 367 | ); |
208 | }; | 368 | }; |
209 | |||
210 | $scope.seleccionarCobrador = function() { | ||
211 | var modalInstance = $uibModal.open( | ||
212 | { | ||
213 | ariaLabelledBy: 'Busqueda de Cobradores', | ||
214 | templateUrl: 'modal-cobradores.html', | ||
215 | controller: 'focaModalCobradoresController', | ||
216 | size: 'lg' | ||
217 | } | ||
218 | ); | ||
219 | modalInstance.result.then( | ||
220 | function(cobrador) { | ||
221 | addCabecera('Cobrador:', cobrador.nombre); | ||
222 | $scope.cobranza.cobrador = cobrador; | ||
223 | }, function() { | ||
224 | |||
225 | } | ||
226 | ); | ||
227 | }; | ||
228 | 369 | ||
229 | $scope.seleccionarCotizacion = function(moneda) { | 370 | $scope.seleccionarCotizacion = function(moneda) { |
230 | var modalInstance = $uibModal.open( | 371 | var modalInstance = $uibModal.open( |
231 | { | 372 | { |
232 | ariaLabelledBy: 'Busqueda de Cotización', | 373 | ariaLabelledBy: 'Busqueda de Cotización', |
233 | templateUrl: 'modal-cotizacion.html', | 374 | templateUrl: 'modal-cotizacion.html', |
234 | controller: 'focaModalCotizacionController', | 375 | controller: 'focaModalCotizacionController', |
235 | size: 'lg', | 376 | size: 'lg', |
236 | resolve: {idMoneda: function() {return moneda.ID;}} | 377 | resolve: {idMoneda: function() {return moneda.ID;}} |
237 | } | 378 | } |
238 | ); | 379 | ); |
239 | modalInstance.result.then( | 380 | modalInstance.result.then( |
240 | function(cotizacion) { | 381 | function(cotizacion) { |
241 | $scope.cobranza.moneda = moneda; | 382 | $scope.cobranza.moneda = moneda; |
242 | $scope.cobranza.cotizacion = cotizacion; | 383 | $scope.cobranza.cotizacion = cotizacion; |
243 | addCabecera('Moneda:', moneda.DETALLE); | 384 | addCabecera('Moneda:', moneda.DETALLE); |
244 | addCabecera( | 385 | addCabecera( |
245 | 'Fecha cotizacion:', | 386 | 'Fecha cotizacion:', |
246 | $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | 387 | $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') |
247 | ); | 388 | ); |
248 | addCabecera('Cotizacion:', cotizacion.VENDEDOR); | 389 | addCabecera('Cotizacion:', cotizacion.VENDEDOR); |
249 | }, function() { | 390 | }, function() { |
250 | 391 | ||
251 | } | 392 | } |
252 | ); | 393 | ); |
253 | }; | 394 | }; |
254 | 395 | ||
255 | $scope.agregarCobro = function(key) { | 396 | $scope.seleccionarCobrador = function() { |
256 | if(key === 13) { | 397 | var modalInstance = $uibModal.open( |
257 | var cobro = { | 398 | { |
258 | cobro: 'Efectivo', | 399 | ariaLabelledBy: 'Busqueda de Cobradores', |
259 | fecha: new Date(), | 400 | templateUrl: 'modal-cobradores.html', |
260 | importe: $scope.cobroEfectivo | 401 | controller: 'focaModalCobradoresController', |
261 | }; | 402 | size: 'lg' |
262 | $scope.cobrosTabla.push(cobro); | 403 | } |
263 | } | 404 | ); |
405 | modalInstance.result.then( | ||
406 | function(cobrador) { | ||
407 | addCabecera('Cobrador:', cobrador.nombre); | ||
408 | $scope.cobranza.cobrador = cobrador; | ||
409 | }, function() { | ||
410 | |||
411 | } | ||
412 | ); | ||
264 | }; | 413 | }; |
265 | 414 | ||
266 | $scope.getTotalDeuda = function() { | 415 | $scope.getTotalDeuda = function() { |
267 | var total = 0; | 416 | var total = 0; |
268 | for (var i = 0; i < $scope.facturaTabla.length; i++) { | 417 | for (var i = 0; i < $scope.facturaTabla.length; i++) { |
269 | total += $scope.facturaTabla[i].IPA; | 418 | total += $scope.facturaTabla[i].IPA; |
270 | } | 419 | } |
271 | return parseFloat(total.toFixed(2)); | 420 | return parseFloat(total.toFixed(2)); |
272 | }; | 421 | }; |
273 | 422 | ||
274 | $scope.getTotalCobrado = function() { | 423 | $scope.getTotalCobrado = function() { |
275 | var total = 0; | 424 | var total = 0; |
276 | for (var i = 0; i < $scope.cobrosTabla.length; i++) { | 425 | for (var i = 0; i < $scope.cobrosTabla.length; i++) { |
277 | total += $scope.cobrosTabla[i].importe; | 426 | total += $scope.cobrosTabla[i].importe; |
278 | } | 427 | } |
279 | return parseFloat(total.toFixed(2)); | 428 | return parseFloat(total.toFixed(2)); |
280 | }; | 429 | }; |
281 | 430 | ||
282 | $scope.getSubTotal = function() { | 431 | $scope.getSubTotal = function() { |
283 | if($scope.articuloACargar) { | 432 | if($scope.articuloACargar) { |
284 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; | 433 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; |
285 | } | 434 | } |
286 | }; | 435 | }; |
287 | //Recibe aviso si el teclado está en uso | 436 | //Recibe aviso si el teclado está en uso |
288 | // $rootScope.$on('usarTeclado', function(event, data) { | 437 | // $rootScope.$on('usarTeclado', function(event, data) { |
289 | // if(data) { | 438 | // if(data) { |
290 | // $scope.mostrarTeclado = true; | 439 | // $scope.mostrarTeclado = true; |
291 | // return; | 440 | // return; |
292 | // } | 441 | // } |
293 | // $scope.mostrarTeclado = false; | 442 | // $scope.mostrarTeclado = false; |
294 | // }) | 443 | // }) |
295 | $scope.selectFocus = function($event) { | 444 | $scope.selectFocus = function($event) { |
296 | //Si el teclado esta en uso no selecciona el valor | 445 | //Si el teclado esta en uso no selecciona el valor |
297 | // if($scope.mostrarTeclado) { | 446 | // if($scope.mostrarTeclado) { |
298 | // return; | 447 | // return; |
299 | // } | 448 | // } |
300 | $event.target.select(); | 449 | $event.target.select(); |
301 | }; | 450 | }; |
302 | 451 | ||
303 | $scope.salir = function() { | 452 | $scope.salir = function() { |
304 | $location.path('/'); | 453 | $location.path('/'); |
305 | }; | 454 | }; |
306 | 455 | ||
307 | $scope.parsearATexto = function(articulo) { | 456 | $scope.parsearATexto = function(articulo) { |
308 | articulo.cantidad = parseFloat(articulo.cantidad); | 457 | articulo.cantidad = parseFloat(articulo.cantidad); |
309 | articulo.precio = parseFloat(articulo.precio); | 458 | articulo.precio = parseFloat(articulo.precio); |
310 | }; | 459 | }; |
311 | 460 | ||
312 | $scope.rellenar = function(relleno, longitud) { | 461 | $scope.rellenar = function(relleno, longitud) { |
313 | relleno = '' + relleno; | 462 | relleno = '' + relleno; |
314 | while (relleno.length < longitud) { | 463 | while (relleno.length < longitud) { |
315 | relleno = '0' + relleno; | 464 | relleno = '0' + relleno; |
316 | } | 465 | } |
317 | 466 | ||
318 | return relleno; | 467 | return relleno; |
319 | }; | 468 | }; |
320 | 469 | ||
321 | $scope.quitarFactura = function(key) { | 470 | $scope.quitarFactura = function(key) { |
322 | $scope.facturaTabla.splice(key, 1); | 471 | $scope.facturaTabla.splice(key, 1); |
323 | }; | 472 | }; |
324 | 473 | ||
325 | $scope.quitarCobro = function(key) { | 474 | $scope.quitarCobro = function(key) { |
326 | $scope.cobrosTabla.splice(key, 1); | 475 | $scope.cobrosTabla.splice(key, 1); |
327 | }; | 476 | }; |
328 | 477 | ||
329 | function addCabecera(label, valor) { | 478 | function addCabecera(label, valor) { |
src/js/service.js
1 | angular.module('focaCrearCobranza') | 1 | angular.module('focaCrearCobranza') |
2 | .service('focaCrearCobranzaService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .service('focaCrearCobranzaService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
3 | return { | 3 | return { |
4 | getNumeroRecibo: function() { | 4 | getNumeroRecibo: function() { |
5 | return $http.get(API_ENDPOINT.URL + '/cobranza/numero-siguiente'); | 5 | return $http.get(API_ENDPOINT.URL + '/recibo/numero-siguiente'); |
6 | }, | 6 | }, |
7 | getCotizacionByIdMoneda: function(id) { | 7 | getCotizacionByIdMoneda: function(id) { |
8 | return $http.get(API_ENDPOINT.URL + '/moneda/' + id); | 8 | return $http.get(API_ENDPOINT.URL + '/moneda/' + id); |
9 | }, | ||
10 | getUsuario: function(idUsuario) { | ||
11 | return $http.get(API_ENDPOINT.URL + '/vendedores/obtener/' + idUsuario); | ||
12 | }, | ||
13 | guardarCobranza: function(cobranza) { | ||
14 | return $http.post(API_ENDPOINT.URL + '/recibo/guardar', cobranza); | ||
9 | } | 15 | } |
10 | }; | 16 | }; |
11 | }]); | 17 | }]); |
12 | 18 |
src/views/cobranza.html
1 | <div class="crear-nota-pedido"> | 1 | <div class="crear-nota-pedido"> |
2 | <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0"> | 2 | <form name="formCrearNota" ng-submit="crearNotaPedido()" class="mb-0"> |
3 | <div class="row"> | 3 | <div class="row"> |
4 | <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> | 4 | <div class="col-md-10 offset-md-1 col-lg-8 offset-lg-2"> |
5 | <div class="row p-1 panel-informativo"> | 5 | <div class="row p-1 panel-informativo"> |
6 | <div class="col-12"> | 6 | <div class="col-12"> |
7 | <div class="row"> | 7 | <div class="row"> |
8 | <div class="col-12 col-sm-4 nota-pedido"> | 8 | <div class="col-12 col-sm-4 nota-pedido"> |
9 | <strong>RECIBO DE COBRANZA</strong> | 9 | <strong>RECIBO DE COBRANZA</strong> |
10 | </div> | 10 | </div> |
11 | <div class="col-5 col-sm-4 numero-pedido" | 11 | <div class="col-5 col-sm-4 numero-pedido" |
12 | >Nº {{puntoVenta}}-{{comprobante}} | 12 | >Nº {{puntoVenta}}-{{comprobante}} |
13 | </div> | 13 | </div> |
14 | <div class="col-7 col-sm-4 text-right"> | 14 | <div class="col-7 col-sm-4 text-right"> |
15 | Fecha: | 15 | Fecha: |
16 | <span | 16 | <span |
17 | ng-show="!datepickerAbierto" | 17 | ng-show="!datepickerAbierto" |
18 | ng-bind="now | date:'dd/MM/yyyy HH:mm'" | 18 | ng-bind="fecha | date:'dd/MM/yyyy HH:mm'" |
19 | ng-click="datepickerAbierto = true" | 19 | ng-click="datepickerAbierto = true" |
20 | > | 20 | > |
21 | </span> | 21 | </span> |
22 | <input | 22 | <input |
23 | ng-show="datepickerAbierto" | 23 | ng-show="datepickerAbierto" |
24 | type="date" | 24 | type="date" |
25 | ng-model="now" | 25 | ng-model="fecha" |
26 | ng-change="datepickerAbierto = false" | 26 | ng-change="datepickerAbierto = false" |
27 | ng-blur="datepickerAbierto = false" | 27 | ng-blur="datepickerAbierto = false" |
28 | class="form-control form-control-sm col-8 float-right" | 28 | class="form-control form-control-sm col-8 float-right" |
29 | foca-focus="datepickerAbierto" | 29 | foca-focus="datepickerAbierto" |
30 | hasta-hoy | 30 | hasta-hoy |
31 | /> | 31 | /> |
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | <div class="row"> | 34 | <div class="row"> |
35 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> | 35 | <div class="col-auto" ng-repeat="cab in cabecera" ng-show="showCabecera"> |
36 | <span class="label" ng-bind="cab.label"></span> | 36 | <span class="label" ng-bind="cab.label"></span> |
37 | <span class="valor" ng-bind="cab.valor"></span> | 37 | <span class="valor" ng-bind="cab.valor"></span> |
38 | </div> | 38 | </div> |
39 | <a | 39 | <a |
40 | class="btn col-12 btn-secondary d-sm-none" | 40 | class="btn col-12 btn-secondary d-sm-none" |
41 | ng-show="cabecera.length > 0" | 41 | ng-show="cabecera.length > 0" |
42 | ng-click="showCabecera = !showCabecera" | 42 | ng-click="showCabecera = !showCabecera" |
43 | > | 43 | > |
44 | <i | 44 | <i |
45 | class="fa fa-chevron-down" | 45 | class="fa fa-chevron-down" |
46 | ng-hide="showCabecera" | 46 | ng-hide="showCabecera" |
47 | aria-hidden="true" | 47 | aria-hidden="true" |
48 | > | 48 | > |
49 | </i> | 49 | </i> |
50 | <i | 50 | <i |
51 | class="fa fa-chevron-up" | 51 | class="fa fa-chevron-up" |
52 | ng-show="showCabecera" | 52 | ng-show="showCabecera" |
53 | aria-hidden="true"> | 53 | aria-hidden="true"> |
54 | </i> | 54 | </i> |
55 | </a> | 55 | </a> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | </div> | 58 | </div> |
59 | <div class="row p-1 botonera-secundaria"> | 59 | <div class="row p-1 botonera-secundaria"> |
60 | <div class="col-12"> | 60 | <div class="col-12"> |
61 | <div class="row"> | 61 | <div class="row"> |
62 | <div class="col-6 col-sm-3 px-0 py-0" ng-repeat="boton in botonera"> | 62 | <div class="col-6 col-sm-3 px-0 py-0" ng-repeat="boton in botonera"> |
63 | <button | 63 | <button |
64 | type="button" | 64 | type="button" |
65 | class="btn btn-default btn-block btn-xs text-left py-2" | 65 | class="btn btn-default btn-block btn-xs text-left py-2" |
66 | ng-click="boton.accion()" | 66 | ng-click="boton.accion()" |
67 | ng-class="{'d-none d-sm-block': boton.texto == ''}" | 67 | ng-class="{'d-none d-sm-block': boton.texto == ''}" |
68 | > | 68 | > |
69 | <i | 69 | <i |
70 | class="fa fa-arrow-circle-right" | 70 | class="fa fa-arrow-circle-right" |
71 | ng-show="boton.texto != ''" | 71 | ng-show="boton.texto != ''" |
72 | ></i> | 72 | ></i> |
73 | | 73 | |
74 | {{boton.texto}} | 74 | {{boton.texto}} |
75 | </button> | 75 | </button> |
76 | </div> | 76 | </div> |
77 | </div> | 77 | </div> |
78 | </div> | 78 | </div> |
79 | </div> | 79 | </div> |
80 | </div> | 80 | </div> |
81 | </div> | 81 | </div> |
82 | </form> | 82 | </form> |
83 | <div class="row"> | 83 | <div class="row"> |
84 | <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2"> | 84 | <div class="col-12 col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
85 | <!-- PC --> | 85 | <!-- PC --> |
86 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="cobroDeuda"> | 86 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="cobroDeuda"> |
87 | <table class="table tabla-articulo table-striped table-sm table-dark"> | 87 | <table class="table tabla-articulo table-striped table-sm table-dark"> |
88 | <thead> | 88 | <thead> |
89 | <tr class="d-flex"> | 89 | <tr class="d-flex"> |
90 | <th class="col-auto">#</th> | 90 | <th class="col-auto">#</th> |
91 | <th class="col">Comprobante</th> | 91 | <th class="col">Comprobante</th> |
92 | <th class="col">Fecha</th> | 92 | <th class="col">Fecha</th> |
93 | <th class="col">Importe</th> | 93 | <th class="col">Importe</th> |
94 | <th class="col-auto"> | 94 | <th class="col-auto"> |
95 | <button | 95 | <button |
96 | class="btn btn-outline-secondary selectable" | 96 | class="btn btn-outline-secondary selectable" |
97 | ng-click="show = !show; masMenos()" | 97 | ng-click="show = !show; masMenos()" |
98 | > | 98 | > |
99 | <i | 99 | <i |
100 | class="fa fa-chevron-down" | 100 | class="fa fa-chevron-down" |
101 | ng-show="show" | 101 | ng-show="show" |
102 | aria-hidden="true" | 102 | aria-hidden="true" |
103 | > | 103 | > |
104 | </i> | 104 | </i> |
105 | <i | 105 | <i |
106 | class="fa fa-chevron-up" | 106 | class="fa fa-chevron-up" |
107 | ng-hide="show" | 107 | ng-hide="show" |
108 | aria-hidden="true"> | 108 | aria-hidden="true"> |
109 | </i> | 109 | </i> |
110 | </button> | 110 | </button> |
111 | </th> | 111 | </th> |
112 | </th> | 112 | </th> |
113 | </tr> | 113 | </tr> |
114 | </thead> | 114 | </thead> |
115 | <tbody class="tabla-articulo-body"> | 115 | <tbody class="tabla-articulo-body"> |
116 | <tr | 116 | <tr |
117 | ng-repeat="(key, factura) in facturaTabla" | 117 | ng-repeat="(key, factura) in facturaTabla" |
118 | class="d-flex" | 118 | class="d-flex" |
119 | ng-show="show || key == facturaTabla.length - 1" | 119 | ng-show="show || key == facturaTabla.length - 1" |
120 | > | 120 | > |
121 | <td ng-bind="key + 1" class="col-auto"></td> | 121 | <td ng-bind="key + 1" class="col-auto"></td> |
122 | <td class="col" | 122 | <td class="col" ng-bind="factura.numeroFactura" |
123 | ng-bind= | ||
124 | "(factura.TCO + '-' + factura.TIP + '-' + | ||
125 | factura.SUC + '-' + factura.NCO)" | ||
126 | ></td> | 123 | ></td> |
127 | <td class="col" ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></td> | 124 | <td class="col" ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></td> |
128 | <td | 125 | <td |
129 | class="col" | 126 | class="col" |
130 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | | 127 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | |
131 | currency: cobranza.moneda.SIMBOLO : 4"></td> | 128 | currency: cobranza.moneda.SIMBOLO : 4"></td> |
132 | <td class="text-center col-auto"> | 129 | <td class="text-center col-auto"> |
133 | <button | 130 | <button |
134 | class="btn btn-outline-secondary" | 131 | class="btn btn-outline-secondary" |
135 | ng-click="quitarFactura(key)" | 132 | ng-click="quitarFactura(key)" |
136 | > | 133 | > |
137 | <i class="fa fa-trash"></i> | 134 | <i class="fa fa-trash"></i> |
138 | </button> | 135 | </button> |
139 | </td> | 136 | </td> |
140 | </tr> | 137 | </tr> |
141 | </tbody> | 138 | </tbody> |
142 | <tfoot> | 139 | <tfoot> |
143 | <tr ng-show="cargando" class="d-flex"> | 140 | <tr ng-show="cargando" class="d-flex"> |
144 | <td class="col-2"> | 141 | <td class="col-2"> |
145 | <a | 142 | <a |
146 | class="form-control form-control-sm btn btn-secondary" | 143 | class="form-control form-control-sm btn btn-secondary" |
147 | ng-click="seleccionarFactura()" | 144 | ng-click="seleccionarFactura()" |
148 | >Pendientes</a> | 145 | >Pendientes</a> |
149 | </td> | 146 | </td> |
150 | </tr> | 147 | </tr> |
151 | <tr class="d-flex"> | 148 | <tr class="d-flex"> |
152 | <td class="col-auto px-1"> | 149 | <td class="col-auto px-1"> |
153 | <strong>Comprobantes:</strong> | 150 | <strong>Comprobantes:</strong> |
154 | <a ng-bind="facturaTabla.length"></a> | 151 | <a ng-bind="facturaTabla.length"></a> |
155 | </td> | 152 | </td> |
156 | <td class="text-right ml-auto table-celda-total no-border-top"> | 153 | <td class="text-right ml-auto table-celda-total no-border-top"> |
157 | <strong>Cancela:</strong> | 154 | <strong>Cancela:</strong> |
158 | </td> | 155 | </td> |
159 | <td class="table-celda-total text-right no-border-top"> | 156 | <td class="table-celda-total text-right no-border-top"> |
160 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | | 157 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | |
161 | currency: cobranza.moneda.SIMBOLO}}</strong> | 158 | currency: cobranza.moneda.SIMBOLO}}</strong> |
162 | </td> | 159 | </td> |
163 | <td class="text-right ml-auto table-celda-total no-border-top"> | 160 | <td class="text-right ml-auto table-celda-total no-border-top"> |
164 | <strong>Total Cobrado:</strong> | 161 | <strong>Total Cobrado:</strong> |
165 | </td> | 162 | </td> |
166 | <td class="table-celda-total text-right no-border-top"> | 163 | <td class="table-celda-total text-right no-border-top"> |
167 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | | 164 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | |
168 | currency: cobranza.moneda.SIMBOLO}}</strong> | 165 | currency: cobranza.moneda.SIMBOLO}}</strong> |
169 | </td> | 166 | </td> |
170 | <td class="text-right ml-auto table-celda-total no-border-top"> | 167 | <td class="text-right ml-auto table-celda-total no-border-top"> |
171 | <strong>DF:</strong> | 168 | <strong>DF:</strong> |
172 | </td> | 169 | </td> |
173 | <td class="table-celda-total text-right no-border-top mr-1"> | 170 | <td class="table-celda-total text-right no-border-top mr-1"> |
174 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / | 171 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / |
175 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} | 172 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} |
176 | </strong> | 173 | </strong> |
177 | </td> | 174 | </td> |
178 | </tr> | 175 | </tr> |
179 | </tfoot> | 176 | </tfoot> |
180 | </table> | 177 | </table> |
181 | </div> | 178 | </div> |
182 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="!cobroDeuda"> | 179 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="!cobroDeuda"> |
183 | <table class="table tabla-articulo table-striped table-sm table-dark"> | 180 | <table class="table tabla-articulo table-striped table-sm table-dark"> |
184 | <thead> | 181 | <thead> |
185 | <tr class="d-flex"> | 182 | <tr class="d-flex"> |
186 | <th class="col-auto">#</th> | 183 | <th class="col-auto">#</th> |
187 | <th class="col">Cobro</th> | 184 | <th class="col">Cobro</th> |
188 | <th class="col">Fecha</th> | 185 | <th class="col">Fecha</th> |
189 | <th class="col">Importe</th> | 186 | <th class="col">Importe</th> |
190 | <th class="col-auto"> | 187 | <th class="col-auto"> |
191 | <button | 188 | <button |
192 | class="btn btn-outline-secondary selectable" | 189 | class="btn btn-outline-secondary selectable" |
193 | ng-click="show = !show; masMenos()" | 190 | ng-click="show = !show; masMenos()" |
194 | > | 191 | > |
195 | <i | 192 | <i |
196 | class="fa fa-chevron-down" | 193 | class="fa fa-chevron-down" |
197 | ng-show="show" | 194 | ng-show="show" |
198 | aria-hidden="true" | 195 | aria-hidden="true" |
199 | > | 196 | > |
200 | </i> | 197 | </i> |
201 | <i | 198 | <i |
202 | class="fa fa-chevron-up" | 199 | class="fa fa-chevron-up" |
203 | ng-hide="show" | 200 | ng-hide="show" |
204 | aria-hidden="true"> | 201 | aria-hidden="true"> |
205 | </i> | 202 | </i> |
206 | </button> | 203 | </button> |
207 | </th> | 204 | </th> |
208 | </th> | 205 | </th> |
209 | </tr> | 206 | </tr> |
210 | </thead> | 207 | </thead> |
211 | <tbody class="tabla-articulo-body"> | 208 | <tbody class="tabla-articulo-body"> |
212 | <tr | 209 | <tr |
213 | ng-repeat="(key, cobro) in cobrosTabla" | 210 | ng-repeat="(key, cobro) in cobrosTabla" |
214 | class="d-flex" | 211 | class="d-flex" |
215 | ng-show="show || key == cobrosTabla.length - 1" | 212 | ng-show="show || key == cobrosTabla.length - 1" |
216 | > | 213 | > |
217 | <td ng-bind="key + 1" class="col-auto"></td> | 214 | <td ng-bind="key + 1" class="col-auto"></td> |
218 | <td class="col" ng-bind="cobro.tipo"></td> | 215 | <td class="col" ng-bind="cobro.tipo"></td> |
219 | <td class="col" ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></td> | 216 | <td class="col" ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></td> |
220 | <td | 217 | <td |
221 | class="col" | 218 | class="col" |
222 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | | 219 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | |
223 | currency: cobranza.moneda.SIMBOLO : 4"></td> | 220 | currency: cobranza.moneda.SIMBOLO : 4"></td> |
224 | <td class="text-center col-auto"> | 221 | <td class="text-center col-auto"> |
225 | <button | 222 | <button |
226 | class="btn btn-outline-secondary" | 223 | class="btn btn-outline-secondary" |
227 | ng-click="quitarCobro(key)" | 224 | ng-click="quitarCobro(key)" |
228 | > | 225 | > |
229 | <i class="fa fa-trash"></i> | 226 | <i class="fa fa-trash"></i> |
230 | </button> | 227 | </button> |
231 | </td> | 228 | </td> |
232 | </tr> | 229 | </tr> |
233 | </tbody> | 230 | </tbody> |
234 | <tfoot> | 231 | <tfoot> |
235 | <tr ng-show="cargando" class="d-flex"> | 232 | <tr ng-show="cargando" class="d-flex"> |
236 | <td class="col-2"> | 233 | <td class="col-2"> |
237 | <a | 234 | <a |
238 | class="form-control form-control-sm btn btn-secondary" | 235 | class="form-control form-control-sm btn btn-secondary" |
239 | ng-click="seleccionarCheque()" | 236 | ng-click="seleccionarCheque()" |
240 | >Cheque</a> | 237 | >Cheque</a> |
241 | </td> | 238 | </td> |
242 | <td class="col-2"> | 239 | <td class="col-2"> |
243 | <a | 240 | <a |
244 | class="form-control form-control-sm btn btn-secondary" | 241 | class="form-control form-control-sm btn btn-secondary" |
245 | ng-click="seleccionarEfectivo()" | 242 | ng-click="seleccionarEfectivo()" |
246 | >Efectivo</a> | 243 | >Efectivo</a> |
247 | </td> | 244 | </td> |
248 | </tr> | 245 | </tr> |
249 | <tr class="d-flex"> | 246 | <tr class="d-flex"> |
250 | <td class="col-auto px-1"> | 247 | <td class="col-auto px-1"> |
251 | <strong>Cobros:</strong> | 248 | <strong>Cobros:</strong> |
252 | <a ng-bind="cobrosTabla.length"></a> | 249 | <a ng-bind="cobrosTabla.length"></a> |
253 | </td> | 250 | </td> |
254 | <td class="text-right ml-auto table-celda-total no-border-top"> | 251 | <td class="text-right ml-auto table-celda-total no-border-top"> |
255 | <strong>Cancela:</strong> | 252 | <strong>Cancela:</strong> |
256 | </td> | 253 | </td> |
257 | <td class="table-celda-total text-right no-border-top"> | 254 | <td class="table-celda-total text-right no-border-top"> |
258 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | | 255 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | |
259 | currency: cobranza.moneda.SIMBOLO}}</strong> | 256 | currency: cobranza.moneda.SIMBOLO}}</strong> |
260 | </td> | 257 | </td> |
261 | <td class="text-right ml-auto table-celda-total no-border-top"> | 258 | <td class="text-right ml-auto table-celda-total no-border-top"> |
262 | <strong>Total Cobrado:</strong> | 259 | <strong>Total Cobrado:</strong> |
263 | </td> | 260 | </td> |
264 | <td class="table-celda-total text-right no-border-top"> | 261 | <td class="table-celda-total text-right no-border-top"> |
265 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | | 262 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | |
266 | currency: cobranza.moneda.SIMBOLO}}</strong> | 263 | currency: cobranza.moneda.SIMBOLO}}</strong> |
267 | </td> | 264 | </td> |
268 | <td class="text-right ml-auto table-celda-total no-border-top"> | 265 | <td class="text-right ml-auto table-celda-total no-border-top"> |
269 | <strong>DF:</strong> | 266 | <strong>DF:</strong> |
270 | </td> | 267 | </td> |
271 | <td class="table-celda-total text-right no-border-top mr-1"> | 268 | <td class="table-celda-total text-right no-border-top mr-1"> |
272 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / | 269 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / |
273 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} | 270 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} |
274 | </strong> | 271 | </strong> |
275 | </td> | 272 | </td> |
276 | </tr> | 273 | </tr> |
277 | </tfoot> | 274 | </tfoot> |
278 | </table> | 275 | </table> |
279 | </div> | 276 | </div> |
280 | <!-- MOBILE --> | 277 | <!-- MOBILE --> |
281 | <div class="row d-sm-none"> | 278 | <div class="row d-sm-none"> |
282 | <!-- FACTURAS --> | 279 | <!-- FACTURAS --> |
283 | <table class="table table-sm table-striped table-dark" ng-show="cobroDeuda"> | 280 | <table class="table table-sm table-striped table-dark" ng-show="cobroDeuda"> |
284 | <thead> | 281 | <thead> |
285 | <tr class="d-flex"> | 282 | <tr class="d-flex"> |
286 | <th class="">#</th> | 283 | <th class="">#</th> |
287 | <th class="col px-0"> | 284 | <th class="col px-0"> |
288 | <div class="d-flex"> | 285 | <div class="d-flex"> |
289 | <div class="col-4 px-1">Factura</div> | 286 | <div class="col-4 px-1">Factura</div> |
290 | <div class="col-4 px-1">Fecha</div> | 287 | <div class="col-4 px-1">Fecha</div> |
291 | <div class="col-4 px-1">Importe</div> | 288 | <div class="col-4 px-1">Importe</div> |
292 | </div> | 289 | </div> |
293 | </th> | 290 | </th> |
294 | <th class="text-center tamaño-boton"> | 291 | <th class="text-center tamaño-boton"> |
295 | | 292 | |
296 | </th> | 293 | </th> |
297 | </tr> | 294 | </tr> |
298 | </thead> | 295 | </thead> |
299 | <tbody> | 296 | <tbody> |
300 | <tr | 297 | <tr |
301 | ng-repeat="(key, factura) in facturaTabla" | 298 | ng-repeat="(key, factura) in facturaTabla" |
302 | ng-show="show || key == facturaTabla.length - 1" | 299 | ng-show="show || key == facturaTabla.length - 1" |
303 | > | 300 | > |
304 | <td class="w-100 align-middle d-flex p-0"> | 301 | <td class="w-100 align-middle d-flex p-0"> |
305 | <div class="align-middle p-1"> | 302 | <div class="align-middle p-1"> |
306 | <span ng-bind="key+1" class="align-middle"></span> | 303 | <span ng-bind="key+1" class="align-middle"></span> |
307 | </div> | 304 | </div> |
308 | <div class="col px-0"> | 305 | <div class="col px-0"> |
309 | <div class="d-flex"> | 306 | <div class="d-flex"> |
310 | <div class="col-4 px-1"> | 307 | <div class="col-4 px-1"> |
311 | <span ng-bind= | 308 | <span ng-bind="factura.numeroFactura" |
312 | "(factura.TCO + '-' + factura.TIP + '-' + | ||
313 | factura.SUC + '-' + factura.NCO)" | ||
314 | ></span> | 309 | ></span> |
315 | </div> | 310 | </div> |
316 | <div class="col-4 px-1"> | 311 | <div class="col-4 px-1"> |
317 | <span ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></span> | 312 | <span ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></span> |
318 | </div> | 313 | </div> |
319 | <div class="col-4 px-1"> | 314 | <div class="col-4 px-1"> |
320 | <span | 315 | <span |
321 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | | 316 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | |
322 | currency:cobranza.moneda.SIMBOLO : 4"></span> | 317 | currency:cobranza.moneda.SIMBOLO : 4"></span> |
323 | </div> | 318 | </div> |
324 | </div> | 319 | </div> |
325 | </div> | 320 | </div> |
326 | <div class="align-middle p-1"> | 321 | <div class="align-middle p-1"> |
327 | <button | 322 | <button |
328 | class="btn btn-outline-secondary" | 323 | class="btn btn-outline-secondary" |
329 | ng-click="quitarFactura(key)" | 324 | ng-click="quitarFactura(key)" |
330 | > | 325 | > |
331 | <i class="fa fa-trash"></i> | 326 | <i class="fa fa-trash"></i> |
332 | </button> | 327 | </button> |
333 | </div> | 328 | </div> |
334 | </td> | 329 | </td> |
335 | </tr> | 330 | </tr> |
336 | </tbody> | 331 | </tbody> |
337 | <tfoot> | 332 | <tfoot> |
338 | <!-- SELECCIONAR PRODUCTO --> | 333 | <!-- SELECCIONAR PRODUCTO --> |
339 | <tr ng-show="cargando" class="d-flex"> | 334 | <tr ng-show="cargando" class="d-flex"> |
340 | <td class="col-12"> | 335 | <td class="col-12"> |
341 | <input | 336 | <input |
342 | placeholder="Seleccione Factura" | 337 | placeholder="Seleccione Factura" |
343 | class="form-control form-control-sm" | 338 | class="form-control form-control-sm" |
344 | readonly | 339 | readonly |
345 | ng-click="seleccionarFactura()" | 340 | ng-click="seleccionarFactura()" |
346 | /> | 341 | /> |
347 | </td> | 342 | </td> |
348 | </tr> | 343 | </tr> |
349 | <!-- TOOGLE EXPANDIR --> | 344 | <!-- TOOGLE EXPANDIR --> |
350 | <tr> | 345 | <tr> |
351 | <td class="col"> | 346 | <td class="col"> |
352 | <button | 347 | <button |
353 | class="btn btn-outline-secondary selectable w-100" | 348 | class="btn btn-outline-secondary selectable w-100" |
354 | ng-click="show = !show; masMenos()" | 349 | ng-click="show = !show; masMenos()" |
355 | ng-show="facturaTabla.length > 0" | 350 | ng-show="facturaTabla.length > 0" |
356 | > | 351 | > |
357 | <i | 352 | <i |
358 | class="fa fa-chevron-down" | 353 | class="fa fa-chevron-down" |
359 | ng-hide="show" | 354 | ng-hide="show" |
360 | aria-hidden="true" | 355 | aria-hidden="true" |
361 | > | 356 | > |
362 | </i> | 357 | </i> |
363 | <i | 358 | <i |
364 | class="fa fa-chevron-up" | 359 | class="fa fa-chevron-up" |
365 | ng-show="show" | 360 | ng-show="show" |
366 | aria-hidden="true"> | 361 | aria-hidden="true"> |
367 | </i> | 362 | </i> |
368 | </button> | 363 | </button> |
369 | </td> | 364 | </td> |
370 | </tr> | 365 | </tr> |
371 | <!-- FOOTER --> | 366 | <!-- FOOTER --> |
372 | <tr class="d-flex"> | 367 | <tr class="d-flex"> |
373 | <td class="align-middle no-border-top" colspan="2"> | 368 | <td class="align-middle no-border-top" colspan="2"> |
374 | <strong>Cantidad Items:</strong> | 369 | <strong>Cantidad Items:</strong> |
375 | <a ng-bind="facturaTabla.length"></a> | 370 | <a ng-bind="facturaTabla.length"></a> |
376 | </td> | 371 | </td> |
377 | </tr> | 372 | </tr> |
378 | </tfoot> | 373 | </tfoot> |
379 | </table> | 374 | </table> |
380 | <!-- COBROS --> | 375 | <!-- COBROS --> |
381 | <table class="table table-sm table-striped table-dark" ng-show="!cobroDeuda"> | 376 | <table class="table table-sm table-striped table-dark" ng-show="!cobroDeuda"> |
382 | <thead> | 377 | <thead> |
383 | <tr class="d-flex"> | 378 | <tr class="d-flex"> |
384 | <th class="">#</th> | 379 | <th class="">#</th> |
385 | <th class="col px-0"> | 380 | <th class="col px-0"> |
386 | <div class="d-flex"> | 381 | <div class="d-flex"> |
387 | <div class="col-4 px-1">Cobro</div> | 382 | <div class="col-4 px-1">Cobro</div> |
388 | <div class="col-4 px-1">Fecha</div> | 383 | <div class="col-4 px-1">Fecha</div> |
389 | <div class="col-4 px-1">Importe</div> | 384 | <div class="col-4 px-1">Importe</div> |
390 | </div> | 385 | </div> |
391 | </th> | 386 | </th> |
392 | <th class="text-center tamaño-boton"> | 387 | <th class="text-center tamaño-boton"> |
393 | | 388 | |
394 | </th> | 389 | </th> |
395 | </tr> | 390 | </tr> |
396 | </thead> | 391 | </thead> |
397 | <tbody> | 392 | <tbody> |
398 | <tr | 393 | <tr |
399 | ng-repeat="(key, cobro) in cobrosTabla" | 394 | ng-repeat="(key, cobro) in cobrosTabla" |
400 | ng-show="show || key == cobrosTabla.length - 1" | 395 | ng-show="show || key == cobrosTabla.length - 1" |
401 | > | 396 | > |
402 | <td class="w-100 align-middle d-flex p-0"> | 397 | <td class="w-100 align-middle d-flex p-0"> |
403 | <div class="align-middle p-1"> | 398 | <div class="align-middle p-1"> |
404 | <span ng-bind="key+1" class="align-middle"></span> | 399 | <span ng-bind="key+1" class="align-middle"></span> |
405 | </div> | 400 | </div> |
406 | <div class="col px-0"> | 401 | <div class="col px-0"> |
407 | <div class="d-flex"> | 402 | <div class="d-flex"> |
408 | <div class="col-4 px-1"> | 403 | <div class="col-4 px-1"> |
409 | <span ng-bind="cobro.tipo" | 404 | <span ng-bind="cobro.tipo" |
410 | ></span> | 405 | ></span> |
411 | </div> | 406 | </div> |
412 | <div class="col-4 px-1"> | 407 | <div class="col-4 px-1"> |
413 | <span ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></span> | 408 | <span ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></span> |
414 | </div> | 409 | </div> |
415 | <div class="col-4 px-1"> | 410 | <div class="col-4 px-1"> |
416 | <span | 411 | <span |
417 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | | 412 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | |
418 | currency: cobranza.moneda.SIMBOLO : 4"></span> | 413 | currency: cobranza.moneda.SIMBOLO : 4"></span> |
419 | </div> | 414 | </div> |
420 | </div> | 415 | </div> |
421 | </div> | 416 | </div> |
422 | <div class="align-middle p-1"> | 417 | <div class="align-middle p-1"> |
423 | <button | 418 | <button |
424 | class="btn btn-outline-secondary" | 419 | class="btn btn-outline-secondary" |
425 | ng-click="quitarCobro(key)" | 420 | ng-click="quitarCobro(key)" |
426 | > | 421 | > |
427 | <i class="fa fa-trash"></i> | 422 | <i class="fa fa-trash"></i> |
428 | </button> | 423 | </button> |
429 | </div> | 424 | </div> |
430 | </td> | 425 | </td> |
431 | </tr> | 426 | </tr> |
432 | </tbody> | 427 | </tbody> |
433 | <tfoot> | 428 | <tfoot> |
434 | <!-- SELECCIONAR PRODUCTO --> | 429 | <!-- SELECCIONAR PRODUCTO --> |
435 | <tr ng-show="cargando" class="d-flex"> | 430 | <tr ng-show="cargando" class="d-flex"> |
436 | <td class="col-6"> | 431 | <td class="col-6"> |
437 | <input | 432 | <input |
438 | placeholder="Cheque" | 433 | placeholder="Cheque" |
439 | class="form-control form-control-sm" | 434 | class="form-control form-control-sm" |
440 | readonly | 435 | readonly |
441 | ng-click="seleccionarCheque()" | 436 | ng-click="seleccionarCheque()" |
442 | /> | 437 | /> |
443 | </td> | 438 | </td> |
444 | <td class="col-6"> | 439 | <td class="col-6"> |
445 | <input | 440 | <input |
446 | placeholder="Efectivo" | 441 | placeholder="Efectivo" |
447 | class="form-control form-control-sm" | 442 | class="form-control form-control-sm" |
448 | readonly | 443 | readonly |
449 | ng-click="seleccionarEfectivo()" | 444 | ng-click="seleccionarEfectivo()" |
450 | /> | 445 | /> |
451 | </td> | 446 | </td> |
452 | </tr> | 447 | </tr> |
453 | <!-- TOOGLE EXPANDIR --> | 448 | <!-- TOOGLE EXPANDIR --> |
454 | <tr> | 449 | <tr> |
455 | <td class="col"> | 450 | <td class="col"> |
456 | <button | 451 | <button |
457 | class="btn btn-outline-secondary selectable w-100" | 452 | class="btn btn-outline-secondary selectable w-100" |
458 | ng-click="show = !show; masMenos()" | 453 | ng-click="show = !show; masMenos()" |
459 | ng-show="cobrosTabla.length > 0" | 454 | ng-show="cobrosTabla.length > 0" |
460 | > | 455 | > |
461 | <i | 456 | <i |
462 | class="fa fa-chevron-down" | 457 | class="fa fa-chevron-down" |
463 | ng-hide="show" | 458 | ng-hide="show" |
464 | aria-hidden="true" | 459 | aria-hidden="true" |
465 | > | 460 | > |
466 | </i> | 461 | </i> |
467 | <i | 462 | <i |
468 | class="fa fa-chevron-up" | 463 | class="fa fa-chevron-up" |
469 | ng-show="show" | 464 | ng-show="show" |
470 | aria-hidden="true"> | 465 | aria-hidden="true"> |
471 | </i> | 466 | </i> |
472 | </button> | 467 | </button> |
473 | </td> | 468 | </td> |
474 | </tr> | 469 | </tr> |
475 | <!-- FOOTER --> | 470 | <!-- FOOTER --> |
476 | <tr class="d-flex"> | 471 | <tr class="d-flex"> |
477 | <td class="align-middle no-border-top col-6"> | 472 | <td class="align-middle no-border-top col-6"> |
478 | <strong>Cantidad Items:</strong> | 473 | <strong>Cantidad Items:</strong> |
479 | <a ng-bind="cobrosTabla.length"></a> | 474 | <a ng-bind="cobrosTabla.length"></a> |
480 | </td> | 475 | </td> |
481 | </tfoot> | 476 | </tfoot> |
482 | </table> | 477 | </table> |
483 | </tr> | 478 | </tr> |
484 | <!-- DEUDA, COBRADO, DIFERENCIA --> | 479 | <!-- DEUDA, COBRADO, DIFERENCIA --> |
485 | <table class="table-responsive"> | 480 | <table class="table-responsive"> |
486 | <tr class="d-flex row"> | 481 | <tr class="d-flex row"> |
487 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 482 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
488 | <strong>Deuda:</strong> | 483 | <strong>Cancela:</strong> |
489 | </td> | 484 | </td> |
490 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 485 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
491 | <strong>Cobrado:</strong> | 486 | <strong>Cobrado:</strong> |
492 | </td> | 487 | </td> |
493 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 488 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
494 | <strong>Diferencia:</strong> | 489 | <strong>Diferencia:</strong> |
495 | </td> | 490 | </td> |
496 | <td class="table-celda-total text-center no-border-top col-4"> | 491 | <td class="table-celda-total text-center no-border-top col-4"> |
497 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 492 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
498 | </td> | 493 | </td> |
499 | <td class="table-celda-total text-center no-border-top col-4"> | 494 | <td class="table-celda-total text-center no-border-top col-4"> |
500 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 495 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
501 | </td> | 496 | </td> |
502 | <td class="table-celda-total text-center no-border-top col-4"> | 497 | <td class="table-celda-total text-center no-border-top col-4"> |
503 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 498 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
504 | </td> | 499 | </td> |
505 | </tr> | 500 | </tr> |
506 | </table> | 501 | </table> |
507 | </div> | 502 | </div> |
508 | </div> | 503 | </div> |
509 | <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block"> | 504 | <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block"> |
510 | <div class="row align-items-end"> | 505 | <div class="row align-items-end"> |
511 | <div class="col-12"> | 506 | <div class="col-12"> |
512 | <button | 507 | <button |
513 | ng-click="crearCobranza()" | 508 | ng-click="crearCobranza()" |
514 | title="Crear nota pedido" | 509 | title="Crear nota pedido" |
515 | class="btn btn-default btn-block mb-2"> | 510 | class="btn btn-default btn-block mb-2"> |
516 | Guardar | 511 | Guardar |
517 | </button> | 512 | </button> |
518 | <button | 513 | <button |
519 | ng-click="salir()" | 514 | ng-click="salir()" |
520 | type="button" | 515 | type="button" |
521 | title="Salir" | 516 | title="Salir" |
522 | class="btn btn-default btn-block"> | 517 | class="btn btn-default btn-block"> |
523 | Salir | 518 | Salir |
524 | </button> | 519 | </button> |
525 | </div> | 520 | </div> |
526 | </div> | 521 | </div> |
527 | </div> | 522 | </div> |
528 | </div> | 523 | </div> |
529 | <div class="row d-md-none fixed-bottom"> | 524 | <div class="row d-md-none fixed-bottom"> |
530 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> | 525 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> |
531 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> | 526 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> |
532 | <span class="mr-3 ml-auto" ng-click="crearCobranza()">Guardar</span> | 527 | <span class="mr-3 ml-auto" ng-click="crearCobranza()">Guardar</span> |
533 | </div> | 528 | </div> |
534 | </div> | 529 | </div> |
535 | </div> | 530 | </div> |
536 | 531 |