Compare View
Commits (111)
-
Master(efernandez) See merge request !2
-
Master(mpuebla) See merge request !3
-
Master(efernandez) See merge request !4
-
Master(efernandez) See merge request !5
-
Master(mpuebla) See merge request !6
-
Master(efernandez) See merge request !7
-
Master(mpuebla) See merge request !8
-
Master(mpuebla) See merge request !9
-
Master(efernandez) See merge request !10
-
Master(efernandez) See merge request !11
-
Master(efernandez) See merge request !12
-
Master(mpuebla) See merge request !13
-
Master(efernandez) See merge request !14
-
Master See merge request !15
-
Master(efernandez) See merge request !16
-
Master(mpuebla) See merge request !17
-
Master(mpuebla) See merge request !18
-
Master(efernandez) See merge request !19
-
Master(efernandez) See merge request !20
-
Master See merge request !21
-
Master(mpuebla) See merge request !22
-
Master(efernandez) See merge request !23
-
Master(efernandez) See merge request !24
-
Master(efernandez) See merge request !25
-
Master(efernandez) See merge request !26
-
Master(mpuebla) See merge request !27
-
Master(mpuebla) See merge request !28
-
Master(efernandez) See merge request !29
-
Master(efernandez) See merge request !30
-
Master(efernandez) See merge request !31
-
Master(mpuebla) See merge request !32
-
Master(mpuebla) See merge request !33
-
Master(efernandez) See merge request !34
-
Master(mpuebla) See merge request !35
-
Master(efernandez) See merge request !36
-
Master(mpuebla) See merge request !37
-
Master(mpuebla) See merge request !38
-
Master(efernandez) See merge request !39
-
Master(efernandez) See merge request !40
Showing
11 changed files
Show diff stats
package.json
... | ... | @@ -4,9 +4,15 @@ |
4 | 4 | "description": "", |
5 | 5 | "main": "index.js", |
6 | 6 | "scripts": { |
7 | + "frefresh": "gulp uglify && cp tmp/foca-crear-factura.js ../wrapper-facturador/node_modules/foca-crear-factura/dist/foca-crear-factura.min.js", | |
8 | + "refresh": "gulp uglify && cp tmp/foca-crear-factura.js ../wrapper-demo/node_modules/foca-crear-factura/dist/foca-crear-factura.min.js", | |
7 | 9 | "test": "echo \"Error: no test specified\" && exit 1", |
10 | + "compile": "gulp uglify", | |
11 | + "gulp-pre-commit": "gulp pre-commit", | |
12 | + "postinstall": "npm run compile && gulp clean-post-install", | |
8 | 13 | "install-dev": "npm install -D jasmine-core pre-commit angular angular-ladda ladda@1.0.6 angular-route angular-cookies bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump" |
9 | 14 | }, |
15 | + "pre-commit": "gulp-pre-commit", | |
10 | 16 | "repository": { |
11 | 17 | "type": "git", |
12 | 18 | "url": "http://git.focasoftware.com/npm/foca-crear-factura.git" |
src/js/controller.js
1 | 1 | angular.module('focaCrearFactura').controller('facturaController', [ |
2 | 2 | '$scope', '$uibModal', '$location', '$filter', 'crearFacturaService', '$timeout', |
3 | 3 | 'focaModalService', 'crearRemitoService', '$rootScope', 'focaBotoneraLateralService', |
4 | - '$localStorage', | |
4 | + '$localStorage', 'APP', 'focaLoginService', | |
5 | 5 | function ( |
6 | 6 | $scope, $uibModal, $location, $filter, crearFacturaService, $timeout, focaModalService, |
7 | - crearRemitoService, $rootScope, focaBotoneraLateralService, $localStorage) { | |
7 | + crearRemitoService, $rootScope, focaBotoneraLateralService, $localStorage, APP, loginServ) { | |
8 | 8 | |
9 | 9 | config(); |
10 | 10 | |
11 | 11 | function config() { |
12 | - $scope.tmpCantidad = Number; | |
13 | - $scope.tmpPrecio = Number; | |
12 | + $scope.tmpCantidad = '0'; | |
14 | 13 | $scope.botonera = crearFacturaService.getBotonera(); |
14 | + $scope.botoneraProductos = []; | |
15 | 15 | $scope.isNumber = angular.isNumber; |
16 | 16 | $scope.datepickerAbierto = false; |
17 | 17 | $scope.show = false; |
... | ... | @@ -47,8 +47,8 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
47 | 47 | $timeout(function () { |
48 | 48 | focaBotoneraLateralService.showSalir(false); |
49 | 49 | focaBotoneraLateralService.showPausar(true); |
50 | - focaBotoneraLateralService.showGuardar(true, $scope.crearFactura); | |
51 | - focaBotoneraLateralService.addCustomButton('Salir', salir); | |
50 | + focaBotoneraLateralService.showGuardar(true, $scope.seleccionarFormaDePago); | |
51 | + focaBotoneraLateralService.addCustomButton('Salir', $scope.salir); | |
52 | 52 | }); |
53 | 53 | |
54 | 54 | init(); |
... | ... | @@ -67,25 +67,50 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
67 | 67 | proveedor: {}, |
68 | 68 | domicilio: { dom: '' }, |
69 | 69 | moneda: {}, |
70 | + formaPago: 1, // Por defecto paga contado | |
70 | 71 | cotizacion: $scope.cotizacionPorDefecto || {}, |
71 | - articulosFactura: [] | |
72 | + articulosFactura: [], | |
73 | + despachos: [] | |
72 | 74 | }; |
73 | 75 | |
74 | 76 | $scope.factura.articulosFactura = []; |
75 | 77 | $scope.idLista = undefined; |
76 | 78 | |
77 | - crearRemitoService.getNumeroRemito().then( | |
78 | - function (res) { | |
79 | - $scope.puntoVenta = rellenar(res.data.sucursal, 4); | |
80 | - $scope.comprobante = rellenar(res.data.numeroRemito, 8); | |
81 | - }, | |
82 | - function (err) { | |
83 | - focaModalService.alert('La terminal no esta configurada correctamente'); | |
84 | - console.info(err); | |
85 | - } | |
86 | - ); | |
87 | - | |
88 | 79 | $scope.inicial = angular.copy($scope.factura); |
80 | + | |
81 | + getNumeroFactura('B'); | |
82 | + | |
83 | + if (APP === 'facturador') { | |
84 | + crearFacturaService | |
85 | + .getVendedorPlayaById(loginServ.getLoginData().vendedorPlaya) | |
86 | + .then(function (res) { | |
87 | + | |
88 | + validarPlanillaVendedor(res.data) | |
89 | + .then(function () { | |
90 | + | |
91 | + $scope.$broadcast('addCabecera', { | |
92 | + label: 'Vendedor:', | |
93 | + valor: $filter('rellenarDigitos')(res.data.CodVen, 3) + | |
94 | + ' - ' + | |
95 | + res.data.NomVen | |
96 | + }); | |
97 | + $scope.$broadcast('addCabecera', { | |
98 | + label: 'Planilla:', | |
99 | + valor: res.data.NplVen | |
100 | + }); | |
101 | + | |
102 | + $scope.factura.vendedor = res.data; | |
103 | + $scope.inicial.vendedor = res.data; | |
104 | + | |
105 | + getProductosByPlanilla(res.data.NplVen); | |
106 | + }) | |
107 | + .catch(function (err) { | |
108 | + console.log(err); | |
109 | + focaModalService.alert('Ocurrió un error al intentar recuperar' + | |
110 | + 'el vendedor logeado'); | |
111 | + }); | |
112 | + }); | |
113 | + } | |
89 | 114 | } |
90 | 115 | |
91 | 116 | $scope.$watch('factura', function (newValue) { |
... | ... | @@ -95,17 +120,52 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
95 | 120 | }); |
96 | 121 | }, true); |
97 | 122 | |
98 | - $scope.crearFactura = function () { | |
123 | + $scope.seleccionarFormaDePago = function () { | |
99 | 124 | |
100 | 125 | if (!validarGuardar()) return; |
101 | 126 | |
127 | + if ($scope.factura.formaPago === 2) { | |
128 | + $scope.crearFactura(); | |
129 | + return; | |
130 | + } | |
131 | + | |
132 | + var modalInstance = $uibModal.open( | |
133 | + { | |
134 | + templateUrl: 'modal-forma-pago.html', | |
135 | + controller: 'focaModalFormaPagoController', | |
136 | + resolve: { | |
137 | + parametros: function () { | |
138 | + return { | |
139 | + importe: $scope.getTotal() | |
140 | + }; | |
141 | + }, | |
142 | + }, | |
143 | + size: 'lg', | |
144 | + } | |
145 | + ); | |
146 | + modalInstance.result | |
147 | + .then(function (data) { | |
148 | + | |
149 | + if (data.tipo === 'tarjeta') { | |
150 | + $scope.factura.formaPago = 4; | |
151 | + } else { | |
152 | + $scope.factura.formaPago = 1; | |
153 | + } | |
154 | + | |
155 | + $scope.crearFactura(data); | |
156 | + }) | |
157 | + .catch(function (e) { console.error(e); }); | |
158 | + }; | |
159 | + | |
160 | + $scope.crearFactura = function (formaPago) { | |
161 | + | |
102 | 162 | var save = { |
103 | 163 | factura: { |
104 | 164 | |
105 | 165 | BONIF: 0, |
106 | - CLI: $scope.factura.cliente.cod, | |
107 | - CUI: $scope.factura.cliente.cuit, | |
108 | - CTA: $scope.factura.cliente.cod, | |
166 | + CLI: $scope.factura.cliente.COD, | |
167 | + CUI: $scope.factura.cliente.CUIT, | |
168 | + CTA: $scope.factura.cliente.COD, | |
109 | 169 | DC1: '', |
110 | 170 | DC2: '', |
111 | 171 | DE1: '', |
... | ... | @@ -114,24 +174,24 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
114 | 174 | DTO: 0, |
115 | 175 | FEC: $filter('date')($scope.now, 'yyyy-MM-dd HH:mm:ss'), |
116 | 176 | FEC_ANT: '19000101', |
117 | - FPA: 2, | |
177 | + FPA: $scope.factura.formaPago, | |
118 | 178 | IDEXCEPCION: 0, |
119 | - IDLP: $scope.factura.cliente.mod.trim() || 0, | |
179 | + IDLP: $scope.factura.cliente.MOD.trim() || 0, | |
120 | 180 | IDPERSONERIA: 0, |
121 | - IMI: 0, // TODO | |
122 | - IMI2: 0, // TODO | |
123 | - IMI3: 0, // TODO | |
181 | + IMI: getImporte('IMI'), | |
182 | + IMI2: getImporte('IMI2'), | |
183 | + IMI3: getImporte('IMI3'), | |
124 | 184 | IMP_LEY: 0, |
125 | - IRI: 0, // TODO | |
185 | + IRI: getImporte('IVA'), | |
126 | 186 | IRS: 0, |
127 | 187 | LEG: '', |
128 | 188 | LUG: $scope.factura.vendedor.LugVen, |
129 | 189 | MK_M: 0, |
130 | - NEE: 0, // TODO | |
131 | - NET: 0, // TODO | |
190 | + NEE: getImporte('NEX'), | |
191 | + NET: getImporte('NET'), | |
132 | 192 | NFI: '', |
133 | 193 | NNP: 0, |
134 | - NOM: $scope.factura.cliente.nom, | |
194 | + NOM: $scope.factura.cliente.NOM, | |
135 | 195 | OPE: $scope.factura.vendedor.CodVen, |
136 | 196 | PAG: $scope.getTotal(), |
137 | 197 | PER: 0, |
... | ... | @@ -143,19 +203,21 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
143 | 203 | TCA: 1, |
144 | 204 | TCO: 'FT', |
145 | 205 | TFI: '', |
146 | - TIP: $scope.factura.cliente.tipoFactura, | |
147 | - TIV: 0, // TODO | |
206 | + TIP: $scope.factura.cliente.TIP, | |
207 | + TIV: $scope.factura.cliente.IVA, | |
148 | 208 | TOT: $scope.getTotal(), |
149 | - TUR: 0, // TODO | |
209 | + TUR: $scope.factura.vendedor.TurVen, | |
150 | 210 | VEN: $scope.factura.vendedor.CodVen, |
151 | 211 | VTO_CLI: '', |
152 | - ZON: 1, // TODO | |
212 | + ZON: 1, // TODO: ZON DE APAREMP | |
153 | 213 | OBSERVACIONES: $scope.factura.observaciones |
154 | 214 | }, |
155 | - cuerpo: $scope.articulosFiltro() | |
215 | + cuerpo: $scope.articulosFiltro(), | |
216 | + despachos: $scope.factura.despachos, | |
217 | + formaPago: formaPago | |
156 | 218 | }; |
157 | 219 | |
158 | - crearFacturaService.guardarFactura(save).then(function(res) { | |
220 | + crearFacturaService.guardarFactura(save).then(function () { | |
159 | 221 | |
160 | 222 | focaBotoneraLateralService.endGuardar(true); |
161 | 223 | |
... | ... | @@ -163,9 +225,9 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
163 | 225 | |
164 | 226 | config(); |
165 | 227 | |
166 | - }).catch(function(err) { | |
228 | + }).catch(function (err) { | |
167 | 229 | focaModalService.alert('Hubo un error al guardar la factura'); |
168 | - console.log(err); | |
230 | + console.error(err); | |
169 | 231 | }); |
170 | 232 | |
171 | 233 | }; |
... | ... | @@ -178,22 +240,56 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
178 | 240 | templateUrl: 'foca-busqueda-cliente-modal.html', |
179 | 241 | controller: 'focaBusquedaClienteModalController', |
180 | 242 | resolve: { |
181 | - vendedor: function () { return null; }, | |
182 | - cobrador: function () { return null; } | |
243 | + parametros: function () { | |
244 | + return { | |
245 | + vendedor: function () { return null; }, | |
246 | + cobrador: function () { return null; } | |
247 | + }; | |
248 | + } | |
183 | 249 | }, |
184 | 250 | size: 'lg' |
185 | 251 | } |
186 | 252 | ); |
187 | 253 | modalInstance.result.then( |
188 | 254 | function (cliente) { |
189 | - $scope.factura.cliente = cliente; | |
255 | + var modalInstance = $uibModal.open( | |
256 | + { | |
257 | + templateUrl: 'modal-estado-cuenta.html', | |
258 | + controller: 'focaModalEstadoCuentaController', | |
259 | + size: 'lg', | |
260 | + resolve: { | |
261 | + parametros: function () { | |
262 | + return { | |
263 | + idCliente: cliente.COD, | |
264 | + nombreCliente: cliente.NOM | |
265 | + }; | |
266 | + }, | |
267 | + } | |
268 | + } | |
269 | + ); | |
270 | + modalInstance.result | |
271 | + .then(function (data) { | |
190 | 272 | |
191 | - $scope.$broadcast('addCabecera', { | |
192 | - label: 'Cliente:', | |
193 | - valor: $filter('rellenarDigitos')(cliente.cod, 3) + ' - ' + cliente.nom | |
194 | - }); | |
273 | + $scope.factura.formaPago = data.formaDePago; | |
274 | + $scope.factura.cliente = cliente; | |
275 | + | |
276 | + getNumeroFactura(cliente.TIP); | |
277 | + | |
278 | + $scope.$broadcast('addCabecera', { | |
279 | + label: 'Cliente:', | |
280 | + valor: $filter('rellenarDigitos')(cliente.COD, 3) + | |
281 | + ' - ' + cliente.NOM | |
282 | + }); | |
195 | 283 | |
196 | - $filter('filter')($scope.botonera, { label: 'Cliente' })[0].checked = true; | |
284 | + $filter('filter')($scope.botonera, | |
285 | + { label: 'Cliente' })[0].checked = true; | |
286 | + | |
287 | + $scope.$broadcast('addCabecera', { | |
288 | + label: 'Forma de pago: ', | |
289 | + valor: data.tipo | |
290 | + }); | |
291 | + }) | |
292 | + .catch($scope.seleccionarCliente); | |
197 | 293 | |
198 | 294 | }, function () { |
199 | 295 | } |
... | ... | @@ -201,7 +297,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
201 | 297 | |
202 | 298 | }; |
203 | 299 | |
204 | - $scope.seleccionarVendedor = function() { | |
300 | + $scope.seleccionarVendedor = function () { | |
205 | 301 | var parametrosModal = { |
206 | 302 | titulo: 'Búsqueda vendedores', |
207 | 303 | query: '/vendedor-playa', |
... | ... | @@ -225,9 +321,9 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
225 | 321 | function (vendedor) { |
226 | 322 | |
227 | 323 | indicarPassword(vendedor) |
228 | - .then(function() { | |
324 | + .then(function () { | |
229 | 325 | validarPlanillaVendedor(vendedor) |
230 | - .then(function() { | |
326 | + .then(function () { | |
231 | 327 | |
232 | 328 | $filter('filter')($scope.botonera, { |
233 | 329 | label: 'Vendedor' |
... | ... | @@ -236,8 +332,12 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
236 | 332 | $scope.$broadcast('addCabecera', { |
237 | 333 | label: 'Vendedor:', |
238 | 334 | valor: $filter('rellenarDigitos')(vendedor.CodVen, 3) + |
239 | - ' - ' + | |
240 | - vendedor.NomVen | |
335 | + ' - ' + | |
336 | + vendedor.NomVen | |
337 | + }); | |
338 | + $scope.$broadcast('addCabecera', { | |
339 | + label: 'Planilla:', | |
340 | + valor: vendedor.NplVen | |
241 | 341 | }); |
242 | 342 | |
243 | 343 | $scope.factura.vendedor = vendedor; |
... | ... | @@ -246,8 +346,8 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
246 | 346 | }) |
247 | 347 | .catch($scope.seleccionarVendedor); |
248 | 348 | }) |
249 | - .catch(function(err) { | |
250 | - console.log(err) | |
349 | + .catch(function (err) { | |
350 | + console.error(err); | |
251 | 351 | }); |
252 | 352 | |
253 | 353 | }, function () { } |
... | ... | @@ -282,7 +382,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
282 | 382 | crearRemitoService.getCotizacionByIdMoneda(1) |
283 | 383 | .then(function (res) { |
284 | 384 | |
285 | - cotizacionPArgentino = res.data[0].cotizaciones[0]; | |
385 | + var cotizacionPArgentino = res.data[0].cotizaciones[0]; | |
286 | 386 | cotizacionPArgentino.moneda = moneda; |
287 | 387 | |
288 | 388 | actualizarCabeceraMoneda(cotizacionPArgentino); |
... | ... | @@ -333,9 +433,10 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
333 | 433 | }); |
334 | 434 | }; |
335 | 435 | |
336 | - | |
337 | 436 | $scope.articulosFiltro = function () { |
338 | - return $scope.factura.articulosFactura; | |
437 | + return $scope.factura.articulosFactura.filter(function (articulo) { | |
438 | + return !articulo.desactivado; | |
439 | + }); | |
339 | 440 | }; |
340 | 441 | |
341 | 442 | $scope.getTotal = function () { |
... | ... | @@ -349,61 +450,263 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
349 | 450 | return parseFloat(total.toFixed(2)); |
350 | 451 | }; |
351 | 452 | |
453 | + $scope.quitarDespacho = function (articulo, index) { | |
454 | + | |
455 | + if (articulo.SUR === 0) { | |
456 | + articulo.desactivado = true; | |
457 | + return; | |
458 | + } | |
459 | + | |
460 | + crearFacturaService | |
461 | + .setearDespachoDesocupado({ | |
462 | + surtidor: $scope.factura.despachos[index].SUR, | |
463 | + producto: $scope.factura.despachos[index].PRO, | |
464 | + carga: $scope.factura.despachos[index].CAR, | |
465 | + planilla: $scope.factura.despachos[index].PLA | |
466 | + }) | |
467 | + .then(function () { | |
468 | + articulo.desactivado = true; | |
469 | + $scope.factura.despachos.splice(index, 1); | |
470 | + }) | |
471 | + .catch(function () { | |
472 | + focaModalService.alert('Hubo un error al desasociar este despacho'); | |
473 | + }); | |
474 | + }; | |
475 | + | |
476 | + //Recibe aviso si el teclado está en uso | |
477 | + $rootScope.$on('usarTeclado', function (event, data) { | |
478 | + if (data) { | |
479 | + $scope.mostrarTeclado = true; | |
480 | + return; | |
481 | + } | |
482 | + $scope.mostrarTeclado = false; | |
483 | + }); | |
484 | + | |
485 | + $scope.selectFocus = function ($event) { | |
486 | + // Si el teclado esta en uso no selecciona el valor | |
487 | + if ($scope.mostrarTeclado) { | |
488 | + return; | |
489 | + } | |
490 | + $event.target.select(); | |
491 | + }; | |
492 | + | |
493 | + | |
352 | 494 | function getProductosByPlanilla(numeroPlanilla) { |
353 | 495 | |
354 | - crearFacturaService.getProductosByPlanilla(numeroPlanilla).then(function(res) { | |
496 | + crearFacturaService.getProductosByPlanilla(numeroPlanilla).then(function (res) { | |
355 | 497 | |
356 | - res.data.forEach(function (producto) { | |
498 | + if (!res.data.length) { | |
357 | 499 | |
358 | - $scope.botonera.push({ | |
500 | + focaModalService.alert('No hay despachos disponibles por el momento'); | |
501 | + return; | |
502 | + } | |
503 | + | |
504 | + $scope.botoneraProductos.length = 0; | |
505 | + $scope.topDespachos = res.data[0][0].CID; | |
506 | + | |
507 | + res.data.slice(1, res.data.length).forEach(function (producto) { | |
508 | + | |
509 | + $scope.botoneraProductos.push({ | |
359 | 510 | label: producto.DetArt, |
360 | - image: 'productos.png' | |
511 | + image: producto.nombreImagen, | |
512 | + imageDefault: 'productoDefault.png' | |
361 | 513 | }); |
362 | 514 | |
363 | - | |
364 | 515 | crearFuncionesProductos(producto); |
516 | + }); | |
365 | 517 | |
518 | + $scope.botonera.push({ | |
519 | + label: 'Ultimos despachos', | |
520 | + image: 'ultimos-despachos.png', | |
521 | + imageDefault: 'productoDefault.png' | |
366 | 522 | }); |
367 | 523 | }); |
368 | 524 | } |
369 | 525 | |
526 | + $scope.seleccionarBusquedaProductos = function () { | |
527 | + | |
528 | + if (angular.equals({}, $scope.factura.vendedor)) { | |
529 | + | |
530 | + focaModalService.alert('Seleccione Vendedor'); | |
531 | + return false; | |
532 | + } | |
533 | + | |
534 | + var modalInstance = $uibModal.open( | |
535 | + { | |
536 | + ariaLabelledBy: 'Busqueda de Productos', | |
537 | + templateUrl: 'modal-busqueda-productos.html', | |
538 | + controller: 'modalBusquedaProductosCtrl', | |
539 | + resolve: { | |
540 | + parametroProducto: { | |
541 | + idLista: null, | |
542 | + cotizacion: $scope.factura.cotizacion.VENDEDOR, | |
543 | + simbolo: $scope.factura.cotizacion.moneda.SIMBOLO, | |
544 | + buscarTodos: true | |
545 | + } | |
546 | + }, | |
547 | + size: 'lg' | |
548 | + } | |
549 | + ); | |
550 | + | |
551 | + modalInstance.result | |
552 | + .then(function (producto) { | |
553 | + | |
554 | + var articulo = { | |
555 | + TIP: $scope.factura.cliente.TIP, | |
556 | + TCO: 'FT', | |
557 | + SUC: parseInt($scope.puntoVenta), | |
558 | + ORD: $scope.articulosFiltro().length + 1, | |
559 | + SEC: producto.sector, | |
560 | + ART: producto.codigo, | |
561 | + RUB: producto.CodRub, | |
562 | + DES: producto.descripcionLarga, | |
563 | + PUN: producto.precio, | |
564 | + IVA: producto.IMPIVA, | |
565 | + NET: producto.IvaCO !== 0 ? parseFloat(producto.neto) : 0, | |
566 | + NEX: producto.IvaCO === 0 ? parseFloat(producto.neto) : 0, | |
567 | + IMI: producto.ImpInt, | |
568 | + IMI2: producto.ImpInt2, | |
569 | + IMI3: producto.ImpInt3, | |
570 | + PUT: producto.precio, | |
571 | + SUR: 0, | |
572 | + PLA: $scope.factura.vendedor.NplVen, | |
573 | + LUG: $scope.factura.vendedor.LugVen, | |
574 | + LEG: $scope.factura.vendedor.CodVen, | |
575 | + TUR: $scope.factura.vendedor.TurVen, | |
576 | + ORDEN_PRECOMPRA: '', | |
577 | + ESC: producto.tipoFactura === 'L' ? 1 : 0, | |
578 | + CMF: 0, | |
579 | + PTA: 0, | |
580 | + IVS: 0, | |
581 | + TIVA: 0, | |
582 | + CON: 0, | |
583 | + SINO: '', | |
584 | + ORD_TRA: 0, | |
585 | + IMP_DESP: 0, | |
586 | + PCD: 0, | |
587 | + RTO: '', | |
588 | + }; | |
589 | + | |
590 | + $scope.factura.articulosFactura.push(articulo); | |
591 | + $scope.cambioEdit(articulo, 'cantidad'); | |
592 | + | |
593 | + }) | |
594 | + .catch(function (e) { console.error(e); }); | |
595 | + }; | |
596 | + | |
597 | + $scope.seleccionarUltimosDespachos = function () { | |
598 | + | |
599 | + if (angular.equals($scope.factura.cliente, {})) { | |
600 | + focaModalService.alert('Seleccione cliente'); | |
601 | + return; | |
602 | + } | |
603 | + | |
604 | + var modalInstance = $uibModal.open( | |
605 | + { | |
606 | + templateUrl: 'modal-ultimos-despachos.html', | |
607 | + controller: 'ultimosDespachosController', | |
608 | + resolve: { | |
609 | + parametros: function () { | |
610 | + return { | |
611 | + planilla: $scope.factura.vendedor.NplVen, | |
612 | + }; | |
613 | + } | |
614 | + }, | |
615 | + size: 'md' | |
616 | + } | |
617 | + ); | |
618 | + | |
619 | + modalInstance.result.then(function (producto) { | |
620 | + | |
621 | + var articulo = { | |
622 | + TIP: $scope.factura.cliente.TIP, | |
623 | + TCO: 'FT', | |
624 | + SUC: parseInt($scope.puntoVenta), | |
625 | + ORD: $scope.articulosFiltro().length + 1, | |
626 | + SEC: producto.despachos[0].SEC, | |
627 | + ART: producto.despachos[0].PRO, | |
628 | + RUB: producto.CodRub, | |
629 | + DES: producto.DetArt, | |
630 | + CAN: producto.despachos[0].LTS, | |
631 | + PUN: producto.PreVen, | |
632 | + IVA: producto.IMPIVA, | |
633 | + NET: producto.IvaCO !== 0 ? producto.PreNet : 0, | |
634 | + NEX: producto.IvaCO === 0 ? producto.PreNet : 0, | |
635 | + IMI: producto.ImpInt, | |
636 | + IMI2: producto.ImpInt2, | |
637 | + IMI3: producto.ImpInt3, | |
638 | + PUT: producto.PreVen, | |
639 | + SUR: producto.despachos[0].SUR, | |
640 | + PLA: producto.despachos[0].PLA, | |
641 | + LUG: producto.despachos[0].LUG, | |
642 | + LEG: $scope.factura.vendedor.CodVen, | |
643 | + TUR: $scope.factura.vendedor.TurVen, | |
644 | + ORDEN_PRECOMPRA: '', | |
645 | + ESC: producto.tipoFactura === 'L' ? 1 : 0, | |
646 | + CMF: 0, | |
647 | + PTA: 0, | |
648 | + IVS: 0, | |
649 | + TIVA: 21, // TODO traer POR de la tabla ACODIVA where ID = IvaCO | |
650 | + CON: 0, | |
651 | + SINO: '', | |
652 | + ORD_TRA: 0, | |
653 | + IMP_DESP: 0, | |
654 | + PCD: 0, | |
655 | + RTO: '', | |
656 | + }; | |
657 | + | |
658 | + crearFacturaService.setearDespachoOcupado({ | |
659 | + surtidor: producto.despachos[0].SUR, | |
660 | + producto: producto.despachos[0].PRO, | |
661 | + carga: producto.despachos[0].CAR | |
662 | + }) | |
663 | + .then(function () { | |
664 | + $scope.factura.articulosFactura.push(articulo); | |
665 | + $scope.factura.despachos.push(producto.despachos[0]); | |
666 | + }) | |
667 | + .catch(function (err) { | |
668 | + | |
669 | + console.error(err); | |
670 | + focaModalService.alert('El despacho esta en uso'); | |
671 | + }); | |
672 | + | |
673 | + }) | |
674 | + .catch(function (err) { | |
675 | + console.error(err); | |
676 | + }); | |
677 | + | |
678 | + }; | |
679 | + | |
370 | 680 | function crearFuncionesProductos(producto) { |
371 | 681 | |
372 | - $scope[nombreFuncion(producto.DetArt)] = function() { | |
682 | + $scope[nombreFuncion(producto.DetArt)] = function () { | |
373 | 683 | |
374 | 684 | if (angular.equals($scope.factura.cliente, {})) { |
375 | 685 | focaModalService.alert('Seleccione cliente'); |
376 | 686 | return; |
377 | 687 | } |
378 | 688 | |
379 | - var parametrosModal = { | |
380 | - titulo: 'Despachos ' + producto.DetArt, | |
381 | - data: producto.despachos, | |
382 | - columnas: [ | |
383 | - { | |
384 | - propiedad: 'FEC', | |
385 | - nombre: 'Fecha', | |
386 | - filtro: { | |
387 | - nombre: 'date', | |
388 | - parametro: 'dd/MM/yyyy HH:mm' | |
689 | + var modalInstance = $uibModal.open( | |
690 | + { | |
691 | + templateUrl: 'modal-combustibles.html', | |
692 | + controller: 'focaModalCombustiblesController', | |
693 | + resolve: { | |
694 | + parametros: function () { | |
695 | + return { | |
696 | + despachos: producto.despachos, | |
697 | + nombreProducto: producto.DetArt, | |
698 | + topDespachos: $scope.topDespachos | |
699 | + }; | |
389 | 700 | } |
390 | 701 | }, |
391 | - { | |
392 | - propiedad: 'IMP', | |
393 | - nombre: 'Importe' | |
394 | - }, | |
395 | - { | |
396 | - propiedad: 'LTS', | |
397 | - nombre: 'Litros' | |
398 | - } | |
399 | - ], | |
400 | - size: 'md' | |
401 | - }; | |
702 | + size: 'md' | |
703 | + } | |
704 | + ); | |
402 | 705 | |
403 | - focaModalService.modal(parametrosModal).then(function(despacho) { | |
706 | + modalInstance.result.then(function (despacho) { | |
404 | 707 | |
405 | 708 | var articulo = { |
406 | - TIP: $scope.factura.cliente.tipoFactura, | |
709 | + TIP: $scope.factura.cliente.TIP, | |
407 | 710 | TCO: 'FT', |
408 | 711 | SUC: parseInt($scope.puntoVenta), |
409 | 712 | ORD: $scope.articulosFiltro().length + 1, |
... | ... | @@ -412,38 +715,52 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
412 | 715 | RUB: producto.CodRub, |
413 | 716 | DES: producto.DetArt, |
414 | 717 | CAN: despacho.LTS, |
415 | - PUN: producto.PreVen, // TODO | |
416 | - IVA: producto.IMPIVA, // TODO | |
417 | - NET: 0, // TODO | |
418 | - NEX: 0, // TODO | |
419 | - IMI: producto.ImpInt, // TODO | |
420 | - IMI2: producto.ImpInt2, // TODO | |
421 | - IMI3: producto.ImpInt3, // TODO | |
422 | - PUT: producto.PreNet, // TODO | |
718 | + PUN: producto.PreVen, | |
719 | + IVA: producto.IMPIVA, | |
720 | + NET: producto.IvaCO !== 0 ? producto.PreNet : 0, | |
721 | + NEX: producto.IvaCO === 0 ? producto.PreNet : 0, | |
722 | + IMI: producto.ImpInt, | |
723 | + IMI2: producto.ImpInt2, | |
724 | + IMI3: producto.ImpInt3, | |
725 | + PUT: producto.PreVen, | |
423 | 726 | SUR: despacho.SUR, |
424 | 727 | PLA: despacho.PLA, |
425 | 728 | LUG: despacho.LUG, |
426 | 729 | LEG: $scope.factura.vendedor.CodVen, |
427 | 730 | TUR: $scope.factura.vendedor.TurVen, |
428 | 731 | ORDEN_PRECOMPRA: '', |
429 | - ESC: producto.tipoFactura == 'L' ? 1 : 0, | |
732 | + ESC: producto.tipoFactura === 'L' ? 1 : 0, | |
430 | 733 | CMF: 0, |
431 | 734 | PTA: 0, |
432 | 735 | IVS: 0, |
433 | - TIVA: 0, | |
736 | + TIVA: 21, // TODO traer POR de la tabla ACODIVA where ID = IvaCO | |
434 | 737 | CON: 0, |
435 | 738 | SINO: '', |
436 | 739 | ORD_TRA: 0, |
437 | 740 | IMP_DESP: 0, |
438 | 741 | PCD: 0, |
439 | - RTO: '' | |
742 | + RTO: '', | |
440 | 743 | }; |
441 | 744 | |
442 | - $scope.factura.articulosFactura.push(articulo); | |
745 | + crearFacturaService.setearDespachoOcupado({ | |
746 | + surtidor: despacho.SUR, | |
747 | + producto: despacho.PRO, | |
748 | + carga: despacho.CAR | |
749 | + }) | |
750 | + .then(function () { | |
751 | + $scope.factura.articulosFactura.push(articulo); | |
752 | + $scope.factura.despachos.push(despacho); | |
753 | + }) | |
754 | + .catch(function (err) { | |
755 | + | |
756 | + console.error(err); | |
757 | + focaModalService.alert('El despacho esta en uso'); | |
758 | + }); | |
759 | + | |
443 | 760 | }) |
444 | - .catch(function (err) { | |
445 | - console.log(err) | |
446 | - }); | |
761 | + .catch(function (err) { | |
762 | + console.error(err); | |
763 | + }); | |
447 | 764 | |
448 | 765 | }; |
449 | 766 | } |
... | ... | @@ -451,7 +768,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
451 | 768 | function nombreFuncion(string) { |
452 | 769 | var texto = 'seleccionar'; |
453 | 770 | var arr = string.split(' '); |
454 | - arr.forEach(function(palabra) { | |
771 | + arr.forEach(function (palabra) { | |
455 | 772 | palabra = palabra.charAt(0).toUpperCase() + palabra.slice(1); |
456 | 773 | texto += palabra; |
457 | 774 | }); |
... | ... | @@ -460,48 +777,56 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
460 | 777 | |
461 | 778 | function indicarPassword(vendedor) { |
462 | 779 | |
463 | - return new Promise(function(resolve, reject) { | |
780 | + return new Promise(function (resolve, reject) { | |
464 | 781 | |
465 | - focaModalService | |
466 | - .prompt({ | |
467 | - titulo: 'Indique Contraseña', | |
468 | - value: '' | |
469 | - }) | |
470 | - .then(function (contraseña) { | |
782 | + function openPrompt() { | |
783 | + return focaModalService | |
784 | + .prompt({ | |
785 | + titulo: 'Indique Contraseña', | |
786 | + value: '', | |
787 | + tipo: 'password' | |
788 | + }) | |
789 | + .then(function (contraseña) { | |
471 | 790 | |
472 | - if (contraseña != vendedor.ClaVen.trim()) { | |
791 | + if (contraseña !== vendedor.ClaVen.trim()) { | |
473 | 792 | |
474 | - focaModalService.alert('Clave incorrecta').then(function() { | |
475 | - indicarPassword(vendedor); | |
476 | - }); | |
477 | - } else { | |
478 | - resolve(); | |
479 | - } | |
480 | - }) | |
481 | - .catch(reject); | |
793 | + focaModalService.alert('Clave incorrecta').then(function () { | |
794 | + openPrompt(vendedor); | |
795 | + }); | |
796 | + } else { | |
797 | + resolve(); | |
798 | + } | |
799 | + }) | |
800 | + .catch(reject); | |
801 | + } | |
802 | + | |
803 | + openPrompt(); | |
482 | 804 | }); |
483 | 805 | } |
484 | 806 | |
485 | 807 | function validarPlanillaVendedor(vendedor) { |
486 | 808 | |
487 | - return new Promise(function(resolve, reject) { | |
809 | + return new Promise(function (resolve, reject) { | |
488 | 810 | |
489 | 811 | crearFacturaService |
490 | - .validarPlanillaVendedor(vendedor.CodVen.trim()) | |
491 | - .then(function (res) { | |
812 | + .validarPlanillaVendedor(vendedor.CodVen.toString().trim()) | |
813 | + .then(function (res) { | |
492 | 814 | |
493 | - if (!res.data.length) { | |
815 | + if (!res.data.length) { | |
494 | 816 | |
495 | - focaModalService | |
496 | - .alert('No se encontró planilla abierta para el vendedor') | |
497 | - .then(reject); | |
817 | + focaModalService | |
818 | + .alert('No se encontró planilla abierta para el vendedor') | |
819 | + .then(reject); | |
498 | 820 | |
499 | - } else { | |
500 | - resolve(); | |
501 | - } | |
821 | + } else { | |
822 | + resolve(); | |
823 | + } | |
502 | 824 | |
503 | - }) | |
504 | - .catch(reject); | |
825 | + }) | |
826 | + .catch(function (err) { | |
827 | + console.log(err); | |
828 | + reject(); | |
829 | + }); | |
505 | 830 | }); |
506 | 831 | } |
507 | 832 | |
... | ... | @@ -513,7 +838,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
513 | 838 | return relleno; |
514 | 839 | } |
515 | 840 | |
516 | - function salir() { | |
841 | + $scope.salir = function () { | |
517 | 842 | var confirmacion = false; |
518 | 843 | |
519 | 844 | if (!angular.equals($scope.factura, $scope.inicial)) { |
... | ... | @@ -531,7 +856,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
531 | 856 | } else { |
532 | 857 | $location.path('/'); |
533 | 858 | } |
534 | - } | |
859 | + }; | |
535 | 860 | |
536 | 861 | function setearFactura(factura) { |
537 | 862 | |
... | ... | @@ -557,14 +882,14 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
557 | 882 | } |
558 | 883 | |
559 | 884 | if (factura.cotizacion && factura.cotizacion.moneda) { |
560 | - $filter('filter')($scope.botonera, { label: 'Moneda' })[0].checked = true; | |
885 | + // $filter('filter')($scope.botonera, { label: 'Moneda' })[0].checked = true; | |
561 | 886 | } |
562 | 887 | |
563 | - if (factura.cliente && factura.cliente.cod) { | |
888 | + if (factura.cliente && factura.cliente.COD) { | |
564 | 889 | $scope.cabeceras.push({ |
565 | 890 | label: 'Cliente:', |
566 | - valor: $filter('rellenarDigitos')(factura.cliente.cod, 3) + ' - ' + | |
567 | - factura.cliente.nom | |
891 | + valor: $filter('rellenarDigitos')(factura.cliente.COD, 3) + ' - ' + | |
892 | + factura.cliente.NOM | |
568 | 893 | }); |
569 | 894 | |
570 | 895 | $filter('filter')($scope.botonera, { label: 'Cliente' })[0].checked = true; |
... | ... | @@ -594,6 +919,35 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
594 | 919 | } |
595 | 920 | } |
596 | 921 | |
922 | + $scope.cambioEdit = function (articulo, propiedad) { | |
923 | + if (propiedad === 'cantidad' && articulo.SUR === 0) { | |
924 | + articulo.editCantidad = true; | |
925 | + } | |
926 | + }; | |
927 | + | |
928 | + $scope.editarArticulo = function (key, articulo, tmpCantidad) { | |
929 | + if (key === 13) { | |
930 | + if (!articulo.cantidad && tmpCantidad.length === 0) { | |
931 | + focaModalService.alert('Los valores deben ser al menos 1'); | |
932 | + return; | |
933 | + } else if (tmpCantidad === '0') { | |
934 | + focaModalService.alert('Esta ingresando un producto con valor 0'); | |
935 | + return; | |
936 | + } else if (parseInt(tmpCantidad) < 0) { | |
937 | + focaModalService.alert('Los valores no pueden ser negativos'); | |
938 | + return; | |
939 | + } | |
940 | + articulo.CAN = parseInt(tmpCantidad); | |
941 | + $scope.getTotal(); | |
942 | + articulo.editCantidad = false; | |
943 | + } | |
944 | + }; | |
945 | + | |
946 | + $scope.cancelarEditar = function (articulo) { | |
947 | + $scope.tmpCantidad = articulo.CAN; | |
948 | + articulo.editCantidad = false; | |
949 | + }; | |
950 | + | |
597 | 951 | function actualizarCabeceraMoneda(cotizacion) { |
598 | 952 | |
599 | 953 | $scope.factura.articulosFactura.forEach(function (art) { |
... | ... | @@ -629,7 +983,7 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
629 | 983 | return false; |
630 | 984 | } else if (angular.equals({}, $scope.factura.cliente)) { |
631 | 985 | |
632 | - focaModalService.alert('Seleccione Cliente') | |
986 | + focaModalService.alert('Seleccione Cliente'); | |
633 | 987 | return false; |
634 | 988 | } else if (!$scope.articulosFiltro().length) { |
635 | 989 | |
... | ... | @@ -639,5 +993,35 @@ angular.module('focaCrearFactura').controller('facturaController', [ |
639 | 993 | |
640 | 994 | return true; |
641 | 995 | } |
996 | + | |
997 | + //recibo la propiedad por la cual quiero obtener el valor | |
998 | + function getImporte(propiedad) { | |
999 | + var importe = 0; | |
1000 | + | |
1001 | + $scope.articulosFiltro().forEach(function (articulo) { | |
1002 | + | |
1003 | + if (articulo[propiedad]) { | |
1004 | + importe += articulo[propiedad] * articulo.CAN; | |
1005 | + } | |
1006 | + return; | |
1007 | + | |
1008 | + }); | |
1009 | + | |
1010 | + return importe; | |
1011 | + } | |
1012 | + | |
1013 | + function getNumeroFactura(tipoFactura) { | |
1014 | + | |
1015 | + crearRemitoService.getNumeroRemito(tipoFactura).then( | |
1016 | + function (res) { | |
1017 | + $scope.puntoVenta = rellenar(res.data.sucursal, 4); | |
1018 | + $scope.comprobante = rellenar(res.data.numeroRemito, 8); | |
1019 | + }, | |
1020 | + function (err) { | |
1021 | + focaModalService.alert('La terminal no esta configurada correctamente'); | |
1022 | + console.info(err); | |
1023 | + } | |
1024 | + ); | |
1025 | + } | |
642 | 1026 | } |
643 | 1027 | ]); |
src/js/controllerCombustibles.js
... | ... | @@ -0,0 +1,83 @@ |
1 | +angular.module('focaCrearFactura') | |
2 | + .controller('focaModalCombustiblesController', [ | |
3 | + '$filter', | |
4 | + '$scope', | |
5 | + '$uibModalInstance', | |
6 | + 'parametros', | |
7 | + function ($filter, $scope, $uibModalInstance, parametros) { | |
8 | + | |
9 | + $scope.mangueras = []; | |
10 | + $scope.colorTexto = { color: 'black' }; | |
11 | + var productosByMangera = []; | |
12 | + | |
13 | + config(); | |
14 | + | |
15 | + function config() { | |
16 | + | |
17 | + $scope.nombreProducto = parametros.nombreProducto; | |
18 | + setColorNombreProducto(); | |
19 | + parametros.despachos.forEach(function (despacho) { | |
20 | + | |
21 | + var findCsu = productosByMangera.filter(function (csu) { | |
22 | + return csu.csu === despacho.CSU.trim(); | |
23 | + })[0]; | |
24 | + | |
25 | + if (!findCsu) { | |
26 | + | |
27 | + var mangera = { | |
28 | + csu: despacho.CSU.trim(), | |
29 | + despachos: [despacho], | |
30 | + show: true | |
31 | + }; | |
32 | + | |
33 | + productosByMangera.unshift(mangera); | |
34 | + } else { | |
35 | + findCsu.despachos.push(despacho); | |
36 | + } | |
37 | + }); | |
38 | + } | |
39 | + | |
40 | + $scope.mangueras = productosByMangera; | |
41 | + | |
42 | + $scope.mangueras.forEach(function (producto) { | |
43 | + | |
44 | + producto.despachos.splice(parametros.topDespachos, producto.despachos.length); | |
45 | + | |
46 | + producto.despachos.sort(function (a, b) { | |
47 | + return a.FEC - b.FEC; | |
48 | + }); | |
49 | + }); | |
50 | + | |
51 | + | |
52 | + $scope.aceptar = function (despacho) { | |
53 | + $uibModalInstance.close(despacho); | |
54 | + }; | |
55 | + | |
56 | + $scope.cancel = function () { | |
57 | + $uibModalInstance.dismiss('cancel'); | |
58 | + }; | |
59 | + | |
60 | + //TODO: Cambiar switch case con los casos de nombres de productos axion | |
61 | + function setColorNombreProducto() { | |
62 | + | |
63 | + // Diesel #FF852E | Euro+Diesel #6C389A | Premium #00A857 | Super #175AA5 | |
64 | + switch ($scope.nombreProducto) { | |
65 | + case 'NAFTA SUPER XXI': | |
66 | + $scope.colorTexto = { color: '#FF852E' }; | |
67 | + break; | |
68 | + case 'GO-INFINIA DIESEL': | |
69 | + $scope.colorTexto = { color: '#6C389A' }; | |
70 | + break; | |
71 | + case 'ULTRADIESEL XXI - RED': | |
72 | + $scope.colorTexto = { color: '#00A857' }; | |
73 | + break; | |
74 | + case 'NAFTA INFINIA': | |
75 | + $scope.colorTexto = { color: '#175AA5' }; | |
76 | + break; | |
77 | + default: | |
78 | + $scope.colorTexto = { color: 'black' }; | |
79 | + break; | |
80 | + } | |
81 | + } | |
82 | + } | |
83 | + ]); |
src/js/controllerEstadoCuenta.js
... | ... | @@ -0,0 +1,34 @@ |
1 | +angular.module('focaCrearFactura') | |
2 | + .controller('focaModalEstadoCuentaController', [ | |
3 | + '$scope', '$uibModalInstance', 'crearFacturaService', 'parametros', | |
4 | + function ($scope, $uibModalInstance, crearFacturaService, parametros) { | |
5 | + | |
6 | + $scope.estadoCuenta = { | |
7 | + autorizado: 0.0, | |
8 | + extracciones: 0.0, | |
9 | + saldo: 0.0, | |
10 | + situacion: false, | |
11 | + facturasVencidas: 0.0 | |
12 | + }; | |
13 | + | |
14 | + $scope.cliente = parametros; | |
15 | + | |
16 | + init(); | |
17 | + | |
18 | + function init() { | |
19 | + crearFacturaService.getResumenCuenta(parametros.idCliente) | |
20 | + .then(function (res) { | |
21 | + $scope.estadoCuenta = res.data; | |
22 | + }) | |
23 | + .catch(function (e) { console.error(e); }); | |
24 | + } | |
25 | + | |
26 | + $scope.elegirTipoDePago = function (tipoDePago) { | |
27 | + $uibModalInstance.close(tipoDePago); | |
28 | + }; | |
29 | + | |
30 | + $scope.cancel = function () { | |
31 | + $uibModalInstance.dismiss('cancel'); | |
32 | + }; | |
33 | + } | |
34 | + ]); |
src/js/controllerUltimosDespachos.js
... | ... | @@ -0,0 +1,59 @@ |
1 | +angular.module('focaCrearFactura') | |
2 | + .controller('ultimosDespachosController', [ | |
3 | + '$filter', | |
4 | + '$scope', | |
5 | + '$uibModalInstance', | |
6 | + 'crearFacturaService', | |
7 | + 'parametros', | |
8 | + function ($filter, $scope, $uibModalInstance, crearFacturaService, parametros) { | |
9 | + | |
10 | + config(); | |
11 | + | |
12 | + function config() { | |
13 | + | |
14 | + $scope.productos = []; | |
15 | + | |
16 | + crearFacturaService.getUltimosDespachos(parametros.planilla).then(function (res) { | |
17 | + | |
18 | + res.data.slice(1, res.data.length).forEach(function (producto) { | |
19 | + | |
20 | + producto.mangueras = []; | |
21 | + | |
22 | + producto.despachos.forEach(function (despacho) { | |
23 | + | |
24 | + var findCsu = producto.mangueras.filter(function (csu) { | |
25 | + return csu.csu === despacho.CSU.trim(); | |
26 | + })[0]; | |
27 | + | |
28 | + if (!findCsu) { | |
29 | + | |
30 | + var manguera = { | |
31 | + csu: despacho.CSU.trim(), | |
32 | + despachos: [despacho], | |
33 | + show: true | |
34 | + }; | |
35 | + | |
36 | + producto.mangueras.unshift(manguera); | |
37 | + } else { | |
38 | + findCsu.despachos.push(despacho); | |
39 | + } | |
40 | + }); | |
41 | + | |
42 | + $scope.productos.push(producto); | |
43 | + }); | |
44 | + | |
45 | + console.log($scope.productos); | |
46 | + | |
47 | + }); | |
48 | + } | |
49 | + | |
50 | + $scope.aceptar = function (despacho) { | |
51 | + $uibModalInstance.close(despacho); | |
52 | + }; | |
53 | + | |
54 | + $scope.cancel = function () { | |
55 | + $uibModalInstance.dismiss('cancel'); | |
56 | + }; | |
57 | + | |
58 | + } | |
59 | + ]); |
src/js/service.js
1 | 1 | angular.module('focaCrearFactura') |
2 | - .service('crearFacturaService', ['$http', 'API_ENDPOINT', | |
3 | - function($http, API_ENDPOINT) { | |
4 | - var route = API_ENDPOINT.URL; | |
5 | - return { | |
6 | - guardarFactura: function (factura) { | |
7 | - return $http.post(route + '/factura/guardar', factura) | |
8 | - }, | |
9 | - getParametros: function() { | |
10 | - return $http.get(API_ENDPOINT.URL + '/parametros/factura'); | |
11 | - }, | |
12 | - validarPlanillaVendedor: function(idVendedor) { | |
13 | - return $http.get(route + '/turnos/validar-planilla/' + idVendedor); | |
14 | - }, | |
15 | - getProductosByPlanilla: function (numeroPlanilla) { | |
16 | - return $http.get(route + '/turnos/productos/' + numeroPlanilla); | |
17 | - }, | |
18 | - getBotonera: function() { | |
19 | - return [ | |
20 | - { | |
2 | + .service('crearFacturaService', ['$http', 'API_ENDPOINT', 'APP', | |
3 | + function ($http, API_ENDPOINT, APP) { | |
4 | + var route = API_ENDPOINT.URL; | |
5 | + return { | |
6 | + guardarFactura: function (factura) { | |
7 | + return $http.post(route + '/factura/guardar', factura); | |
8 | + }, | |
9 | + getParametros: function () { | |
10 | + return $http.get(API_ENDPOINT.URL + '/parametros/factura'); | |
11 | + }, | |
12 | + validarPlanillaVendedor: function (idVendedor) { | |
13 | + return $http.get(route + '/turnos/validar-planilla/' + idVendedor); | |
14 | + }, | |
15 | + getProductosByPlanilla: function (numeroPlanilla) { | |
16 | + return $http.get(route + '/turnos/productos/' + numeroPlanilla); | |
17 | + }, | |
18 | + getUltimosDespachos: function (numeroPlanilla) { | |
19 | + return $http.get(route + '/turnos/productos/' + numeroPlanilla + '/true'); | |
20 | + }, | |
21 | + setearDespachoOcupado: function (parametros) { | |
22 | + return $http.post(route + '/turnos/despacho-en-uso', parametros); | |
23 | + }, | |
24 | + setearDespachoDesocupado: function (parametros) { | |
25 | + return $http.post(route + '/turnos/depacho-sin-uso', parametros); | |
26 | + }, | |
27 | + getResumenCuenta: function (idCliente) { | |
28 | + return $http.get(route + '/cliente/resumen-cuenta/' + idCliente); | |
29 | + }, | |
30 | + getVendedorPlayaById: function (id) { | |
31 | + return $http.get(route + '/vendedor-playa/' + id); | |
32 | + }, | |
33 | + getBotonera: function () { | |
34 | + var vendedor = { | |
21 | 35 | label: 'Vendedor', |
22 | 36 | image: 'vendedor.png' |
23 | - }, | |
24 | - { | |
25 | - label: 'Cliente', | |
26 | - image: 'cliente.png' | |
27 | - }, | |
28 | - { | |
29 | - label: 'Moneda', | |
30 | - image: 'moneda.png' | |
31 | - }, | |
32 | - { | |
33 | - label: 'Observaciones', | |
34 | - image: 'botonObservaciones.png' | |
37 | + }; | |
38 | + // $scope.botoneraProductos.push({ | |
39 | + // label: 'Busqueda Productos', | |
40 | + // image: 'buscarProductos.png', | |
41 | + // imageDefault: 'productoDefault.png' | |
42 | + // }); | |
43 | + var botones = [ | |
44 | + { | |
45 | + label: 'Cliente', | |
46 | + image: 'cliente.png' | |
47 | + }, | |
48 | + { | |
49 | + label: 'Busqueda Productos', | |
50 | + image: 'productos.png' | |
51 | + } | |
52 | + // { | |
53 | + // label: 'Moneda', | |
54 | + // image: 'moneda.png' | |
55 | + // }, | |
56 | + // { | |
57 | + // label: 'Observaciones', | |
58 | + // image: 'botonObservaciones.png' | |
59 | + // } | |
60 | + ]; | |
61 | + | |
62 | + if (APP !== 'facturador') { | |
63 | + botones.unshift(vendedor); | |
35 | 64 | } |
36 | - ]; | |
37 | - } | |
38 | - }; | |
39 | - }]); | |
65 | + | |
66 | + return botones; | |
67 | + } | |
68 | + }; | |
69 | + } | |
70 | + ]); |
src/views/factura.html
1 | 1 | <div class="crear-nota-remito foca-crear row"> |
2 | - <foca-cabecera-facturador | |
2 | + <foca-cabecera-facturador | |
3 | 3 | titulo="'Factura'" |
4 | 4 | numero="puntoVenta + '-' + comprobante" |
5 | 5 | fecha="now" |
6 | 6 | class="mb-0 col-lg-12" |
7 | 7 | busqueda="seleccionarRemito" |
8 | - ></foca-cabecera-facturador> | |
9 | - <marquee | |
10 | - bgcolor="#FF9900" | |
11 | - behavior="scroll" | |
12 | - direction="left" | |
13 | - ng-bind="factura.observaciones" | |
14 | - ></marquee> | |
15 | - <div class="col-lg-12"> | |
16 | - <div class="row mt-4"> | |
17 | - <div class="col-12 col-md-10 col-lg-10 border border-light rounded"> | |
18 | - <div class="row p-1 botonera-secundaria px-5 py-2"> | |
8 | + fecha-disabled="true" | |
9 | + ></foca-cabecera-facturador> | |
10 | + <marquee | |
11 | + bgcolor="#FF9900" | |
12 | + behavior="scroll" | |
13 | + direction="left" | |
14 | + ng-bind="factura.observaciones" | |
15 | + ></marquee> | |
16 | + <div class="col-12 col-lg-10 p-2"> | |
17 | + <div class="row border border-light rounded m-0"> | |
18 | + <div class="col-12 col-sm-12"> | |
19 | + <div class="row p-1 botonera-secundaria px-3 py-2"> | |
19 | 20 | <div class="col-12"> |
20 | - <foca-botonera-facturador botones="botonera" extra="4" class="row"></foca-botonera-facturador> | |
21 | + <foca-botonera-facturador | |
22 | + botones="botonera" | |
23 | + max="botonera.length" | |
24 | + class="row"> | |
25 | + </foca-botonera-facturador> | |
26 | + </div> | |
27 | + </div> | |
28 | + <div ng-show="botoneraProductos.length > 0" class="row botonera-secundaria pb-3 px-3"> | |
29 | + <div class="col-12"> | |
30 | + <foca-botonera-productos | |
31 | + botones="botoneraProductos" | |
32 | + max="1" | |
33 | + class="row" | |
34 | + > | |
35 | + </foca-botonera-productos> | |
21 | 36 | </div> |
22 | 37 | </div> |
23 | 38 | <!-- PC --> |
... | ... | @@ -74,9 +89,9 @@ |
74 | 89 | foca-tipo-input |
75 | 90 | min="1" |
76 | 91 | foca-focus="articulo.editCantidad" |
77 | - ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad, tmpPrecio);" | |
92 | + ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad);" | |
78 | 93 | esc-key="cancelarEditar(articulo)" |
79 | - ng-focus="selectFocus($event); tmpCantidad = articulo.CAN; tmpPrecio = articulo.PUN" | |
94 | + ng-focus="selectFocus($event); tmpCantidad = articulo.CAN;" | |
80 | 95 | teclado-virtual |
81 | 96 | > |
82 | 97 | <i |
... | ... | @@ -87,25 +102,8 @@ |
87 | 102 | </i> |
88 | 103 | </td> |
89 | 104 | <td class="col text-right"> |
90 | - <input | |
91 | - ng-show="articulo.editPrecio" | |
92 | - ng-model="tmpPrecio" | |
93 | - class="form-control" | |
94 | - foca-tipo-input | |
95 | - min="1" | |
96 | - step="0.0001" | |
97 | - foca-focus="articulo.editPrecio" | |
98 | - ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad, tmpPrecio);" | |
99 | - esc-key="cancelarEditar(articulo)" | |
100 | - ng-focus="selectFocus($event); | |
101 | - tmpCantidad = articulo.CAN; | |
102 | - tmpPrecio = articulo.PUN" | |
103 | - teclado-virtual | |
104 | - > | |
105 | 105 | <i |
106 | 106 | class="selectable" |
107 | - ng-click="cambioEdit(articulo, 'precio')" | |
108 | - ng-hide="articulo.editPrecio" | |
109 | 107 | ng-bind="articulo.PUN | number: 4"> |
110 | 108 | </i> |
111 | 109 | </td> |
... | ... | @@ -116,13 +114,13 @@ |
116 | 114 | <td class="text-center"> |
117 | 115 | <button |
118 | 116 | class="btn btn-outline-light" |
119 | - ng-click="quitarArticulo(articulo)" | |
117 | + ng-click="quitarDespacho(articulo, key)" | |
120 | 118 | > |
121 | 119 | <i class="fa fa-trash"></i> |
122 | 120 | </button> |
123 | 121 | <button |
124 | 122 | class="btn btn-outline-light" |
125 | - ng-click="editarArticulo(13, articulo, tmpCantidad, tmpPrecio);" | |
123 | + ng-click="editarArticulo(13, articulo, tmpCantidad);" | |
126 | 124 | ng-show="articulo.editCantidad || articulo.editPrecio" |
127 | 125 | > |
128 | 126 | <i class="fa fa-save"></i> |
... | ... | @@ -136,37 +134,162 @@ |
136 | 134 | <strong>Items:</strong> |
137 | 135 | <a ng-bind="articulosFiltro().length"></a> |
138 | 136 | </td> |
139 | - <td class="text-right ml-auto table-celda-total no-border-top"> | |
137 | + <td class="text-right ml-auto table-celda-total no-border-top text-white"> | |
140 | 138 | <h3>Total:</h3> |
141 | 139 | </td> |
142 | - <td class="table-celda-total text-right no-border-top" colspan="1"> | |
140 | + <td class="table-celda-total text-right no-border-top text-white " colspan="1"> | |
143 | 141 | <h3>{{getTotal() | currency: factura.cotizacion.moneda.SIMBOLO}}</h3> |
144 | 142 | </td> |
145 | - <td class="text-right no-border-top"> | |
146 | - <button | |
147 | - type="button" | |
148 | - class="btn btn-sm" | |
149 | - > | |
150 | - Totales | |
151 | - </button> | |
152 | - </td> | |
143 | + | |
153 | 144 | </tr> |
154 | 145 | </tfoot> |
155 | 146 | </table> |
156 | 147 | </div> |
148 | + <!-- MOBILE --> | |
149 | + <div class="row d-sm-none"> | |
150 | + <div class="col p-0 m-2 mb-5"> | |
151 | + <table class="table table-sm table-striped tabla-articulo"> | |
152 | + <thead> | |
153 | + <tr class="d-flex"> | |
154 | + <th class="">#</th> | |
155 | + <th class="col px-0"> | |
156 | + <div class="d-flex"> | |
157 | + <div class="col-4 px-1">Código</div> | |
158 | + <div class="col-8 px-1">Descripción</div> | |
159 | + </div> | |
160 | + <div class="d-flex"> | |
161 | + <div class="col-3 px-1">Cantidad</div> | |
162 | + <div class="col px-1 text-right">P. Uni.</div> | |
163 | + <div class="col px-1 text-right">Subtotal</div> | |
164 | + </div> | |
165 | + </th> | |
166 | + <th class="text-center tamaño-boton"> | |
167 | + | |
168 | + </th> | |
169 | + </tr> | |
170 | + </thead> | |
171 | + <tbody> | |
172 | + <tr | |
173 | + ng-repeat="(key, articulo) in articulosFiltro()" | |
174 | + ng-show="show || key == articulosFiltro().length - 1" | |
175 | + > | |
176 | + <td class="w-100 d-flex p-0"> | |
177 | + <div class="p-1 m-auto"> | |
178 | + <span ng-bind="key + 1"></span> | |
179 | + </div> | |
180 | + <div class="col px-0"> | |
181 | + <div class="d-flex"> | |
182 | + <div class="col-4 px-1"> | |
183 | + <span | |
184 | + ng-bind="articulo.SEC + '-' + articulo.ART" | |
185 | + ></span> | |
186 | + </div> | |
187 | + <div class="col-8 px-1"> | |
188 | + <span ng-bind="articulo.DES"></span> | |
189 | + </div> | |
190 | + </div> | |
191 | + <div class="d-flex"> | |
192 | + <div class="col-4 px-1"> | |
193 | + <span | |
194 | + ng-bind="'x' + articulo.CAN" | |
195 | + ng-hide="articulo.editCantidad" | |
196 | + ></span> | |
197 | + <i | |
198 | + class="fa fa-pencil text-white-50" | |
199 | + aria-hidden="true" | |
200 | + ng-hide="articulo.editCantidad" | |
201 | + ng-click="articulo.editCantidad = true" | |
202 | + ></i> | |
203 | + <input | |
204 | + ng-show="articulo.editCantidad" | |
205 | + ng-model="tmpCantidad" | |
206 | + class="form-control" | |
207 | + foca-tipo-input | |
208 | + min="1" | |
209 | + step="0.001" | |
210 | + foca-focus="articulo.editCantidad" | |
211 | + ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad)" | |
212 | + ng-focus="selectFocus($event)" | |
213 | + > | |
214 | + </div> | |
215 | + <div class="col px-1 text-right"> | |
216 | + <span ng-bind="articulo.PUN | | |
217 | + currency: factura.cotizacion.moneda.SIMBOLO : 4"></span> | |
218 | + ></span> | |
219 | + </div> | |
220 | + <div class="col px-1 text-right"> | |
221 | + <span | |
222 | + ng-bind="(articulo.PUN * articulo.CAN) | | |
223 | + currency: factura.cotizacion.moneda.SIMBOLO" | |
224 | + > | |
225 | + </span> | |
226 | + </div> | |
227 | + </div> | |
228 | + </div> | |
229 | + <div class="m-auto p-1"> | |
230 | + <button | |
231 | + class="btn btn-outline-light" | |
232 | + ng-click="quitarDespacho(articulo, key)" | |
233 | + > | |
234 | + <i class="fa fa-trash"></i> | |
235 | + </button> | |
236 | + </div> | |
237 | + </td> | |
238 | + </tr> | |
239 | + </tbody> | |
240 | + <tfoot> | |
241 | + <!-- TOOGLE EXPANDIR --> | |
242 | + <tr> | |
243 | + <td class="col"> | |
244 | + <button | |
245 | + class="btn btn-outline-light selectable w-100" | |
246 | + ng-click="show = !show; masMenos()" | |
247 | + ng-show="articulosFiltro().length > 0" | |
248 | + > | |
249 | + <i | |
250 | + class="fa fa-chevron-down" | |
251 | + ng-hide="show" | |
252 | + aria-hidden="true" | |
253 | + > | |
254 | + </i> | |
255 | + <i | |
256 | + class="fa fa-chevron-up" | |
257 | + ng-show="show" | |
258 | + aria-hidden="true"> | |
259 | + </i> | |
260 | + </button> | |
261 | + </td> | |
262 | + </tr> | |
263 | + <!-- FOOTER --> | |
264 | + <tr class="d-flex"> | |
265 | + <td class="m-auto no-border-top" colspan="2"> | |
266 | + <strong>Cantidad Items:</strong> | |
267 | + <a ng-bind="articulosFiltro().length"></a> | |
268 | + </td> | |
269 | + <td class="text-right ml-auto table-celda-total no-border-top"> | |
270 | + <h3>Total:</h3> | |
271 | + </td> | |
272 | + <td class="table-celda-total text-right no-border-top"> | |
273 | + <h3>{{getTotal() | currency: factura.cotizacion.moneda.SIMBOLO}}</h3> | |
274 | + </td> | |
275 | + </tr> | |
276 | + </tfoot> | |
277 | + </table> | |
278 | + </div> | |
279 | + </div> | |
157 | 280 | </div> |
158 | 281 | </div> |
159 | 282 | </div> |
160 | - <div class="row d-md-none fixed-bottom"> | |
283 | + <div class="row d-md-none fixed-bottom disable-selection"> | |
161 | 284 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> |
162 | 285 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> |
163 | 286 | <span |
164 | 287 | class="mr-3 ml-auto" |
165 | 288 | ng-class="saveLoading ? 'text-muted' : ''" |
166 | - ng-click="crearRemito()" | |
289 | + ng-click="seleccionarFormaDePago()" | |
167 | 290 | ladda="saveLoading" |
168 | 291 | data-style="expand-left" |
169 | - >Guardar</span> | |
292 | + >Pago</span> | |
170 | 293 | </div> |
171 | 294 | </div> |
172 | 295 | </div> |
src/views/modal-combustibles.html
... | ... | @@ -0,0 +1,86 @@ |
1 | +<div class="modal-header py-1"> | |
2 | + <div class="row w-100"> | |
3 | + <div class="col-lg-6"> | |
4 | + <h5 class="modal-title my-1"><b>Despachos Disponibles</b></h5> | |
5 | + </div> | |
6 | + </div> | |
7 | +</div> | |
8 | +<div class="modal-body" id="modal-body"> | |
9 | + | |
10 | + <div class="row pb-2 border-bottom"> | |
11 | + <div class="col"> | |
12 | + <p ng-style="colorTexto" class="m-1 h6"> | |
13 | + <b> | |
14 | + <i class="fa fa-circle" aria-hidden="true"></i> {{nombreProducto}} | |
15 | + </b> | |
16 | + </p> | |
17 | + </div> | |
18 | + </div> | |
19 | + <div ng-repeat="(key, manguera) in mangueras"> | |
20 | + <div class="row my-2"> | |
21 | + <div class="col"> | |
22 | + <label> | |
23 | + <img class="w-50" ng-src="./img/surtidor.png" alt=""> | |
24 | + {{manguera.csu}} | |
25 | + </label> | |
26 | + <button | |
27 | + type="button" | |
28 | + class="btn p-1 text-secondary float-right border" | |
29 | + ng-click="manguera.show = !manguera.show"> | |
30 | + <i ng-show="manguera.show" class="fa fa-minus px-1"></i> | |
31 | + <i ng-show="!manguera.show" class="fa fa-plus px-1"></i> | |
32 | + </button> | |
33 | + <table class="table table-sm table-striped" ng-show="manguera.show"> | |
34 | + <tbody> | |
35 | + <tr ng-repeat="(key, despacho) in manguera.despachos"> | |
36 | + <td class="py-2 py-sm-1" ng-bind="despacho.FEC | date:'dd/MM/yyyy hh:MM:ss'"></td> | |
37 | + <td class="py-2 py-sm-1" ng-bind="despacho.LTS"></td> | |
38 | + <td class="py-2 py-sm-1" ng-bind="despacho.IMP | currency: '$'"></td> | |
39 | + <td class="py-2 py-sm-1"> | |
40 | + <button | |
41 | + type="button" | |
42 | + class="btn btn-default btn-xs p-1 float-right" | |
43 | + title="Seleccionar" | |
44 | + ng-click="aceptar(despacho)" | |
45 | + ><i class="fa fa-circle-thin" aria-hidden="true"></i> | |
46 | + </button> | |
47 | + </td> | |
48 | + </tr> | |
49 | + </tbody> | |
50 | + </table> | |
51 | + </div> | |
52 | + </div> | |
53 | + </div> | |
54 | + | |
55 | +</div> | |
56 | +<div class="modal-footer py-2"> | |
57 | + <nav ng-show="currentPageProveedores.length > 0 && primerBusqueda" class="mr-auto"> | |
58 | + <ul class="pagination pagination-sm mb-0"> | |
59 | + <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | |
60 | + <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | |
61 | + <span aria-hidden="true">«</span> | |
62 | + <span class="sr-only">Anterior</span> | |
63 | + </a> | |
64 | + </li> | |
65 | + <li | |
66 | + class="page-item" | |
67 | + ng-repeat="pagina in paginas" | |
68 | + ng-class="{'active': pagina == currentPage}" | |
69 | + > | |
70 | + <a | |
71 | + class="page-link" | |
72 | + href="javascript:void();" | |
73 | + ng-click="selectPage(pagina)" | |
74 | + ng-bind="pagina" | |
75 | + ></a> | |
76 | + </li> | |
77 | + <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | |
78 | + <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | |
79 | + <span aria-hidden="true">»</span> | |
80 | + <span class="sr-only">Siguiente</span> | |
81 | + </a> | |
82 | + </li> | |
83 | + </ul> | |
84 | + </nav> | |
85 | + <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | |
86 | +</div> |
src/views/modal-estado-cuenta.html
... | ... | @@ -0,0 +1,82 @@ |
1 | +<div class="modal-header py-1"> | |
2 | + <div class="row w-100"> | |
3 | + <div class="col-lg-6"> | |
4 | + <h5 class="modal-title text-center my-1">Estado cuenta corriente</h5> | |
5 | + </div> | |
6 | + </div> | |
7 | +</div> | |
8 | +<div class="modal-body" id="modal-body"> | |
9 | + <div class="row m-3"> | |
10 | + <div class="col"> | |
11 | + <!-- <div class="row mb-2"> | |
12 | + <div class="col text-center"> | |
13 | + <p class="m-0">Autorizado</p> | |
14 | + <p class="h5 m-0" ng-bind="estadoCuenta.autorizado | currency"></p> | |
15 | + </div> | |
16 | + </div> --> | |
17 | + <div class="row mb-2"> | |
18 | + <div class="col text-center"> | |
19 | + <p class="m-0">Cliente</p> | |
20 | + <label class="h5" ng-bind="cliente.idCliente"></label> | |
21 | + <label class="h5"> - </label> | |
22 | + <label class="h5" ng-bind="cliente.nombreCliente"></label> | |
23 | + </div> | |
24 | + </div> | |
25 | + <div class="row border-top mb-2"> | |
26 | + <div class="col text-center"> | |
27 | + <p class="m-0">Saldo</p> | |
28 | + <p class="h5 m-0" ng-bind="estadoCuenta.saldo | currency"></p> | |
29 | + </div> | |
30 | + </div> | |
31 | + <!-- <div class="row border-top"> | |
32 | + <div class="col text-center"> | |
33 | + <p class="m-0">Situacion</p> | |
34 | + <h4> | |
35 | + <p | |
36 | + ng-show="estadoCuenta.situacion" | |
37 | + class="badge badge-success m-0 px-3">Permitido | |
38 | + </p> | |
39 | + <p | |
40 | + ng-show="!estadoCuenta.situacion" | |
41 | + class="badge badge-danger m-0 px-3">No permitido | |
42 | + </p> | |
43 | + </h4> | |
44 | + </div> | |
45 | + </div> | |
46 | + <div class="row border-top mb-2"> | |
47 | + <div class="col text-center"> | |
48 | + <p class="m-0">Facturas Vencidas</p> | |
49 | + <p class="h5 m-0" ng-bind="estadoCuenta.facturasVencidas | currency"></p> | |
50 | + </div> | |
51 | + </div> --> | |
52 | + </div> | |
53 | + </div> | |
54 | + <div class="row h-25 align-items-center mx-0 botonera-secundaria"> | |
55 | + <div class="col-6 col-sm-4 offset-sm-2"> | |
56 | + <button | |
57 | + type="button" | |
58 | + class="btn btn-sm btn-block btn-tarjeta rounded border p-1" | |
59 | + ng-disabled="!estadoCuenta.situacion" | |
60 | + ng-click="elegirTipoDePago({tipo: 'Contado', formaDePago: 1})" | |
61 | + > | |
62 | + <img ng-src="./img/contado.png" alt=""> | |
63 | + <p class="m-0">Contado</p> | |
64 | + </button> | |
65 | + </div> | |
66 | + <div class="col-6 col-sm-4"> | |
67 | + <button | |
68 | + type="button" | |
69 | + class="btn btn-sm btn-block btn-tarjeta rounded border p-1" | |
70 | + ng-disabled="!estadoCuenta.situacion" | |
71 | + foca-focus="true" | |
72 | + ng-click="elegirTipoDePago({tipo: 'Cuenta Corriente', formaDePago: 2})" | |
73 | + > | |
74 | + <img ng-src="./img/cuentaCorriente.png" alt=""> | |
75 | + <p class="m-0">Cta. Corriente</p> | |
76 | + </button> | |
77 | + </div> | |
78 | + </div> | |
79 | +</div> | |
80 | +<div class="modal-footer py-2"> | |
81 | + <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | |
82 | +</div> |
src/views/modal-seleccionar-cliente.html
... | ... | @@ -0,0 +1,13 @@ |
1 | +<div class="modal-header py-1"> | |
2 | + <div class="row w-100"> | |
3 | + <div class="col-lg-6"> | |
4 | + <h5 class="modal-title my-1">Seleccione Cliente</h5> | |
5 | + </div> | |
6 | + </div> | |
7 | +</div> | |
8 | +<div class="modal-body" id="modal-body"> | |
9 | + | |
10 | +</div> | |
11 | +<div class="modal-footer py-1"> | |
12 | + <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | |
13 | +</div> |
src/views/modal-ultimos-despachos.html
... | ... | @@ -0,0 +1,85 @@ |
1 | +<div class="modal-header py-1"> | |
2 | + <div class="row w-100"> | |
3 | + <div class="col-lg-6"> | |
4 | + <h5 class="modal-title my-1"><b>Últimos Despachos</b></h5> | |
5 | + </div> | |
6 | + </div> | |
7 | +</div> | |
8 | +<div class="modal-body" id="modal-body"> | |
9 | + <div ng-repeat="(key, producto) in productos"> | |
10 | + <div class="row pb-2 border-bottom"> | |
11 | + <div class="col"> | |
12 | + <p class="m-1 h6"> | |
13 | + <b> | |
14 | + <i class="fa fa-circle" aria-hidden="true"></i> {{producto.DetArt}} | |
15 | + </b> | |
16 | + </p> | |
17 | + </div> | |
18 | + </div> | |
19 | + <div class="row my-2" ng-repeat="(key, manguera) in producto.mangueras"> | |
20 | + <div class="col"> | |
21 | + <label> | |
22 | + <img class="w-50" ng-src="./img/surtidor.png" alt=""> | |
23 | + {{manguera.csu}} | |
24 | + </label> | |
25 | + <button | |
26 | + type="button" | |
27 | + class="btn p-1 text-secondary float-right border" | |
28 | + ng-click="manguera.show = !manguera.show"> | |
29 | + <i ng-show="manguera.show" class="fa fa-minus px-1"></i> | |
30 | + <i ng-show="!manguera.show" class="fa fa-plus px-1"></i> | |
31 | + </button> | |
32 | + <table class="table table-sm table-striped" ng-show="manguera.show"> | |
33 | + <tbody> | |
34 | + <tr ng-repeat="despacho in manguera.despachos"> | |
35 | + <td class="py-2 py-sm-1" ng-bind="despacho.FEC | date:'dd/MM/yyyy hh:MM:ss'"></td> | |
36 | + <td class="py-2 py-sm-1" ng-bind="despacho.LTS"></td> | |
37 | + <td class="py-2 py-sm-1" ng-bind="despacho.IMP | currency: '$'"></td> | |
38 | + <td class="py-2 py-sm-1"> | |
39 | + <button | |
40 | + type="button" | |
41 | + class="btn btn-default btn-xs p-1 float-right" | |
42 | + title="Seleccionar" | |
43 | + ng-click="aceptar(producto)" | |
44 | + ><i class="fa fa-circle-thin" aria-hidden="true"></i> | |
45 | + </button> | |
46 | + </td> | |
47 | + </tr> | |
48 | + </tbody> | |
49 | + </table> | |
50 | + </div> | |
51 | + </div> | |
52 | + </div> | |
53 | + | |
54 | +</div> | |
55 | +<div class="modal-footer py-2"> | |
56 | + <nav ng-show="currentPageProveedores.length > 0 && primerBusqueda" class="mr-auto"> | |
57 | + <ul class="pagination pagination-sm mb-0"> | |
58 | + <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | |
59 | + <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | |
60 | + <span aria-hidden="true">«</span> | |
61 | + <span class="sr-only">Anterior</span> | |
62 | + </a> | |
63 | + </li> | |
64 | + <li | |
65 | + class="page-item" | |
66 | + ng-repeat="pagina in paginas" | |
67 | + ng-class="{'active': pagina == currentPage}" | |
68 | + > | |
69 | + <a | |
70 | + class="page-link" | |
71 | + href="javascript:void();" | |
72 | + ng-click="selectPage(pagina)" | |
73 | + ng-bind="pagina" | |
74 | + ></a> | |
75 | + </li> | |
76 | + <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | |
77 | + <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | |
78 | + <span aria-hidden="true">»</span> | |
79 | + <span class="sr-only">Siguiente</span> | |
80 | + </a> | |
81 | + </li> | |
82 | + </ul> | |
83 | + </nav> | |
84 | + <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | |
85 | +</div> |