Commit 7589ccb1ce98956a1a14b2efd909ea34f6b6b1be
1 parent
63a790ee49
Exists in
master
correccion texto titulos
Showing
2 changed files
with
5 additions
and
7 deletions
Show diff stats
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 | function($scope, $uibModal, $location, $filter, focaCrearCobranzaService, focaModalService) |
10 | { | 10 | { |
11 | $scope.botonera = [ | 11 | $scope.botonera = [ |
12 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, | 12 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, |
13 | {texto: 'Cobrador', accion: function() {$scope.seleccionarCobrador();}}, | 13 | {texto: 'Cobrador', accion: function() {$scope.seleccionarCobrador();}}, |
14 | {texto: 'Deuda', accion: function() {$scope.swichDeuda();}}, | 14 | {texto: 'Comprobantes', accion: function() {$scope.swichDeuda();}}, |
15 | {texto: 'Cobros', accion: function() {$scope.swichCobro();}}, | 15 | {texto: 'Cobros', accion: function() {$scope.swichCobro();}}, |
16 | {texto: 'Moneda', accion: function() {$scope.seleccionarMoneda();}}, | 16 | {texto: 'Moneda', accion: function() {$scope.seleccionarMoneda();}}, |
17 | {texto: '', accion: function() {}}, | 17 | {texto: '', accion: function() {}}, |
18 | {texto: '', accion: function() {}}, | 18 | {texto: '', accion: function() {}}, |
19 | {texto: '', accion: function() {}} | 19 | {texto: '', accion: function() {}} |
20 | ]; | 20 | ]; |
21 | $scope.datepickerAbierto = false; | 21 | $scope.datepickerAbierto = false; |
22 | $scope.cobroDeuda = true; | 22 | $scope.cobroDeuda = true; |
23 | $scope.show = false; | 23 | $scope.show = false; |
24 | $scope.cargando = true; | 24 | $scope.cargando = true; |
25 | $scope.dateOptions = { | 25 | $scope.dateOptions = { |
26 | maxDate: new Date(), | 26 | maxDate: new Date(), |
27 | minDate: new Date(2010, 0, 1) | 27 | minDate: new Date(2010, 0, 1) |
28 | }; | 28 | }; |
29 | 29 | ||
30 | $scope.cobranza = { | 30 | $scope.cobranza = { |
31 | fecha: new Date() | 31 | fecha: new Date() |
32 | }; | 32 | }; |
33 | 33 | ||
34 | $scope.cabecera = []; | 34 | $scope.cabecera = []; |
35 | $scope.showCabecera = true; | 35 | $scope.showCabecera = true; |
36 | 36 | ||
37 | $scope.now = new Date(); | 37 | $scope.now = new Date(); |
38 | $scope.puntoVenta = '0000'; | 38 | $scope.puntoVenta = '0000'; |
39 | $scope.comprobante = '00000000'; | 39 | $scope.comprobante = '00000000'; |
40 | $scope.facturaTabla = []; | 40 | $scope.facturaTabla = []; |
41 | $scope.cobrosTabla = []; | 41 | $scope.cobrosTabla = []; |
42 | 42 | ||
43 | var monedaPorDefecto; | 43 | var monedaPorDefecto; |
44 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' | 44 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' |
45 | focaCrearCobranzaService.getCotizacionByIdMoneda(1).then(function(res) { | 45 | focaCrearCobranzaService.getCotizacionByIdMoneda(1).then(function(res) { |
46 | monedaPorDefecto = res.data[0]; | 46 | monedaPorDefecto = res.data[0]; |
47 | addCabecera('Moneda:', monedaPorDefecto.DETALLE); | 47 | addCabecera('Moneda:', monedaPorDefecto.DETALLE); |
48 | addCabecera('Fecha cotizacion:', | 48 | addCabecera('Fecha cotizacion:', |
49 | new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); | 49 | new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); |
50 | addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].VENDEDOR); | 50 | addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].VENDEDOR); |
51 | $scope.cobranza.moneda = monedaPorDefecto; | 51 | $scope.cobranza.moneda = monedaPorDefecto; |
52 | $scope.cobranza.cotizacion = monedaPorDefecto.cotizaciones[0]; | 52 | $scope.cobranza.cotizacion = monedaPorDefecto.cotizaciones[0]; |
53 | }); | 53 | }); |
54 | 54 | ||
55 | focaCrearCobranzaService.getNumeroRecibo().then( | 55 | focaCrearCobranzaService.getNumeroRecibo().then( |
56 | function(res) { | 56 | function(res) { |
57 | $scope.puntoVenta = $scope.rellenar(res.data.sucursal, 4); | 57 | $scope.puntoVenta = $scope.rellenar(res.data.sucursal, 4); |
58 | $scope.comprobante = $scope.rellenar(res.data.numeroRecibo, 8); | 58 | $scope.comprobante = $scope.rellenar(res.data.numeroRecibo, 8); |
59 | }, | 59 | }, |
60 | function(err) { | 60 | function(err) { |
61 | focaModalService.alert('La terminal no esta configurada correctamente'); | 61 | focaModalService.alert('La terminal no esta configurada correctamente'); |
62 | console.info(err); | 62 | console.info(err); |
63 | } | 63 | } |
64 | ); | 64 | ); |
65 | $scope.crearCobranza = function() { | 65 | $scope.crearCobranza = function() { |
66 | if(!$scope.cliente.COD) { | 66 | if(!$scope.cliente.COD) { |
67 | focaModalService.alert('Ingrese Cliente'); | 67 | focaModalService.alert('Ingrese Cliente'); |
68 | return; | 68 | return; |
69 | }else if($scope.facturaTabla.length < 1) { | 69 | }else if($scope.facturaTabla.length < 1) { |
70 | focaModalService.alert('Ingrese al menos una factura'); | 70 | focaModalService.alert('Ingrese al menos una factura'); |
71 | return; | 71 | return; |
72 | } | 72 | } |
73 | //TODO: Guarda cobranza | 73 | //TODO: Guarda cobranza |
74 | // var date = new Date(); | 74 | // var date = new Date(); |
75 | // var cobranza = { | 75 | // var cobranza = { |
76 | // }; | 76 | // }; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | $scope.swichCobro = function() { | 79 | $scope.swichCobro = function() { |
80 | $scope.cobroDeuda = false; | 80 | $scope.cobroDeuda = false; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | $scope.swichDeuda = function() { | 83 | $scope.swichDeuda = function() { |
84 | $scope.cobroDeuda = true; | 84 | $scope.cobroDeuda = true; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | $scope.seleccionarCliente = function() { | 87 | $scope.seleccionarCliente = function() { |
88 | 88 | ||
89 | var modalInstance = $uibModal.open( | 89 | var modalInstance = $uibModal.open( |
90 | { | 90 | { |
91 | ariaLabelledBy: 'Busqueda de Cliente', | 91 | ariaLabelledBy: 'Busqueda de Cliente', |
92 | templateUrl: 'foca-busqueda-cliente-modal.html', | 92 | templateUrl: 'foca-busqueda-cliente-modal.html', |
93 | controller: 'focaBusquedaClienteModalController', | 93 | controller: 'focaBusquedaClienteModalController', |
94 | size: 'lg' | 94 | size: 'lg' |
95 | } | 95 | } |
96 | ); | 96 | ); |
97 | modalInstance.result.then( | 97 | modalInstance.result.then( |
98 | function(cliente) { | 98 | function(cliente) { |
99 | addCabecera('Cliente:', cliente.nom); | 99 | addCabecera('Cliente:', cliente.nom); |
100 | $scope.cobranza.cliente = { | 100 | $scope.cobranza.cliente = { |
101 | COD: cliente.cod, | 101 | COD: cliente.cod, |
102 | CUIT: cliente.cuit, | 102 | CUIT: cliente.cuit, |
103 | NOM: cliente.nom | 103 | NOM: cliente.nom |
104 | }; | 104 | }; |
105 | }, function() { | 105 | }, function() { |
106 | 106 | ||
107 | } | 107 | } |
108 | ); | 108 | ); |
109 | }; | 109 | }; |
110 | 110 | ||
111 | $scope.seleccionarFactura = function() { | 111 | $scope.seleccionarFactura = function() { |
112 | if(!$scope.cobranza.cliente) { | 112 | if(!$scope.cobranza.cliente) { |
113 | focaModalService.alert('Seleccione primero un cliente'); | 113 | focaModalService.alert('Seleccione primero un cliente'); |
114 | return; | 114 | return; |
115 | } | 115 | } |
116 | var modalInstance = $uibModal.open( | 116 | var modalInstance = $uibModal.open( |
117 | { | 117 | { |
118 | ariaLabelledBy: 'Busqueda de Facturas', | 118 | ariaLabelledBy: 'Busqueda de Facturas', |
119 | templateUrl: 'foca-modal-factura.html', | 119 | templateUrl: 'foca-modal-factura.html', |
120 | controller: 'focaModalFacturaController', | 120 | controller: 'focaModalFacturaController', |
121 | size: 'lg', | 121 | size: 'lg', |
122 | resolve: { | 122 | resolve: { |
123 | parametrosFactura: { | 123 | parametrosFactura: { |
124 | cliente: $scope.cobranza.cliente.COD, | 124 | cliente: $scope.cobranza.cliente.COD, |
125 | simbolo: $scope.cobranza.moneda.SIMBOLO, | 125 | simbolo: $scope.cobranza.moneda.SIMBOLO, |
126 | cotizacion: $scope.cobranza.cotizacion.VENDEDOR | 126 | cotizacion: $scope.cobranza.cotizacion.VENDEDOR |
127 | } | 127 | } |
128 | } | 128 | } |
129 | } | 129 | } |
130 | ); | 130 | ); |
131 | modalInstance.result.then( | 131 | modalInstance.result.then( |
132 | function(facturas) { | 132 | function(facturas) { |
133 | $scope.facturaTabla = $scope.facturaTabla.concat(facturas); | 133 | $scope.facturaTabla = $scope.facturaTabla.concat(facturas); |
134 | }, function() { | 134 | }, function() { |
135 | 135 | ||
136 | } | 136 | } |
137 | ); | 137 | ); |
138 | }; | 138 | }; |
139 | 139 | ||
140 | $scope.seleccionarCheque = function() { | 140 | $scope.seleccionarCheque = function() { |
141 | var modalInstance = $uibModal.open( | 141 | var modalInstance = $uibModal.open( |
142 | { | 142 | { |
143 | ariaLabelledBy: 'Carga de cheques', | 143 | ariaLabelledBy: 'Carga de cheques', |
144 | templateUrl: 'modal-cheque.html', | 144 | templateUrl: 'modal-cheque.html', |
145 | controller: 'focaModalChequeController', | 145 | controller: 'focaModalChequeController', |
146 | size: 'lg' | 146 | size: 'lg' |
147 | } | 147 | } |
148 | ); | 148 | ); |
149 | modalInstance.result.then( | 149 | modalInstance.result.then( |
150 | function(cheque) { | 150 | function(cheque) { |
151 | var cobro = { | 151 | var cobro = { |
152 | tipo: 'Cheque', | 152 | tipo: 'Cheque', |
153 | fecha: cheque.fechaValor, | 153 | fecha: cheque.fechaValor, |
154 | importe: cheque.importe | 154 | importe: cheque.importe |
155 | }; | 155 | }; |
156 | $scope.cobrosTabla.push(cobro); | 156 | $scope.cobrosTabla.push(cobro); |
157 | }, function() { | 157 | }, function() { |
158 | 158 | ||
159 | } | 159 | } |
160 | ); | 160 | ); |
161 | }; | 161 | }; |
162 | 162 | ||
163 | $scope.seleccionarEfectivo = function() { | 163 | $scope.seleccionarEfectivo = function() { |
164 | var modalInstance = $uibModal.open( | 164 | var modalInstance = $uibModal.open( |
165 | { | 165 | { |
166 | ariaLabelledBy: 'Carga de cheques', | 166 | ariaLabelledBy: 'Carga de cheques', |
167 | templateUrl: 'modal-efectivo.html', | 167 | templateUrl: 'modal-efectivo.html', |
168 | controller: 'focaModalEfectivoController', | 168 | controller: 'focaModalEfectivoController', |
169 | size: 'sm' | 169 | size: 'sm' |
170 | } | 170 | } |
171 | ); | 171 | ); |
172 | modalInstance.result.then( | 172 | modalInstance.result.then( |
173 | function(efectivo) { | 173 | function(efectivo) { |
174 | var cobro = { | 174 | var cobro = { |
175 | tipo: 'Efectivo', | 175 | tipo: 'Efectivo', |
176 | fecha: new Date(), | 176 | fecha: new Date(), |
177 | importe: efectivo | 177 | importe: efectivo |
178 | }; | 178 | }; |
179 | $scope.cobrosTabla.push(cobro); | 179 | $scope.cobrosTabla.push(cobro); |
180 | }, function() { | 180 | }, function() { |
181 | 181 | ||
182 | } | 182 | } |
183 | ); | 183 | ); |
184 | }; | 184 | }; |
185 | 185 | ||
186 | $scope.seleccionarMoneda = function() { | 186 | $scope.seleccionarMoneda = function() { |
187 | var modalInstance = $uibModal.open( | 187 | var modalInstance = $uibModal.open( |
188 | { | 188 | { |
189 | ariaLabelledBy: 'Busqueda de Moneda', | 189 | ariaLabelledBy: 'Busqueda de Moneda', |
190 | templateUrl: 'modal-moneda.html', | 190 | templateUrl: 'modal-moneda.html', |
191 | controller: 'focaModalMonedaController', | 191 | controller: 'focaModalMonedaController', |
192 | size: 'lg' | 192 | size: 'lg' |
193 | } | 193 | } |
194 | ); | 194 | ); |
195 | modalInstance.result.then( | 195 | modalInstance.result.then( |
196 | function(moneda) { | 196 | function(moneda) { |
197 | $scope.seleccionarCotizacion(moneda); | 197 | $scope.seleccionarCotizacion(moneda); |
198 | }, function() { | 198 | }, function() { |
199 | 199 | ||
200 | } | 200 | } |
201 | ); | 201 | ); |
202 | }; | 202 | }; |
203 | 203 | ||
204 | $scope.seleccionarCobrador = function() { | 204 | $scope.seleccionarCobrador = function() { |
205 | var modalInstance = $uibModal.open( | 205 | var modalInstance = $uibModal.open( |
206 | { | 206 | { |
207 | ariaLabelledBy: 'Busqueda de Cobradores', | 207 | ariaLabelledBy: 'Busqueda de Cobradores', |
208 | templateUrl: 'modal-cobradores.html', | 208 | templateUrl: 'modal-cobradores.html', |
209 | controller: 'focaModalCobradoresController', | 209 | controller: 'focaModalCobradoresController', |
210 | size: 'lg' | 210 | size: 'lg' |
211 | } | 211 | } |
212 | ); | 212 | ); |
213 | modalInstance.result.then( | 213 | modalInstance.result.then( |
214 | function(cobrador) { | 214 | function(cobrador) { |
215 | addCabecera('Cobrador:', cobrador.nombre); | 215 | addCabecera('Cobrador:', cobrador.nombre); |
216 | $scope.cobranza.cobrador = cobrador; | 216 | $scope.cobranza.cobrador = cobrador; |
217 | }, function() { | 217 | }, function() { |
218 | 218 | ||
219 | } | 219 | } |
220 | ); | 220 | ); |
221 | }; | 221 | }; |
222 | 222 | ||
223 | $scope.seleccionarCotizacion = function(moneda) { | 223 | $scope.seleccionarCotizacion = function(moneda) { |
224 | var modalInstance = $uibModal.open( | 224 | var modalInstance = $uibModal.open( |
225 | { | 225 | { |
226 | ariaLabelledBy: 'Busqueda de Cotización', | 226 | ariaLabelledBy: 'Busqueda de Cotización', |
227 | templateUrl: 'modal-cotizacion.html', | 227 | templateUrl: 'modal-cotizacion.html', |
228 | controller: 'focaModalCotizacionController', | 228 | controller: 'focaModalCotizacionController', |
229 | size: 'lg', | 229 | size: 'lg', |
230 | resolve: {idMoneda: function() {return moneda.ID;}} | 230 | resolve: {idMoneda: function() {return moneda.ID;}} |
231 | } | 231 | } |
232 | ); | 232 | ); |
233 | modalInstance.result.then( | 233 | modalInstance.result.then( |
234 | function(cotizacion) { | 234 | function(cotizacion) { |
235 | $scope.cobranza.moneda = moneda; | 235 | $scope.cobranza.moneda = moneda; |
236 | $scope.cobranza.cotizacion = cotizacion; | 236 | $scope.cobranza.cotizacion = cotizacion; |
237 | addCabecera('Moneda:', moneda.DETALLE); | 237 | addCabecera('Moneda:', moneda.DETALLE); |
238 | addCabecera( | 238 | addCabecera( |
239 | 'Fecha cotizacion:', | 239 | 'Fecha cotizacion:', |
240 | $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') | 240 | $filter('date')(cotizacion.FECHA, 'dd/MM/yyyy') |
241 | ); | 241 | ); |
242 | addCabecera('Cotizacion:', cotizacion.VENDEDOR); | 242 | addCabecera('Cotizacion:', cotizacion.VENDEDOR); |
243 | }, function() { | 243 | }, function() { |
244 | 244 | ||
245 | } | 245 | } |
246 | ); | 246 | ); |
247 | }; | 247 | }; |
248 | 248 | ||
249 | $scope.agregarCobro = function(key) { | 249 | $scope.agregarCobro = function(key) { |
250 | if(key === 13) { | 250 | if(key === 13) { |
251 | var cobro = { | 251 | var cobro = { |
252 | cobro: 'Efectivo', | 252 | cobro: 'Efectivo', |
253 | fecha: new Date(), | 253 | fecha: new Date(), |
254 | importe: $scope.cobroEfectivo | 254 | importe: $scope.cobroEfectivo |
255 | }; | 255 | }; |
256 | $scope.cobrosTabla.push(cobro); | 256 | $scope.cobrosTabla.push(cobro); |
257 | } | 257 | } |
258 | }; | 258 | }; |
259 | 259 | ||
260 | $scope.getTotalDeuda = function() { | 260 | $scope.getTotalDeuda = function() { |
261 | var total = 0; | 261 | var total = 0; |
262 | for (var i = 0; i < $scope.facturaTabla.length; i++) { | 262 | for (var i = 0; i < $scope.facturaTabla.length; i++) { |
263 | total += $scope.facturaTabla[i].IPA; | 263 | total += $scope.facturaTabla[i].IPA; |
264 | } | 264 | } |
265 | return parseFloat(total.toFixed(2)); | 265 | return parseFloat(total.toFixed(2)); |
266 | }; | 266 | }; |
267 | 267 | ||
268 | $scope.getTotalCobrado = function() { | 268 | $scope.getTotalCobrado = function() { |
269 | var total = 0; | 269 | var total = 0; |
270 | for (var i = 0; i < $scope.cobrosTabla.length; i++) { | 270 | for (var i = 0; i < $scope.cobrosTabla.length; i++) { |
271 | total += $scope.cobrosTabla[i].importe; | 271 | total += $scope.cobrosTabla[i].importe; |
272 | } | 272 | } |
273 | return parseFloat(total.toFixed(2)); | 273 | return parseFloat(total.toFixed(2)); |
274 | }; | 274 | }; |
275 | 275 | ||
276 | $scope.getSubTotal = function() { | 276 | $scope.getSubTotal = function() { |
277 | if($scope.articuloACargar) { | 277 | if($scope.articuloACargar) { |
278 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; | 278 | return $scope.articuloACargar.precio * $scope.articuloACargar.cantidad; |
279 | } | 279 | } |
280 | }; | 280 | }; |
281 | //Recibe aviso si el teclado está en uso | 281 | //Recibe aviso si el teclado está en uso |
282 | // $rootScope.$on('usarTeclado', function(event, data) { | 282 | // $rootScope.$on('usarTeclado', function(event, data) { |
283 | // if(data) { | 283 | // if(data) { |
284 | // $scope.mostrarTeclado = true; | 284 | // $scope.mostrarTeclado = true; |
285 | // return; | 285 | // return; |
286 | // } | 286 | // } |
287 | // $scope.mostrarTeclado = false; | 287 | // $scope.mostrarTeclado = false; |
288 | // }) | 288 | // }) |
289 | $scope.selectFocus = function($event) { | 289 | $scope.selectFocus = function($event) { |
290 | //Si el teclado esta en uso no selecciona el valor | 290 | //Si el teclado esta en uso no selecciona el valor |
291 | // if($scope.mostrarTeclado) { | 291 | // if($scope.mostrarTeclado) { |
292 | // return; | 292 | // return; |
293 | // } | 293 | // } |
294 | $event.target.select(); | 294 | $event.target.select(); |
295 | }; | 295 | }; |
296 | 296 | ||
297 | $scope.salir = function() { | 297 | $scope.salir = function() { |
298 | $location.path('/'); | 298 | $location.path('/'); |
299 | }; | 299 | }; |
300 | 300 | ||
301 | $scope.parsearATexto = function(articulo) { | 301 | $scope.parsearATexto = function(articulo) { |
302 | articulo.cantidad = parseFloat(articulo.cantidad); | 302 | articulo.cantidad = parseFloat(articulo.cantidad); |
303 | articulo.precio = parseFloat(articulo.precio); | 303 | articulo.precio = parseFloat(articulo.precio); |
304 | }; | 304 | }; |
305 | 305 | ||
306 | $scope.rellenar = function(relleno, longitud) { | 306 | $scope.rellenar = function(relleno, longitud) { |
307 | relleno = '' + relleno; | 307 | relleno = '' + relleno; |
308 | while (relleno.length < longitud) { | 308 | while (relleno.length < longitud) { |
309 | relleno = '0' + relleno; | 309 | relleno = '0' + relleno; |
310 | } | 310 | } |
311 | 311 | ||
312 | return relleno; | 312 | return relleno; |
313 | }; | 313 | }; |
314 | 314 | ||
315 | $scope.quitarFactura = function(key) { | 315 | $scope.quitarFactura = function(key) { |
316 | $scope.facturaTabla.splice(key, 1); | 316 | $scope.facturaTabla.splice(key, 1); |
317 | }; | 317 | }; |
318 | 318 | ||
319 | $scope.quitarCobro = function(key) { | 319 | $scope.quitarCobro = function(key) { |
320 | $scope.cobrosTabla.splice(key, 1); | 320 | $scope.cobrosTabla.splice(key, 1); |
321 | }; | 321 | }; |
322 | 322 | ||
323 | function addCabecera(label, valor) { | 323 | function addCabecera(label, valor) { |
324 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); | 324 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); |
325 | if(propiedad.length === 1) { | 325 | if(propiedad.length === 1) { |
326 | propiedad[0].valor = valor; | 326 | propiedad[0].valor = valor; |
327 | } else { | 327 | } else { |
328 | $scope.cabecera.push({label: label, valor: valor}); | 328 | $scope.cabecera.push({label: label, valor: valor}); |
329 | } | 329 | } |
330 | } | 330 | } |
331 | // TODO: descomentar cuando se use | 331 | // TODO: descomentar cuando se use |
332 | /*function removeCabecera(label) { | 332 | /*function removeCabecera(label) { |
333 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); | 333 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); |
334 | if(propiedad.length === 1){ | 334 | if(propiedad.length === 1){ |
335 | $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); | 335 | $scope.cabecera.splice($scope.cabecera.indexOf(propiedad[0]), 1); |
336 | } | 336 | } |
337 | }*/ | 337 | }*/ |
338 | } | 338 | } |
339 | ]); | 339 | ]); |
340 | 340 |
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>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="now | 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="now" |
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">Factura</th> | 91 | <th class="col">Comprobante</th> |
92 | <th class="col">Cliente</th> | ||
93 | <th class="col">Fecha</th> | 92 | <th class="col">Fecha</th> |
94 | <th class="col">Importe</th> | 93 | <th class="col">Importe</th> |
95 | <th class="col-auto"> | 94 | <th class="col-auto"> |
96 | <button | 95 | <button |
97 | class="btn btn-outline-secondary selectable" | 96 | class="btn btn-outline-secondary selectable" |
98 | ng-click="show = !show; masMenos()" | 97 | ng-click="show = !show; masMenos()" |
99 | > | 98 | > |
100 | <i | 99 | <i |
101 | class="fa fa-chevron-down" | 100 | class="fa fa-chevron-down" |
102 | ng-show="show" | 101 | ng-show="show" |
103 | aria-hidden="true" | 102 | aria-hidden="true" |
104 | > | 103 | > |
105 | </i> | 104 | </i> |
106 | <i | 105 | <i |
107 | class="fa fa-chevron-up" | 106 | class="fa fa-chevron-up" |
108 | ng-hide="show" | 107 | ng-hide="show" |
109 | aria-hidden="true"> | 108 | aria-hidden="true"> |
110 | </i> | 109 | </i> |
111 | </button> | 110 | </button> |
112 | </th> | 111 | </th> |
113 | </th> | 112 | </th> |
114 | </tr> | 113 | </tr> |
115 | </thead> | 114 | </thead> |
116 | <tbody class="tabla-articulo-body"> | 115 | <tbody class="tabla-articulo-body"> |
117 | <tr | 116 | <tr |
118 | ng-repeat="(key, factura) in facturaTabla" | 117 | ng-repeat="(key, factura) in facturaTabla" |
119 | class="d-flex" | 118 | class="d-flex" |
120 | ng-show="show || key == facturaTabla.length - 1" | 119 | ng-show="show || key == facturaTabla.length - 1" |
121 | > | 120 | > |
122 | <td ng-bind="key + 1" class="col-auto"></td> | 121 | <td ng-bind="key + 1" class="col-auto"></td> |
123 | <td class="col" | 122 | <td class="col" |
124 | ng-bind= | 123 | ng-bind= |
125 | "(factura.TCO + '-' + factura.TIP + '-' + | 124 | "(factura.TCO + '-' + factura.TIP + '-' + |
126 | factura.SUC + '-' + factura.NCO)" | 125 | factura.SUC + '-' + factura.NCO)" |
127 | ></td> | 126 | ></td> |
128 | <td class="col" ng-bind="factura.cliente.NOM"></td> | ||
129 | <td class="col" ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></td> | 127 | <td class="col" ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></td> |
130 | <td | 128 | <td |
131 | class="col" | 129 | class="col" |
132 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | | 130 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | |
133 | currency: cobranza.moneda.SIMBOLO"></td> | 131 | currency: cobranza.moneda.SIMBOLO"></td> |
134 | <td class="text-center col-auto"> | 132 | <td class="text-center col-auto"> |
135 | <button | 133 | <button |
136 | class="btn btn-outline-secondary" | 134 | class="btn btn-outline-secondary" |
137 | ng-click="quitarFactura(key)" | 135 | ng-click="quitarFactura(key)" |
138 | > | 136 | > |
139 | <i class="fa fa-trash"></i> | 137 | <i class="fa fa-trash"></i> |
140 | </button> | 138 | </button> |
141 | </td> | 139 | </td> |
142 | </tr> | 140 | </tr> |
143 | </tbody> | 141 | </tbody> |
144 | <tfoot> | 142 | <tfoot> |
145 | <tr ng-show="cargando" class="d-flex"> | 143 | <tr ng-show="cargando" class="d-flex"> |
146 | <td class="col-2"> | 144 | <td class="col-2"> |
147 | <a | 145 | <a |
148 | class="form-control form-control-sm btn btn-secondary" | 146 | class="form-control form-control-sm btn btn-secondary" |
149 | ng-click="seleccionarFactura()" | 147 | ng-click="seleccionarFactura()" |
150 | >Factura</a> | 148 | >Pendientes</a> |
151 | </td> | 149 | </td> |
152 | </tr> | 150 | </tr> |
153 | <tr class="d-flex"> | 151 | <tr class="d-flex"> |
154 | <td class="col-auto px-1"> | 152 | <td class="col-auto px-1"> |
155 | <strong>Comprobantes:</strong> | 153 | <strong>Comprobantes:</strong> |
156 | <a ng-bind="facturaTabla.length"></a> | 154 | <a ng-bind="facturaTabla.length"></a> |
157 | </td> | 155 | </td> |
158 | <td class="text-right ml-auto table-celda-total no-border-top"> | 156 | <td class="text-right ml-auto table-celda-total no-border-top"> |
159 | <strong>Total Deuda:</strong> | 157 | <strong>Cancela:</strong> |
160 | </td> | 158 | </td> |
161 | <td class="table-celda-total text-right no-border-top"> | 159 | <td class="table-celda-total text-right no-border-top"> |
162 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | | 160 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | |
163 | currency: cobranza.moneda.SIMBOLO}}</strong> | 161 | currency: cobranza.moneda.SIMBOLO}}</strong> |
164 | </td> | 162 | </td> |
165 | <td class="text-right ml-auto table-celda-total no-border-top"> | 163 | <td class="text-right ml-auto table-celda-total no-border-top"> |
166 | <strong>Total Cobrado:</strong> | 164 | <strong>Total Cobrado:</strong> |
167 | </td> | 165 | </td> |
168 | <td class="table-celda-total text-right no-border-top"> | 166 | <td class="table-celda-total text-right no-border-top"> |
169 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | | 167 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | |
170 | currency: cobranza.moneda.SIMBOLO}}</strong> | 168 | currency: cobranza.moneda.SIMBOLO}}</strong> |
171 | </td> | 169 | </td> |
172 | <td class="text-right ml-auto table-celda-total no-border-top"> | 170 | <td class="text-right ml-auto table-celda-total no-border-top"> |
173 | <strong>DF:</strong> | 171 | <strong>DF:</strong> |
174 | </td> | 172 | </td> |
175 | <td class="table-celda-total text-right no-border-top"> | 173 | <td class="table-celda-total text-right no-border-top"> |
176 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / | 174 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / |
177 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} | 175 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} |
178 | </strong> | 176 | </strong> |
179 | </td> | 177 | </td> |
180 | </tr> | 178 | </tr> |
181 | </tfoot> | 179 | </tfoot> |
182 | </table> | 180 | </table> |
183 | </div> | 181 | </div> |
184 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="!cobroDeuda"> | 182 | <div class="row grilla-articulo align-items-end d-none d-sm-flex" ng-show="!cobroDeuda"> |
185 | <table class="table tabla-articulo table-striped table-sm table-dark"> | 183 | <table class="table tabla-articulo table-striped table-sm table-dark"> |
186 | <thead> | 184 | <thead> |
187 | <tr class="d-flex"> | 185 | <tr class="d-flex"> |
188 | <th class="col-auto">#</th> | 186 | <th class="col-auto">#</th> |
189 | <th class="col">Cobro</th> | 187 | <th class="col">Cobro</th> |
190 | <th class="col">Fecha</th> | 188 | <th class="col">Fecha</th> |
191 | <th class="col">Importe</th> | 189 | <th class="col">Importe</th> |
192 | <th class="col-auto"> | 190 | <th class="col-auto"> |
193 | <button | 191 | <button |
194 | class="btn btn-outline-secondary selectable" | 192 | class="btn btn-outline-secondary selectable" |
195 | ng-click="show = !show; masMenos()" | 193 | ng-click="show = !show; masMenos()" |
196 | > | 194 | > |
197 | <i | 195 | <i |
198 | class="fa fa-chevron-down" | 196 | class="fa fa-chevron-down" |
199 | ng-show="show" | 197 | ng-show="show" |
200 | aria-hidden="true" | 198 | aria-hidden="true" |
201 | > | 199 | > |
202 | </i> | 200 | </i> |
203 | <i | 201 | <i |
204 | class="fa fa-chevron-up" | 202 | class="fa fa-chevron-up" |
205 | ng-hide="show" | 203 | ng-hide="show" |
206 | aria-hidden="true"> | 204 | aria-hidden="true"> |
207 | </i> | 205 | </i> |
208 | </button> | 206 | </button> |
209 | </th> | 207 | </th> |
210 | </th> | 208 | </th> |
211 | </tr> | 209 | </tr> |
212 | </thead> | 210 | </thead> |
213 | <tbody class="tabla-articulo-body"> | 211 | <tbody class="tabla-articulo-body"> |
214 | <tr | 212 | <tr |
215 | ng-repeat="(key, cobro) in cobrosTabla" | 213 | ng-repeat="(key, cobro) in cobrosTabla" |
216 | class="d-flex" | 214 | class="d-flex" |
217 | ng-show="show || key == cobrosTabla.length - 1" | 215 | ng-show="show || key == cobrosTabla.length - 1" |
218 | > | 216 | > |
219 | <td ng-bind="key + 1" class="col-auto"></td> | 217 | <td ng-bind="key + 1" class="col-auto"></td> |
220 | <td class="col" ng-bind="cobro.tipo"></td> | 218 | <td class="col" ng-bind="cobro.tipo"></td> |
221 | <td class="col" ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></td> | 219 | <td class="col" ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></td> |
222 | <td | 220 | <td |
223 | class="col" | 221 | class="col" |
224 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | | 222 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | |
225 | currency: cobranza.moneda.SIMBOLO"></td> | 223 | currency: cobranza.moneda.SIMBOLO"></td> |
226 | <td class="text-center col-auto"> | 224 | <td class="text-center col-auto"> |
227 | <button | 225 | <button |
228 | class="btn btn-outline-secondary" | 226 | class="btn btn-outline-secondary" |
229 | ng-click="quitarCobro(key)" | 227 | ng-click="quitarCobro(key)" |
230 | > | 228 | > |
231 | <i class="fa fa-trash"></i> | 229 | <i class="fa fa-trash"></i> |
232 | </button> | 230 | </button> |
233 | </td> | 231 | </td> |
234 | </tr> | 232 | </tr> |
235 | </tbody> | 233 | </tbody> |
236 | <tfoot> | 234 | <tfoot> |
237 | <tr ng-show="cargando" class="d-flex"> | 235 | <tr ng-show="cargando" class="d-flex"> |
238 | <td class="col-2"> | 236 | <td class="col-2"> |
239 | <a | 237 | <a |
240 | class="form-control form-control-sm btn btn-secondary" | 238 | class="form-control form-control-sm btn btn-secondary" |
241 | ng-click="seleccionarCheque()" | 239 | ng-click="seleccionarCheque()" |
242 | >Cheque</a> | 240 | >Cheque</a> |
243 | </td> | 241 | </td> |
244 | <td class="col-2"> | 242 | <td class="col-2"> |
245 | <a | 243 | <a |
246 | class="form-control form-control-sm btn btn-secondary" | 244 | class="form-control form-control-sm btn btn-secondary" |
247 | ng-click="seleccionarEfectivo()" | 245 | ng-click="seleccionarEfectivo()" |
248 | >Efectivo</a> | 246 | >Efectivo</a> |
249 | </td> | 247 | </td> |
250 | </tr> | 248 | </tr> |
251 | <tr class="d-flex"> | 249 | <tr class="d-flex"> |
252 | <td class="col-auto px-1"> | 250 | <td class="col-auto px-1"> |
253 | <strong>Cobros:</strong> | 251 | <strong>Cobros:</strong> |
254 | <a ng-bind="cobrosTabla.length"></a> | 252 | <a ng-bind="cobrosTabla.length"></a> |
255 | </td> | 253 | </td> |
256 | <td class="text-right ml-auto table-celda-total no-border-top"> | 254 | <td class="text-right ml-auto table-celda-total no-border-top"> |
257 | <strong>Total Deuda:</strong> | 255 | <strong>Total Deuda:</strong> |
258 | </td> | 256 | </td> |
259 | <td class="table-celda-total text-right no-border-top"> | 257 | <td class="table-celda-total text-right no-border-top"> |
260 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | | 258 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | |
261 | currency: cobranza.moneda.SIMBOLO}}</strong> | 259 | currency: cobranza.moneda.SIMBOLO}}</strong> |
262 | </td> | 260 | </td> |
263 | <td class="text-right ml-auto table-celda-total no-border-top"> | 261 | <td class="text-right ml-auto table-celda-total no-border-top"> |
264 | <strong>Total Cobrado:</strong> | 262 | <strong>Total Cobrado:</strong> |
265 | </td> | 263 | </td> |
266 | <td class="table-celda-total text-right no-border-top"> | 264 | <td class="table-celda-total text-right no-border-top"> |
267 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | | 265 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | |
268 | currency: cobranza.moneda.SIMBOLO}}</strong> | 266 | currency: cobranza.moneda.SIMBOLO}}</strong> |
269 | </td> | 267 | </td> |
270 | <td class="text-right ml-auto table-celda-total no-border-top"> | 268 | <td class="text-right ml-auto table-celda-total no-border-top"> |
271 | <strong>DF:</strong> | 269 | <strong>DF:</strong> |
272 | </td> | 270 | </td> |
273 | <td class="table-celda-total text-right no-border-top"> | 271 | <td class="table-celda-total text-right no-border-top"> |
274 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / | 272 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / |
275 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} | 273 | cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}} |
276 | </strong> | 274 | </strong> |
277 | </td> | 275 | </td> |
278 | </tr> | 276 | </tr> |
279 | </tfoot> | 277 | </tfoot> |
280 | </table> | 278 | </table> |
281 | </div> | 279 | </div> |
282 | <!-- MOBILE --> | 280 | <!-- MOBILE --> |
283 | <div class="row d-sm-none"> | 281 | <div class="row d-sm-none"> |
284 | <table class="table table-sm table-striped table-dark" ng-show="cobroDeuda"> | 282 | <table class="table table-sm table-striped table-dark" ng-show="cobroDeuda"> |
285 | <thead> | 283 | <thead> |
286 | <tr class="d-flex"> | 284 | <tr class="d-flex"> |
287 | <th class="">#</th> | 285 | <th class="">#</th> |
288 | <th class="col px-0"> | 286 | <th class="col px-0"> |
289 | <div class="d-flex"> | 287 | <div class="d-flex"> |
290 | <div class="col-4 px-1">Factura</div> | 288 | <div class="col-4 px-1">Factura</div> |
291 | <div class="col-4 px-1">Fecha</div> | 289 | <div class="col-4 px-1">Fecha</div> |
292 | <div class="col-4 px-1">Importe</div> | 290 | <div class="col-4 px-1">Importe</div> |
293 | </div> | 291 | </div> |
294 | </th> | 292 | </th> |
295 | <th class="text-center tamaño-boton"> | 293 | <th class="text-center tamaño-boton"> |
296 | | 294 | |
297 | </th> | 295 | </th> |
298 | </tr> | 296 | </tr> |
299 | </thead> | 297 | </thead> |
300 | <tbody> | 298 | <tbody> |
301 | <tr | 299 | <tr |
302 | ng-repeat="(key, factura) in facturaTabla" | 300 | ng-repeat="(key, factura) in facturaTabla" |
303 | ng-show="show || key == facturaTabla.length - 1" | 301 | ng-show="show || key == facturaTabla.length - 1" |
304 | > | 302 | > |
305 | <td class="w-100 align-middle d-flex p-0"> | 303 | <td class="w-100 align-middle d-flex p-0"> |
306 | <div class="align-middle p-1"> | 304 | <div class="align-middle p-1"> |
307 | <span ng-bind="key+1" class="align-middle"></span> | 305 | <span ng-bind="key+1" class="align-middle"></span> |
308 | </div> | 306 | </div> |
309 | <div class="col px-0"> | 307 | <div class="col px-0"> |
310 | <div class="d-flex"> | 308 | <div class="d-flex"> |
311 | <div class="col-4 px-1"> | 309 | <div class="col-4 px-1"> |
312 | <span ng-bind= | 310 | <span ng-bind= |
313 | "(factura.TCO + '-' + factura.TIP + '-' + | 311 | "(factura.TCO + '-' + factura.TIP + '-' + |
314 | factura.SUC + '-' + factura.NCO)" | 312 | factura.SUC + '-' + factura.NCO)" |
315 | ></span> | 313 | ></span> |
316 | </div> | 314 | </div> |
317 | <div class="col-4 px-1"> | 315 | <div class="col-4 px-1"> |
318 | <span ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></span> | 316 | <span ng-bind="factura.FEP | date : 'dd/MM/yyyy'"></span> |
319 | </div> | 317 | </div> |
320 | <div class="col-4 px-1"> | 318 | <div class="col-4 px-1"> |
321 | <span | 319 | <span |
322 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | | 320 | ng-bind="(factura.IPA / cobranza.cotizacion.VENDEDOR) | |
323 | currency:cobranza.moneda.SIMBOLO"></span> | 321 | currency:cobranza.moneda.SIMBOLO"></span> |
324 | </div> | 322 | </div> |
325 | </div> | 323 | </div> |
326 | </div> | 324 | </div> |
327 | <div class="align-middle p-1"> | 325 | <div class="align-middle p-1"> |
328 | <button | 326 | <button |
329 | class="btn btn-outline-secondary" | 327 | class="btn btn-outline-secondary" |
330 | ng-click="quitarFactura(key)" | 328 | ng-click="quitarFactura(key)" |
331 | > | 329 | > |
332 | <i class="fa fa-trash"></i> | 330 | <i class="fa fa-trash"></i> |
333 | </button> | 331 | </button> |
334 | </div> | 332 | </div> |
335 | </td> | 333 | </td> |
336 | </tr> | 334 | </tr> |
337 | </tbody> | 335 | </tbody> |
338 | <tfoot> | 336 | <tfoot> |
339 | <!-- SELECCIONAR PRODUCTO --> | 337 | <!-- SELECCIONAR PRODUCTO --> |
340 | <tr ng-show="cargando" class="d-flex"> | 338 | <tr ng-show="cargando" class="d-flex"> |
341 | <td class="col-12"> | 339 | <td class="col-12"> |
342 | <input | 340 | <input |
343 | placeholder="Seleccione Factura" | 341 | placeholder="Seleccione Factura" |
344 | class="form-control form-control-sm" | 342 | class="form-control form-control-sm" |
345 | readonly | 343 | readonly |
346 | ng-click="seleccionarFactura()" | 344 | ng-click="seleccionarFactura()" |
347 | /> | 345 | /> |
348 | </td> | 346 | </td> |
349 | </tr> | 347 | </tr> |
350 | <!-- TOOGLE EXPANDIR --> | 348 | <!-- TOOGLE EXPANDIR --> |
351 | <tr> | 349 | <tr> |
352 | <td class="col"> | 350 | <td class="col"> |
353 | <button | 351 | <button |
354 | class="btn btn-outline-secondary selectable w-100" | 352 | class="btn btn-outline-secondary selectable w-100" |
355 | ng-click="show = !show; masMenos()" | 353 | ng-click="show = !show; masMenos()" |
356 | ng-show="facturaTabla.length > 0" | 354 | ng-show="facturaTabla.length > 0" |
357 | > | 355 | > |
358 | <i | 356 | <i |
359 | class="fa fa-chevron-down" | 357 | class="fa fa-chevron-down" |
360 | ng-hide="show" | 358 | ng-hide="show" |
361 | aria-hidden="true" | 359 | aria-hidden="true" |
362 | > | 360 | > |
363 | </i> | 361 | </i> |
364 | <i | 362 | <i |
365 | class="fa fa-chevron-up" | 363 | class="fa fa-chevron-up" |
366 | ng-show="show" | 364 | ng-show="show" |
367 | aria-hidden="true"> | 365 | aria-hidden="true"> |
368 | </i> | 366 | </i> |
369 | </button> | 367 | </button> |
370 | </td> | 368 | </td> |
371 | </tr> | 369 | </tr> |
372 | <!-- FOOTER --> | 370 | <!-- FOOTER --> |
373 | <tr class="d-flex"> | 371 | <tr class="d-flex"> |
374 | <td class="align-middle no-border-top" colspan="2"> | 372 | <td class="align-middle no-border-top" colspan="2"> |
375 | <strong>Cantidad Items:</strong> | 373 | <strong>Cantidad Items:</strong> |
376 | <a ng-bind="facturaTabla.length"></a> | 374 | <a ng-bind="facturaTabla.length"></a> |
377 | </td> | 375 | </td> |
378 | </tr> | 376 | </tr> |
379 | </tfoot> | 377 | </tfoot> |
380 | </table> | 378 | </table> |
381 | <table class="table table-sm table-striped table-dark" ng-show="!cobroDeuda"> | 379 | <table class="table table-sm table-striped table-dark" ng-show="!cobroDeuda"> |
382 | <thead> | 380 | <thead> |
383 | <tr class="d-flex"> | 381 | <tr class="d-flex"> |
384 | <th class="">#</th> | 382 | <th class="">#</th> |
385 | <th class="col px-0"> | 383 | <th class="col px-0"> |
386 | <div class="d-flex"> | 384 | <div class="d-flex"> |
387 | <div class="col-4 px-1">Cobro</div> | 385 | <div class="col-4 px-1">Cobro</div> |
388 | <div class="col-4 px-1">Fecha</div> | 386 | <div class="col-4 px-1">Fecha</div> |
389 | <div class="col-4 px-1">Importe</div> | 387 | <div class="col-4 px-1">Importe</div> |
390 | </div> | 388 | </div> |
391 | </th> | 389 | </th> |
392 | <th class="text-center tamaño-boton"> | 390 | <th class="text-center tamaño-boton"> |
393 | | 391 | |
394 | </th> | 392 | </th> |
395 | </tr> | 393 | </tr> |
396 | </thead> | 394 | </thead> |
397 | <tbody> | 395 | <tbody> |
398 | <tr | 396 | <tr |
399 | ng-repeat="(key, cobro) in cobrosTabla" | 397 | ng-repeat="(key, cobro) in cobrosTabla" |
400 | ng-show="show || key == cobrosTabla.length - 1" | 398 | ng-show="show || key == cobrosTabla.length - 1" |
401 | > | 399 | > |
402 | <td class="w-100 align-middle d-flex p-0"> | 400 | <td class="w-100 align-middle d-flex p-0"> |
403 | <div class="align-middle p-1"> | 401 | <div class="align-middle p-1"> |
404 | <span ng-bind="key+1" class="align-middle"></span> | 402 | <span ng-bind="key+1" class="align-middle"></span> |
405 | </div> | 403 | </div> |
406 | <div class="col px-0"> | 404 | <div class="col px-0"> |
407 | <div class="d-flex"> | 405 | <div class="d-flex"> |
408 | <div class="col-4 px-1"> | 406 | <div class="col-4 px-1"> |
409 | <span ng-bind="cobro.tipo" | 407 | <span ng-bind="cobro.tipo" |
410 | ></span> | 408 | ></span> |
411 | </div> | 409 | </div> |
412 | <div class="col-4 px-1"> | 410 | <div class="col-4 px-1"> |
413 | <span ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></span> | 411 | <span ng-bind="cobro.fecha | date : 'dd/MM/yyyy'"></span> |
414 | </div> | 412 | </div> |
415 | <div class="col-4 px-1"> | 413 | <div class="col-4 px-1"> |
416 | <span | 414 | <span |
417 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | | 415 | ng-bind="(cobro.importe / cobranza.cotizacion.VENDEDOR) | |
418 | currency: cobranza.moneda.SIMBOLO"></span> | 416 | currency: cobranza.moneda.SIMBOLO"></span> |
419 | </div> | 417 | </div> |
420 | </div> | 418 | </div> |
421 | </div> | 419 | </div> |
422 | <div class="align-middle p-1"> | 420 | <div class="align-middle p-1"> |
423 | <button | 421 | <button |
424 | class="btn btn-outline-secondary" | 422 | class="btn btn-outline-secondary" |
425 | ng-click="quitarCobro(key)" | 423 | ng-click="quitarCobro(key)" |
426 | > | 424 | > |
427 | <i class="fa fa-trash"></i> | 425 | <i class="fa fa-trash"></i> |
428 | </button> | 426 | </button> |
429 | </div> | 427 | </div> |
430 | </td> | 428 | </td> |
431 | </tr> | 429 | </tr> |
432 | </tbody> | 430 | </tbody> |
433 | <tfoot> | 431 | <tfoot> |
434 | <!-- SELECCIONAR PRODUCTO --> | 432 | <!-- SELECCIONAR PRODUCTO --> |
435 | <tr ng-show="cargando" class="d-flex"> | 433 | <tr ng-show="cargando" class="d-flex"> |
436 | <td class="col-6"> | 434 | <td class="col-6"> |
437 | <input | 435 | <input |
438 | placeholder="Cheque" | 436 | placeholder="Cheque" |
439 | class="form-control form-control-sm" | 437 | class="form-control form-control-sm" |
440 | readonly | 438 | readonly |
441 | ng-click="seleccionarCheque()" | 439 | ng-click="seleccionarCheque()" |
442 | /> | 440 | /> |
443 | </td> | 441 | </td> |
444 | <td class="col-6"> | 442 | <td class="col-6"> |
445 | <input | 443 | <input |
446 | placeholder="Efectivo" | 444 | placeholder="Efectivo" |
447 | class="form-control form-control-sm" | 445 | class="form-control form-control-sm" |
448 | readonly | 446 | readonly |
449 | ng-click="seleccionarEfectivo()" | 447 | ng-click="seleccionarEfectivo()" |
450 | /> | 448 | /> |
451 | </td> | 449 | </td> |
452 | </tr> | 450 | </tr> |
453 | <!-- TOOGLE EXPANDIR --> | 451 | <!-- TOOGLE EXPANDIR --> |
454 | <tr> | 452 | <tr> |
455 | <td class="col"> | 453 | <td class="col"> |
456 | <button | 454 | <button |
457 | class="btn btn-outline-secondary selectable w-100" | 455 | class="btn btn-outline-secondary selectable w-100" |
458 | ng-click="show = !show; masMenos()" | 456 | ng-click="show = !show; masMenos()" |
459 | ng-show="cobrosTabla.length > 0" | 457 | ng-show="cobrosTabla.length > 0" |
460 | > | 458 | > |
461 | <i | 459 | <i |
462 | class="fa fa-chevron-down" | 460 | class="fa fa-chevron-down" |
463 | ng-hide="show" | 461 | ng-hide="show" |
464 | aria-hidden="true" | 462 | aria-hidden="true" |
465 | > | 463 | > |
466 | </i> | 464 | </i> |
467 | <i | 465 | <i |
468 | class="fa fa-chevron-up" | 466 | class="fa fa-chevron-up" |
469 | ng-show="show" | 467 | ng-show="show" |
470 | aria-hidden="true"> | 468 | aria-hidden="true"> |
471 | </i> | 469 | </i> |
472 | </button> | 470 | </button> |
473 | </td> | 471 | </td> |
474 | </tr> | 472 | </tr> |
475 | <!-- FOOTER --> | 473 | <!-- FOOTER --> |
476 | <tr class="d-flex"> | 474 | <tr class="d-flex"> |
477 | <td class="align-middle no-border-top col-6"> | 475 | <td class="align-middle no-border-top col-6"> |
478 | <strong>Cantidad Items:</strong> | 476 | <strong>Cantidad Items:</strong> |
479 | <a ng-bind="cobrosTabla.length"></a> | 477 | <a ng-bind="cobrosTabla.length"></a> |
480 | </td> | 478 | </td> |
481 | </tfoot> | 479 | </tfoot> |
482 | </table> | 480 | </table> |
483 | </tr> | 481 | </tr> |
484 | <table class="table-responsive"> | 482 | <table class="table-responsive"> |
485 | <tr class="d-flex row"> | 483 | <tr class="d-flex row"> |
486 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 484 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
487 | <strong>Deuda:</strong> | 485 | <strong>Deuda:</strong> |
488 | </td> | 486 | </td> |
489 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 487 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
490 | <strong>Cobrado:</strong> | 488 | <strong>Cobrado:</strong> |
491 | </td> | 489 | </td> |
492 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> | 490 | <td class="text-center ml-auto table-celda-total no-border-top col-4"> |
493 | <strong>Diferencia:</strong> | 491 | <strong>Diferencia:</strong> |
494 | </td> | 492 | </td> |
495 | <td class="table-celda-total text-center no-border-top col-4"> | 493 | <td class="table-celda-total text-center no-border-top col-4"> |
496 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 494 | <strong>{{(getTotalDeuda() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
497 | </td> | 495 | </td> |
498 | <td class="table-celda-total text-center no-border-top col-4"> | 496 | <td class="table-celda-total text-center no-border-top col-4"> |
499 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 497 | <strong>{{(getTotalCobrado() / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
500 | </td> | 498 | </td> |
501 | <td class="table-celda-total text-center no-border-top col-4"> | 499 | <td class="table-celda-total text-center no-border-top col-4"> |
502 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> | 500 | <strong>{{((getTotalCobrado() - getTotalDeuda()) / cobranza.cotizacion.VENDEDOR) | currency: cobranza.moneda.SIMBOLO}}</strong> |
503 | </td> | 501 | </td> |
504 | </tr> | 502 | </tr> |
505 | </table> | 503 | </table> |
506 | </div> | 504 | </div> |
507 | </div> | 505 | </div> |
508 | <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block"> | 506 | <div class="col-auto my-2 col-lg-2 botonera-lateral d-none d-md-block"> |
509 | <div class="row align-items-end"> | 507 | <div class="row align-items-end"> |
510 | <div class="col-12"> | 508 | <div class="col-12"> |
511 | <button | 509 | <button |
512 | ng-click="crearHojaRuta()" | 510 | ng-click="crearHojaRuta()" |
513 | type="submit" | 511 | type="submit" |
514 | title="Crear nota pedido" | 512 | title="Crear nota pedido" |
515 | class="btn btn-default btn-block mb-2"> | 513 | class="btn btn-default btn-block mb-2"> |
516 | Guardar | 514 | Guardar |
517 | </button> | 515 | </button> |
518 | <button | 516 | <button |
519 | ng-click="salir()" | 517 | ng-click="salir()" |
520 | type="button" | 518 | type="button" |
521 | title="Salir" | 519 | title="Salir" |
522 | class="btn btn-default btn-block"> | 520 | class="btn btn-default btn-block"> |
523 | Salir | 521 | Salir |
524 | </button> | 522 | </button> |
525 | </div> | 523 | </div> |
526 | </div> | 524 | </div> |
527 | </div> | 525 | </div> |
528 | </div> | 526 | </div> |
529 | <div class="row d-md-none fixed-bottom"> | 527 | <div class="row d-md-none fixed-bottom"> |
530 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> | 528 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> |
531 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> | 529 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> |
532 | <span class="mr-3 ml-auto" ng-click="crearHojaRuta()">Guardar</span> | 530 | <span class="mr-3 ml-auto" ng-click="crearHojaRuta()">Guardar</span> |
533 | </div> | 531 | </div> |
534 | </div> | 532 | </div> |
535 | </div> | 533 | </div> |
536 | 534 |