1836 Commits

Author SHA1 Message Date
26249c893c Merge branch 'fix/factor' into 'main'
resuelto: no hay que sumar las horas para el calculo del divisor del factor

See merge request jjimenez/safekat!875
2025-07-01 12:19:24 +00:00
b9360ef7e5 resuelto: no hay que sumar las horas para el calculo del divisor del factor 2025-07-01 14:19:03 +02:00
911124287f resuelto: no hay que sumar las horas para el calculo del divisor del factor 2025-07-01 14:16:55 +02:00
055274d6df Merge branch 'mod/costes_margenes' into 'main'
Mod/costes margenes

See merge request jjimenez/safekat!874
2025-07-01 09:54:51 +00:00
f900ace902 limitar descuento a total margen 2025-07-01 11:49:20 +02:00
401c2c8f5a desglosados costes y margenes impresion 2025-07-01 11:02:59 +02:00
594da68b3a desglosados costes y margenes impresion 2025-07-01 11:02:03 +02:00
34701e5960 Merge branch 'mod/lineas_presupuesto_costes_margenes' into 'main'
coste-margen de clicks y horas en las lineas y añadidos colores. se toca...

See merge request jjimenez/safekat!873
2025-06-30 14:26:06 +00:00
364b9f8ccd coste-margen de clicks y horas en las lineas y añadidos colores. se toca resumen para que todo cuadrea con lo nuevo 2025-06-30 16:25:42 +02:00
b3336273d0 Merge branch 'fix/cambio_sobrecubierta_infinite_loop' into 'main'
arreglado

See merge request jjimenez/safekat!872
2025-06-30 10:20:13 +00:00
bbd2a389af arreglado 2025-06-30 12:19:53 +02:00
8007e33760 Merge branch 'fix/change_limite_paginas' into 'main'
arreglado

See merge request jjimenez/safekat!871
2025-06-30 10:13:58 +00:00
266e872f8f arreglado 2025-06-30 12:13:23 +02:00
b11b1807d8 Merge branch 'fix/change_faja_infinite_loop' into 'main'
arreglado el bucle infinito the change faja

See merge request jjimenez/safekat!870
2025-06-30 09:47:47 +00:00
f5a58dc32d arreglado el bucle infinito the change faja 2025-06-30 11:47:20 +02:00
102ba8267b Merge branch 'mod/presupuesto_catalogoId' into 'main'
Mod/presupuesto catalogo

See merge request jjimenez/safekat!869
2025-06-29 21:27:23 +00:00
508758331d Añadida la logica en importador de RAMA 2025-06-29 23:27:03 +02:00
416b4db915 Añadida la logica de crear la columna y modelo 2025-06-29 23:09:09 +02:00
4e2003b8b8 Merge branch 'fix/forzar_rotativa_obtener_interior_cliente' into 'main'
corregidos varios fallos que no permitian cogetr la rotativa cuando es un...

See merge request jjimenez/safekat!868
2025-06-28 10:46:15 +00:00
5590076d7d corregidos varios fallos que no permitian cogetr la rotativa cuando es un presupuesto con forzar_rotativa_pod 2025-06-28 12:45:52 +02:00
ddf3255a8a Merge branch 'mod/presupuesto_cliente' into 'main'
Mod/presupuesto cliente

See merge request jjimenez/safekat!867
2025-06-28 09:59:48 +00:00
4694d62cd4 Merge branch 'main' into mod/presupuesto_cliente 2025-06-28 11:52:34 +02:00
0c85af66da Merge branch 'fix/importador_erpold_gramajes' into 'main'
modificado error de obtener gramajes en comparador cubierta. tambien corregido...

See merge request jjimenez/safekat!866
2025-06-28 09:51:28 +00:00
f6ffa20d5f modificado error de obtener gramajes en comparador cubierta. tambien corregido problema con la obtencion de gramajes en presupuesto admin que no cogia el valor de las solapas 2025-06-28 11:50:59 +02:00
53ec5945e8 trabajando en el formulario envio de ferros 2025-06-28 11:29:21 +02:00
9fcda514f0 guardando direcciones ferro en presupuesto cliente 2025-06-28 11:27:39 +02:00
410d21dc5f trabajando en las direcciones ferro / prototipo 2025-06-27 12:44:55 +02:00
4a60bcdd61 corregido el texto del error del tipo de libro y que se borre el error 2025-06-27 08:38:23 +02:00
33a196667e modificado archivo de config para evitar error 2025-06-26 09:34:41 +02:00
03b43de185 terminado datosGenerales para la validacion 2025-06-26 08:58:13 +02:00
2d267386a6 nuevo docker 2025-06-25 18:27:17 +02:00
7e82142b38 nuevo docker 2025-06-25 18:26:27 +02:00
b240107565 Merge branch 'main' into mod/presupuesto_cliente 2025-06-25 13:55:54 +02:00
647c0bd72d trabajando en la validación de los datosgenerales 2025-06-25 13:55:31 +02:00
847b476341 Merge branch 'fix/historico_catalogo' into 'main'
Filtrando por estados finalizados para catalogo del ERP antiguo

See merge request jjimenez/safekat!865
2025-06-25 09:21:49 +00:00
6081a34c05 Filtrando por estados finalizados para catalogo del ERP antiguo 2025-06-25 11:20:05 +02:00
c3bce03921 terminada validación nueva en diseniocubierta 2025-06-25 11:14:09 +02:00
0b598e14d7 Merge branch 'main' into mod/presupuesto_cliente 2025-06-25 10:06:42 +02:00
83753d1784 trabajando en cubierta 2025-06-25 10:06:21 +02:00
c35e683089 Merge branch 'imnavajas-main-patch-59857' into 'main'
Delete wire-o.png:Zone.Identifier

See merge request jjimenez/safekat!864
2025-06-25 08:05:31 +00:00
c9b822c9c2 Delete wire-o.png:Zone.Identifier 2025-06-25 08:05:16 +00:00
ff9ce9eda2 trabajando en la cubierta 2025-06-25 07:50:01 +02:00
41fde19f43 modificado disenio interior para que borre los errores 2025-06-24 17:56:22 +02:00
3b0da8d560 Merge branch 'mod/pedidos_produccion_a_facturas' into 'main'
corregidos varios problemas con los presupuestos (calculo envio base debido al...

See merge request jjimenez/safekat!863
2025-06-24 15:07:20 +00:00
fc68676c29 hecho 2025-06-24 17:05:53 +02:00
365a487791 Merge branch 'main' into mod/presupuesto_cliente 2025-06-24 13:52:22 +02:00
9c505584b1 Merge branch 'fix/lista_maquinas_en_papeles_solo_imp' into 'main'
Fix/lista maquinas en papeles solo imp

See merge request jjimenez/safekat!862
2025-06-24 11:51:43 +00:00
94b72073e4 terminado 2025-06-24 13:50:47 +02:00
0b3574ca63 resolviendo errores 2025-06-24 13:44:20 +02:00
cf8ddb3156 añadidos js para edit y add 2025-06-24 13:34:57 +02:00
fd81a188d4 Merge branch 'main' into mod/presupuesto_cliente 2025-06-24 13:09:59 +02:00
4bfc679c3e los acabados tienen que tener el check de mostrar en cliente a 1. Además se ha corregido un error al editar este check dentro de los servicios de acabado 2025-06-24 13:06:46 +02:00
819f297e90 añadido checkeo de lomo en presupuesto admin 2025-06-23 18:33:46 +02:00
da0ca27c8c correjidas cosas en cuanto a mostrar lomo. También añadido calculo de paginas pares 2025-06-20 19:51:32 +02:00
75ac2e0218 añadida migración para el tamaño de los lomos. Cambiado nombre de variables en el codigo también 2025-06-20 18:46:05 +02:00
d89d140dac arreglado el calculo del coste del envio para cuando hay más tiradas 2025-06-19 21:50:07 +02:00
4da6ee19c6 arreglado vista del mensaje de lomo máximo 2025-06-19 17:39:18 +02:00
4fde46a222 quitado d-flex para que hide() funcione en tipodelibro 2025-06-19 16:26:30 +02:00
55b10a7266 añadido wire-o 2025-06-18 13:44:03 +02:00
219bdfeaa3 añadida imagen wire-o 2025-06-18 09:45:50 +02:00
1f5a625513 arreglado total aceptado 2025-06-18 09:36:12 +02:00
beefc2f416 arreglado resumen de cliente y mensaje de cubierta sin plastificado 2025-06-18 09:29:16 +02:00
73fe7e5097 se añaden los limites del numero de paginas en el presupuesto admin dependiendo del tipo de libro 2025-06-17 10:40:33 +02:00
7d1eef9b28 grapado sólo tapa blanda 2025-06-17 09:38:44 +02:00
018119a3c3 corregidos varios problemas con los presupuestos (calculo envio base debido al peso de las guardas, resumen, etc) 2025-06-16 20:19:39 +02:00
b2652fc277 solucionado problema con solapas 2025-06-16 15:13:23 +02:00
6c020375be Merge branch 'bug/delete_maquina' into 'main'
Arreglada url delete

See merge request jjimenez/safekat!861
2025-06-13 06:44:07 +00:00
45bd973507 Arreglada url delete 2025-06-13 08:43:20 +02:00
75020a075c validación correcta. Falta que no se guardan las solapas 2025-06-12 19:30:01 +02:00
900e0b373e Merge branch 'main' into mod/presupuesto_cliente 2025-06-12 15:32:26 +02:00
00073b3f7e modificado mensaje de cubierta sin acabado 2025-06-12 15:31:56 +02:00
154dfd14f6 Merge branch 'feat/backups' into 'main'
Feat/backups

See merge request jjimenez/safekat!860
2025-06-12 12:58:16 +00:00
8288219872 Implementada logica para entornos dev/prod 2025-06-12 14:57:48 +02:00
db91776747 terminada validación de cubierta 2025-06-12 13:49:56 +02:00
70087a24b6 modificado para que no checkee en el interior si ha habido problema previo 2025-06-11 20:11:50 +02:00
505cc6fb31 terminados datos generales e interior 2025-06-11 20:08:17 +02:00
b0bceb20bc Merge branch 'feat/backups' of https://git.imnavajas.es/jjimenez/safekat into feat/backups 2025-06-10 20:37:47 +02:00
b31d9b94eb Merge branch 'main' into feat/backups 2025-06-10 20:37:35 +02:00
ae60955b3f Merge branch 'fix/review_OT_tables' into 'main'
cambiadas las query de las OTs

See merge request jjimenez/safekat!858
2025-06-10 18:37:11 +00:00
ee4de11cca cambiadas las query de las OTs 2025-06-10 20:36:41 +02:00
7aa577f316 Avances 2025-06-10 15:10:19 +02:00
882cc913de Merge branch 'main' into feat/backups 2025-06-09 21:25:27 +02:00
4fe8930217 Merge branch 'fix/tiempo_tarea_maquinista' into 'main'
corregido el error de que añadía el tiempo desde la parada a la finalización...

See merge request jjimenez/safekat!857
2025-06-09 19:21:53 +00:00
0bcd9899ef corregido el error de que añadía el tiempo desde la parada a la finalización en la tarea del maquinista. También se cambia el label del boton continuar dependiendo si la tarea está pendiente o pausada 2025-06-09 21:21:13 +02:00
6967a61d93 Avances 2025-06-09 15:18:12 +02:00
e53626bbfe Merge branch 'main' into 'feat/backups'
arreglado albaranes para que muestren las cajas. tambien se ha actualizado...

See merge request jjimenez/safekat!856
2025-06-09 08:08:21 +00:00
808bcd3847 Merge branch 'fix/update_ot_object_after_reset_tareas' into 'main'
reinicialización del servicio después de resetear las tareas

See merge request jjimenez/safekat!855
2025-06-07 09:41:52 +00:00
e0974068a0 reinicialización del servicio después de resetear las tareas 2025-06-07 11:40:59 +02:00
d3bcd295cb Merge branch 'fix/orden_trabajo_tareas_tiempo_estimado' into 'main'
solucionado el problema que al borrar una fecha de la OT se quedaba en caché...

See merge request jjimenez/safekat!853
2025-06-07 09:27:18 +00:00
6a3a10c7e8 solucionado el problema que al borrar una fecha de la OT se quedaba en caché el objeto anterior y no actualizaba el progreso 2025-06-07 11:26:52 +02:00
e2ff0f6667 Merge branch 'main' into fix/orden_trabajo_tareas_tiempo_estimado 2025-06-06 15:15:56 +02:00
3a0f355ffe Merge branch 'mod/registro' into 'main'
Deshabilitado registro

See merge request jjimenez/safekat!852
2025-06-06 08:45:49 +00:00
87661d855d Deshabilitado registro 2025-06-06 10:45:22 +02:00
95ffb22c84 Merge branch 'fix/versioned_assets' into 'main'
Fix/versioned assets

See merge request jjimenez/safekat!851
2025-06-06 08:03:58 +00:00
0e802f791b Aplicado a JS estaticos 2025-06-06 09:12:51 +02:00
5a9326ae82 Añadido helper de gestion de assets caducados e implementado en CSS de PDFs 2025-06-06 09:06:28 +02:00
06ba0c0500 realizados cambios para que se calcule el tiempo estimado 2025-06-05 23:48:21 +02:00
760144b5fc Merge branch 'fix/pdf_ot_albaranes' into 'main'
arreglado albaranes para que muestren las cajas. tambien se ha actualizado...

See merge request jjimenez/safekat!850
2025-06-05 19:27:29 +00:00
49140cea40 arreglado albaranes para que muestren las cajas. tambien se ha actualizado para que cuando se modifiquen las cajas de la linea se modifiquen el total del albarán 2025-06-05 21:25:48 +02:00
6a9331747e solucionado el problema de la impresion de las ots 2025-06-05 18:57:03 +02:00
fb292520a2 Merge branch 'feat/albaran_anonimo' into 'main'
Feat/albaran anonimo

See merge request jjimenez/safekat!849
2025-06-05 09:45:28 +00:00
909228512c Feedback JM 2025-06-05 11:45:00 +02:00
602fb591f9 Añadida funcionalidad de albaran anonimo y corregidos bugs 2025-06-05 11:38:16 +02:00
764d5c8f29 Merge branch 'bug/catalogo_historico' into 'main'
Arreglado precio ud en tabla

See merge request jjimenez/safekat!848
2025-06-05 07:30:24 +00:00
b1cd63f665 Arreglado precio ud en tabla 2025-06-05 09:28:30 +02:00
5058ae488b Merge branch 'mod/historico_catalogo' into 'main'
Mod/historico catalogo

See merge request jjimenez/safekat!847
2025-06-05 06:44:59 +00:00
10889a9e7f Refactorizazion 2025-06-05 08:44:34 +02:00
8d363b8abd Merge branch 'main' into 'mod/historico_catalogo'
Main

See merge request jjimenez/safekat!846
2025-06-04 21:30:11 +00:00
63866b6f2f COrregidos cambios JM 2025-06-04 23:27:31 +02:00
4e65361df8 Merge branch 'fix/error_en_pais_save_direccionecliente_presupuestoadmin' into 'main'
solucionado

See merge request jjimenez/safekat!845
2025-06-04 13:51:48 +00:00
391927aaf6 solucionado 2025-06-04 15:51:21 +02:00
96e12c0192 Merge branch 'feat/catalogo_historico_pedidos' into 'main'
Feat/catalogo historico pedidos

See merge request jjimenez/safekat!844
2025-06-04 13:22:38 +00:00
7f88ea7296 Merge branch 'main' into 'feat/catalogo_historico_pedidos'
Main

See merge request jjimenez/safekat!843
2025-06-04 13:21:11 +00:00
884f9f1a67 Merge branch 'fix/view_all_tickets_cliente' into 'main'
resuelto el problema de que los clientes veian todos los tickets

See merge request jjimenez/safekat!842
2025-06-03 13:17:36 +00:00
c5dc026c33 resuelto el problema de que los clientes veian todos los tickets 2025-06-03 15:17:11 +02:00
5fbb6cc854 Merge branch 'fix/add_presupuesto_tirada_0' into 'main'
arreglada la comprobación de páginas y tirada cuando se añade un presupuesto

See merge request jjimenez/safekat!841
2025-06-03 11:42:52 +00:00
40439b532f arreglada la comprobación de páginas y tirada cuando se añade un presupuesto 2025-06-03 13:41:52 +02:00
84693d5c6c Iniciada implementacion de recuperacion de historicos erp antiguo 2025-06-03 11:24:44 +02:00
2c711c526b Merge branch 'mod/iskn2' into 'main'
Eliminado contexto libro por defecto

See merge request jjimenez/safekat!840
2025-06-02 09:30:59 +00:00
a12f034daa Eliminado contexto libro por defecto 2025-06-02 11:30:36 +02:00
e732b36ece Merge branch 'mod/iskn' into 'main'
Modificaciones en html

See merge request jjimenez/safekat!839
2025-06-02 09:16:29 +00:00
5fcc1bdd9d Modificaciones en html 2025-06-02 11:16:10 +02:00
da57cb23ee Merge branch 'feat/importador_libros_catalogo_antiguo' into 'main'
Feat/importador libros catalogo antiguo

See merge request jjimenez/safekat!838
2025-06-02 09:13:15 +00:00
e1aa62f198 Cambio de isk a iskn, añadido comando generador de iskn en libros del catalogo que no lo tengan 2025-06-02 11:12:45 +02:00
50e8c35ef3 Merge branch 'feat/maquinas-corte-ot' into 'main'
Feat/maquinas corte ot

See merge request jjimenez/safekat!837
2025-05-31 06:38:02 +00:00
f10d584453 Merge branch 'fix/planning-plana-select-maquina-papel' into feat/maquinas-corte-ot 2025-05-31 08:35:50 +02:00
67c4b4bc93 add filter padre - hija - papel 2025-05-31 08:35:01 +02:00
23a577b55e tareas corte y tiempo procesamiento 2025-05-31 07:58:43 +02:00
6ca84232fa Merge branch 'mod/reimpresion_mensaje_duplicado' into 'main'
añadido mensaje cuando es un duplicado

See merge request jjimenez/safekat!836
2025-05-30 15:42:33 +00:00
95e153adbb añadido mensaje cuando es un duplicado 2025-05-30 17:41:55 +02:00
4e8265d8a5 Merge branch 'main' into feat/maquinas-corte-ot 2025-05-30 17:00:31 +02:00
e9986dd3bb Merge branch 'fix/maquina-padre-hijo-select' into 'main'
Fix/maquina padre hijo select

See merge request jjimenez/safekat!835
2025-05-30 14:58:49 +00:00
96bc9cde73 Merge branch 'main' into fix/maquina-padre-hijo-select 2025-05-30 16:57:51 +02:00
b9c18bf78c fix 2025-05-30 16:57:08 +02:00
784789841d Merge branch 'fix/hasFiles_false_reimpresion_3' into 'main'
cambiado reimprimir

See merge request jjimenez/safekat!834
2025-05-30 13:33:46 +00:00
744680198b cambiado reimprimir 2025-05-30 15:33:28 +02:00
f42063dd4c Merge branch 'fix/hasFiles_false_reimpresion_2' into 'main'
Fix/has files false reimpresion 2

See merge request jjimenez/safekat!833
2025-05-30 13:15:43 +00:00
53ce60f6de cuando no tiene ficheros reimprimir directamente 2025-05-30 15:15:28 +02:00
b5128bdcaf cuando no tiene ficheros reimprimir directamente 2025-05-30 15:15:10 +02:00
1350c04060 Merge branch 'fix/hasFiles_false_reimpresion' into 'main'
Fix/has files false reimpresion

See merge request jjimenez/safekat!832
2025-05-30 13:11:46 +00:00
8ab2c28686 cuando no tiene ficheros reimprimir directamente 2025-05-30 15:11:19 +02:00
b7563598e0 cuando no tiene ficheros reimprimir directamente 2025-05-30 15:10:34 +02:00
192525ebae Merge branch 'fix/error_reimpresion' into 'main'
si no se usan los mismos archivos no es reimpresion

See merge request jjimenez/safekat!831
2025-05-30 12:55:49 +00:00
78c4082596 si no se usan los mismos archivos no es reimpresion 2025-05-30 14:55:29 +02:00
e0da3b56c7 Merge branch 'feat/boton_reimprimir' into 'main'
terminada funcionalidad reimpresion presupuestos

See merge request jjimenez/safekat!830
2025-05-30 12:53:08 +00:00
be16690f73 terminada funcionalidad reimpresion presupuestos 2025-05-30 14:52:48 +02:00
aaf2ee6fd3 Implementando comando 2025-05-30 14:34:48 +02:00
81393317b7 Merge branch 'fix/planning-plana' into 'main'
Fix/planning plana

See merge request jjimenez/safekat!829
2025-05-30 09:47:33 +00:00
2f1b34f668 Merge branch 'main' into fix/planning-plana 2025-05-30 11:46:56 +02:00
52c53e6920 feat: add filter maquina plana 2025-05-30 11:45:48 +02:00
3b43551064 Merge branch 'mod/calculo_merma' into 'main'
cuando la tirada es 1 la merma es 0

See merge request jjimenez/safekat!828
2025-05-30 09:32:16 +00:00
e5389db7be cuando la tirada es 1 la merma es 0 2025-05-30 11:31:53 +02:00
3db124ea24 add maquinas default corte 2025-05-30 07:31:18 +02:00
cd0a1c3c2a Merge branch 'fix/uri_duplicar_maquinas' into 'main'
cambio realizado. también se arregla que se pueda dejar null el alias_ot

See merge request jjimenez/safekat!827
2025-05-27 10:17:56 +00:00
97568151a6 cambio realizado. también se arregla que se pueda dejar null el alias_ot 2025-05-27 12:17:36 +02:00
a6fc99e726 Merge branch 'fix/migrate_albaranes' into 'main'
solucionado el nombre de la clase

See merge request jjimenez/safekat!826
2025-05-27 09:08:49 +00:00
a86bdcac53 solucionado el nombre de la clase 2025-05-27 11:08:25 +02:00
303fde9861 Merge branch 'mod/logistica_v2' into 'main'
Mod/logistica v2

See merge request jjimenez/safekat!825
2025-05-26 19:10:11 +00:00
0cd68f369e añadida la migración de las lineas de albaran 2025-05-26 21:09:44 +02:00
6dc91bfa4c terminada la modificacion de las lineas de albaran 2025-05-26 21:09:24 +02:00
43e0ced1bd añadido mensaje en comentarios logistica para tirada flexible 2025-05-26 20:23:15 +02:00
981eb30c02 Merge branch 'mod/permisos' into 'main'
Añadidos permisos para logistica e importadores

See merge request jjimenez/safekat!824
2025-05-23 13:30:45 +00:00
e070e5101e Añadidos permisos para logistica e importadores 2025-05-23 14:45:13 +02:00
55ac2b4bcb Merge branch 'mod/download_file' into 'main'
Añadida funcionalidad de descarga por archivo

See merge request jjimenez/safekat!823
2025-05-23 11:39:18 +00:00
4da8981cd8 Añadida funcionalidad de descarga por archivo 2025-05-23 13:38:13 +02:00
e625dd1e76 Merge branch 'feat/download_zip' into 'main'
Implementada funcionalidad descarga en zip

See merge request jjimenez/safekat!822
2025-05-22 20:10:26 +00:00
e3c202ae64 Implementada funcionalidad descarga en zip 2025-05-22 22:10:14 +02:00
b084d1bd7c Merge branch 'feat/update-ot-flow' into 'main'
Feat/update ot flow

See merge request jjimenez/safekat!821
2025-05-22 16:41:34 +00:00
611df53de1 Merge branch 'main' into feat/update-ot-flow 2025-05-22 18:34:08 +02:00
aba97202cc Merge branch 'main' of https://git.imnavajas.es/jjimenez/safekat 2025-05-22 18:33:44 +02:00
b775f65b3a fix title size 2025-05-22 18:32:48 +02:00
690eaf4195 update flow tareas orden trabajo con tareas de corte final y tras impresión 2025-05-22 17:47:35 +02:00
1e47b58400 Merge branch 'mod/importar_presup_borrador' into 'main'
cambio realizado

See merge request jjimenez/safekat!820
2025-05-22 11:56:50 +00:00
dd530b8b89 cambio realizado 2025-05-22 13:56:20 +02:00
e33e5e0840 Merge branch 'mod/mensajes_confirmacion_envios' into 'main'
añadido mensajeria

See merge request jjimenez/safekat!819
2025-05-21 19:25:39 +00:00
2faa88297e añadido mensajeria 2025-05-21 21:25:02 +02:00
306ae02a10 Merge branch 'mod/nombre_impresoras' into 'main'
Añadida descripcion en el select de las impresoras

See merge request jjimenez/safekat!818
2025-05-21 07:05:13 +00:00
242029714d Añadida descripcion en el select de las impresoras 2025-05-21 09:04:50 +02:00
edbca8fc6e Merge branch 'feat/bubok_files' into 'main'
Implementada funcionalidad

See merge request jjimenez/safekat!817
2025-05-21 06:24:11 +00:00
cb17d661a8 Implementada funcionalidad 2025-05-20 14:31:17 +02:00
5f76e0e437 add chat direct 2025-05-20 00:01:26 +02:00
976c7980d4 activate ot download 2025-05-19 23:05:02 +02:00
42edf2bbc0 add alias_ot to maquina code header in pdf and seeder to update alias in lg_maquinas 2025-05-19 21:13:21 +02:00
64337257ee add alias_ot field to lg_maquinas 2025-05-19 20:57:40 +02:00
2ef98a9496 fix pdf font sizes and updated info 2025-05-19 20:47:19 +02:00
b500229b37 Merge branch 'mod/logistica' into 'main'
Mod/logistica

See merge request jjimenez/safekat!815
2025-05-19 16:43:04 +00:00
438000ebad hecho lo de proximos envios 2025-05-19 18:41:48 +02:00
decdcf3703 trabajando en la lista de envios proximos 2025-05-15 23:55:09 +02:00
f5a015bc6d Merge branch 'fix/username' into 'main'
Fixed campo secret para obtener el email

See merge request jjimenez/safekat!814
2025-05-15 17:39:19 +00:00
359e13260f Fixed campo secret para obtener el email 2025-05-15 18:02:32 +02:00
cfdc8d64e1 Merge branch 'mod/ref_cliente_buscador' into 'main'
Cambiado pais por referencia cliente en el buscador de presupuestos

See merge request jjimenez/safekat!813
2025-05-14 18:38:55 +00:00
22bdb9b960 Cambiado pais por referencia cliente en el buscador de presupuestos 2025-05-14 20:38:39 +02:00
1991691533 Merge branch 'fix/faja_always_on' into 'main'
Fix/faja always on

See merge request jjimenez/safekat!812
2025-05-14 12:04:16 +00:00
760b9bdd94 arreglado también problema de sobrecubierta en importador rama 2025-05-14 13:57:33 +02:00
ce124cb38a resuelto 2025-05-14 13:49:08 +02:00
778ef712e9 Merge branch 'mod/facturas_rectificativas_conformar' into 'main'
terminado

See merge request jjimenez/safekat!811
2025-05-13 18:19:12 +00:00
bc7929f44b terminado 2025-05-13 20:18:44 +02:00
438e696e88 Merge branch 'feat/link_facturas' into 'main'
Añadidos enlaces a facturas rectificativas/rectificadas

See merge request jjimenez/safekat!810
2025-05-13 13:40:27 +00:00
199e5f2018 Añadidos enlaces a facturas rectificativas/rectificadas 2025-05-13 15:40:04 +02:00
cb15fbe94a Merge branch 'fix/importador_bubok' into 'main'
Fix/importador bubok

See merge request jjimenez/safekat!809
2025-05-13 11:29:53 +00:00
fa77952ea6 Corregidos bugs y homegeneizado 2025-05-13 13:28:54 +02:00
88d6b69857 Merge branch 'main' into fix/importador_bubok 2025-05-13 09:05:32 +02:00
7ffaec042c Merge branch 'import/usuarios_sk' into 'main'
Subido script para comprobar identidades

See merge request jjimenez/safekat!808
2025-05-13 06:44:35 +00:00
6ba2694733 Subido script para comprobar identidades 2025-05-12 22:36:07 +02:00
15ce7ed670 Merge branch 'fix/listado_facturas_pedidos' into 'main'
arreglado

See merge request jjimenez/safekat!807
2025-05-12 19:33:21 +00:00
565ef7f170 arreglado 2025-05-12 21:32:59 +02:00
f3c92fa205 Merge branch 'fix/facturas' into 'main'
arreglado el tema de las facturas rectificadas/rectificativas

See merge request jjimenez/safekat!806
2025-05-12 17:19:42 +00:00
6ee4b1e89d arreglado el tema de las facturas rectificadas/rectificativas 2025-05-12 19:19:12 +02:00
d253183ab6 Merge branch 'fix/rama_loader' into 'main'
Implementados cambios del loader

See merge request jjimenez/safekat!805
2025-05-12 13:16:50 +00:00
3e6ba658cd Implementados cambios del loader 2025-05-12 15:16:28 +02:00
de536b894d Merge branch 'feat/add-datatable-ot-header-filters' into 'main'
Feat/add datatable ot header filters

See merge request jjimenez/safekat!804
2025-05-10 07:32:40 +00:00
836ace0e42 add check preimpresion when imported from Bubok or Catalogo 2025-05-10 09:27:40 +02:00
bbea2229d7 remove preimpresion check default when create an ot 2025-05-10 09:25:32 +02:00
90a47aa6bb add datatable ot filters 2025-05-10 09:23:59 +02:00
59609df471 Añadidas modificaciones para PDF y bug detectado 2025-05-09 13:54:41 +02:00
43ae427137 Merge branch 'fix/importador_rama_tarifa' into 'main'
Fix/importador rama tarifa

See merge request jjimenez/safekat!803
2025-05-09 10:32:48 +00:00
36a2740eb7 Añadido selector de calidad 2025-05-09 12:32:07 +02:00
0a9d1ef68d Redondeo de precio tarifa a 2 decimales 2025-05-08 22:10:01 +02:00
a9d9dbab5c Merge branch 'fix/importador_rama_tarifa' of https://git.imnavajas.es/jjimenez/safekat into fix/importador_rama_tarifa 2025-05-08 22:07:46 +02:00
79dc8ca713 Añadida tarifa hardcoded 2025-05-08 22:07:26 +02:00
f7d08b9c79 Merge branch 'mod/selector_calidad' into 'main'
añadido cambio de calidad en importador erp antiguo. falta añadirlo a rama y bubok

See merge request jjimenez/safekat!802
2025-05-08 18:17:26 +00:00
f4ef874568 añadido cambio de calidad en importador erp antiguo. falta añadirlo a rama y bubok 2025-05-08 20:16:40 +02:00
6537e16a0a Merge branch 'fix/calculo_merma_sin_formas' into 'main'
corregido

See merge request jjimenez/safekat!801
2025-05-08 11:19:25 +00:00
5d228cc10c corregido 2025-05-08 13:18:33 +02:00
ed9f67badd Merge branch 'feat/scripts_varios' into 'main'
Creados scripts

See merge request jjimenez/safekat!800
2025-05-07 09:52:18 +00:00
ff7ed8f594 Creados scripts 2025-05-07 11:51:52 +02:00
ec4d00e0ab Merge branch 'fix/pod_en_plana' into 'main'
terminado

See merge request jjimenez/safekat!799
2025-05-06 14:19:32 +00:00
85318aa10e terminado 2025-05-06 16:18:32 +02:00
a4782358c6 Merge branch 'fix/asunto_tickets' into 'main'
terminado

See merge request jjimenez/safekat!798
2025-05-06 14:05:18 +00:00
528f117c7c terminado 2025-05-06 16:04:25 +02:00
6775646ec3 Merge branch 'fix/ruta_paises_esta_en_configuracion' into 'main'
arraglado

See merge request jjimenez/safekat!797
2025-05-06 12:21:58 +00:00
efef0c0199 arraglado 2025-05-06 14:20:25 +02:00
5057586987 Merge branch 'fix/resumen_no_envio_base' into 'main'
cuando se añade más de una direccion y tiene el cliente marcado que no tenga...

See merge request jjimenez/safekat!794
2025-05-06 12:00:33 +00:00
15227998aa cuando se añade más de una direccion y tiene el cliente marcado que no tenga envio base, se suman las dos direcciones al presupuesto 2025-05-06 14:00:03 +02:00
456dc7ff18 Merge branch 'add/margen_precio_min' into 'main'
Add/margen precio min

See merge request jjimenez/safekat!793
2025-05-06 11:21:26 +00:00
89bcd0bda1 resuelto 2025-05-06 13:20:48 +02:00
1a1f5947a0 arreglado 2025-05-06 13:11:31 +02:00
999553f767 Merge branch 'fix/importe_minimo_es_coste' into 'main'
puesto como precio minimo el coste

See merge request jjimenez/safekat!792
2025-05-06 11:07:10 +00:00
89e6d0787a puesto como precio minimo el coste 2025-05-06 13:06:48 +02:00
cbe8ee0f5c Merge branch 'mod/importe_fijo_margen' into 'main'
Mod/importe fijo margen

See merge request jjimenez/safekat!791
2025-05-06 10:50:37 +00:00
51d0a1bcfe Merge branch 'main' into mod/importe_fijo_margen 2025-05-06 12:28:58 +02:00
eeba76b124 arreglado servicios de encuadernacion 2025-05-06 12:28:03 +02:00
33a3ccb832 Merge branch 'fix/comercial_id' into 'main'
Expuestos campos ID y PrecioTonelada en visualizacion de papeles de impresion

See merge request jjimenez/safekat!790
2025-05-06 10:23:14 +00:00
d3dd18a156 Expuestos campos ID y PrecioTonelada en visualizacion de papeles de impresion 2025-05-06 12:23:00 +02:00
cab7bc3daf Arreglado bug en listado de comerciales en vista diferente al buscador de presupuestos 2025-05-06 12:09:54 +02:00
804d8ba28b Merge branch 'fix/comercial_id' into 'main'
Arreglado bug en listado de comerciales en vista diferente al buscador de presupuestos

See merge request jjimenez/safekat!789
2025-05-06 10:09:52 +00:00
7101c8934e Merge branch 'fix/user_id_presupuestos_2' into 'main'
Al crear un presupuesto hay que fijar el user_update_id. FIXED

See merge request jjimenez/safekat!788
2025-05-06 08:55:21 +00:00
20594bd44c Al crear un presupuesto hay que fijar el user_update_id. FIXED 2025-05-06 10:55:21 +02:00
c2011e1c25 Merge branch 'fix/user_id_presupuestos' into 'main'
Añadidos IDs de los usuarios creador y actualizador al guardar desde presupuesto cliente

See merge request jjimenez/safekat!787
2025-05-06 08:17:37 +00:00
8b340b76d3 Añadidos IDs de los usuarios creador y actualizador al guardar desde presupuesto cliente 2025-05-06 10:17:33 +02:00
5ae2827623 Merge branch 'fix/ot-progress' into 'main'
Fix/ot progress

See merge request jjimenez/safekat!786
2025-05-06 08:07:57 +00:00
f6b8d2ba85 columns searching and ordering ots 2025-05-06 10:06:33 +02:00
ddd7c471a1 progress ot 2025-05-06 08:40:07 +02:00
30c5b06d3d update progress based on task time and task date 2025-05-06 08:30:01 +02:00
aac8ab24be Merge branch 'feat/ot-pdf-zip' into 'main'
Feat/ot pdf zip

See merge request jjimenez/safekat!785
2025-05-05 19:01:26 +00:00
99ffe1f462 Merge branch 'main' into feat/ot-pdf-zip 2025-05-05 21:00:33 +02:00
caac71a48d zip pdf download 2025-05-05 20:59:57 +02:00
478077721b Merge branch 'fix/varios' into 'main'
Fix/varios

See merge request jjimenez/safekat!784
2025-05-05 18:14:05 +00:00
10b5ae911a Añadidas mejoras propuestas por Manolo a la importacion de RAMA 2025-05-05 20:13:59 +02:00
43fef3a1a0 Merge branch 'fix/impresion_titulos' into 'main'
Fix/impresion titulos

See merge request jjimenez/safekat!783
2025-05-05 17:45:32 +00:00
c6fb4b3213 terminado 2025-05-05 19:42:45 +02:00
247fa7e6f9 prueba2 2025-05-05 19:36:33 +02:00
21e907ad50 prueba 2025-05-05 19:27:17 +02:00
bf146d4024 Revision de la entidad de catalogo libros 2025-05-05 18:53:44 +02:00
68a39bd749 Merge branch 'mod/servicios' into 'main'
terminado

See merge request jjimenez/safekat!782
2025-05-05 16:52:39 +00:00
514905ff47 terminado 2025-05-05 18:52:16 +02:00
75f06c44a1 Añadida opcion 'uso' en las queries de catalogo 2025-05-05 18:38:30 +02:00
4120ded07b Renombrado importador desde catalogo a RA-MA 2025-05-05 17:37:07 +02:00
24fc4ff1c1 Merge branch 'fix/pod_nohq_negro_enviobase' into 'main'
ahora el pod puede ser negro estandar. Para presupuestos no importados, si...

See merge request jjimenez/safekat!781
2025-05-05 15:35:59 +00:00
899365f2c2 Puesto en grupo beta opcion Catalogo -> Importar 2025-05-05 17:35:22 +02:00
302d12da1e ahora el pod puede ser negro estandar. Para presupuestos no importados, si no_envio_base no se añade 2025-05-05 17:34:51 +02:00
659d1d17ea Merge branch 'fix/remove_button_imposiciones' into 'main'
quitado el boton en las nuevas

See merge request jjimenez/safekat!779
2025-05-05 14:32:15 +00:00
ff5d853032 quitado el boton en las nuevas 2025-05-05 16:31:55 +02:00
ba6f92b3e6 Merge branch 'mod/ordenar_menus' into 'main'
Modificaciones

See merge request jjimenez/safekat!778
2025-05-05 14:31:12 +00:00
1ebc22c74b Modificaciones 2025-05-05 16:30:11 +02:00
785b9ea693 Merge branch 'mod/etiquetas_embalaje' into 'main'
cambiado el campo cajas

See merge request jjimenez/safekat!777
2025-05-05 14:23:49 +00:00
d2c6d131b3 cambiado el campo cajas 2025-05-05 16:23:12 +02:00
df1f003cbd Merge branch 'fix/imposicion-form' into 'main'
Fix/imposicion form

See merge request jjimenez/safekat!776
2025-05-05 12:33:36 +00:00
3936e3175a Merge branch 'main' into fix/imposicion-form 2025-05-05 14:32:55 +02:00
571338c4b3 fix imposicion form 2025-05-05 14:31:59 +02:00
5e5cff9eae Merge branch 'add/print_labels_maquinista' into 'main'
terminado

See merge request jjimenez/safekat!775
2025-05-05 11:14:14 +00:00
1d75f825a4 terminado 2025-05-05 13:13:44 +02:00
95e10820a3 Merge branch 'feat/menu_active' into 'main'
Añadida funcionalidad de marcar el menu que esta activo

See merge request jjimenez/safekat!774
2025-05-05 09:23:49 +00:00
b41dc836c7 Merge branch 'fix/btn-cancel-fa' into 'main'
fix btn cancel fa

See merge request jjimenez/safekat!773
2025-05-05 09:23:34 +00:00
4afcf05049 Añadida funcionalidad de marcar el menu que esta activo 2025-05-05 11:23:34 +02:00
0ecd18f5ff fix btn cancel fa 2025-05-05 11:22:41 +02:00
ff648fec87 Merge branch 'fix/respuesta_tickets' into 'main'
resuelto

See merge request jjimenez/safekat!772
2025-05-05 08:57:46 +00:00
b5c1053f8c resuelto 2025-05-05 10:57:21 +02:00
4701329d25 Merge branch 'fix/tickets_list' into 'main'
corregidos problemas

See merge request jjimenez/safekat!771
2025-05-05 08:32:40 +00:00
7a119eb197 corregidos problemas 2025-05-05 10:32:09 +02:00
3f8b7981c7 Merge branch 'fix/add_merma_servicios_2' into 'main'
arreglado

See merge request jjimenez/safekat!770
2025-05-05 07:56:13 +00:00
fa6e9208a1 arreglado 2025-05-05 09:55:48 +02:00
1f1bd32fa4 Merge branch 'mod/smtp_produccion' into 'main'
Modificados parametros SMTP de SK para produccion

See merge request jjimenez/safekat!769
2025-05-05 07:44:28 +00:00
8100350e3b Modificados parametros SMTP de SK para produccion 2025-05-05 09:44:04 +02:00
2af2dcdbb8 Merge branch 'feat/lg_maquinas_etiqueta_pedido' into 'main'
Feat/lg maquinas etiqueta pedido

See merge request jjimenez/safekat!768
2025-05-05 06:29:00 +00:00
1c581db4cf add etiqueta envio maquina model and show in tarea card 2025-05-05 08:27:01 +02:00
b4dfdfa101 add ot_id in ots datatables 2025-05-05 08:07:17 +02:00
8cbe5a7051 fix papel ot color 2025-05-05 08:04:46 +02:00
46176adc70 fix show form cosido in ot task 2025-05-05 07:53:36 +02:00
67bac8f666 Merge branch 'add/impresion_etiquetas_footer' into 'main'
terminado

See merge request jjimenez/safekat!767
2025-05-05 05:43:11 +00:00
ba3f4ab43c terminado 2025-05-05 07:42:27 +02:00
058857e51b Merge branch 'feat/revision-ot-2' into 'main'
Feat/revision ot 2

See merge request jjimenez/safekat!766
2025-05-04 22:48:57 +00:00
5ce6859a2f Merge branch 'main' into feat/revision-ot-2 2025-05-05 00:48:01 +02:00
2bfdd89085 Merge branch 'main' of https://git.imnavajas.es/jjimenez/safekat 2025-05-05 00:47:51 +02:00
305eea00e6 fichaje automatico y escaneo 2025-05-05 00:47:00 +02:00
8ea6128109 Merge branch 'add/interfaz_impresion_etiquetas' into 'main'
Add/interfaz impresion etiquetas

See merge request jjimenez/safekat!765
2025-05-04 16:37:34 +00:00
7b645539e3 terminado 2025-05-04 18:35:08 +02:00
fb7f2a28d9 revision ot v2 2025-05-04 17:25:53 +02:00
39639d9ff8 falta ordenar por cajas 2025-05-04 13:05:37 +02:00
3f90665c39 trabajando en la tabla de las lineas 2025-05-03 18:27:52 +02:00
71e70bf551 terminando a falta del listado añadir etiquetas 2025-05-03 12:06:25 +02:00
db70c57fb3 Merge branch 'main' into feat/preimpresion-revisada-check 2025-05-02 21:03:49 +02:00
91b044bbae Merge branch 'main' of https://git.imnavajas.es/jjimenez/safekat 2025-05-02 21:03:33 +02:00
a88ffda50d add revision preimpresion ot 2025-05-02 21:02:53 +02:00
d7a85ca04f Primeros pasos sistema backup 2025-05-02 14:10:49 +02:00
746955c3b1 Merge branch 'feat/prod_dev_environment' into 'main'
Feat/prod dev environment

See merge request jjimenez/safekat!764
2025-05-02 10:56:25 +00:00
8ca0a40b2b Añadida gestion de correos de pruebas en produccion 2025-05-02 11:54:11 +02:00
20c009f445 Añadida distincion visual para entorno de desarrollo 2025-05-02 11:29:19 +02:00
5138681718 feat/ot-datatable-news 2025-05-02 07:56:28 +02:00
9283059f9d Merge branch 'fix/entrega_taller_bubok' into 'main'
corregido

See merge request jjimenez/safekat!763
2025-05-01 07:08:36 +00:00
b75278f449 corregido 2025-05-01 09:08:14 +02:00
3fb944ff97 Merge branch 'mod/importador_bubok' into 'main'
añadido ajuste de precio, url en comentarios y crear pedido y ot

See merge request jjimenez/safekat!762
2025-05-01 06:59:59 +00:00
c7250cb8fd añadido ajuste de precio, url en comentarios y crear pedido y ot 2025-05-01 08:59:34 +02:00
7a9b2af8a6 Merge branch 'feat/ot-new-features' into 'main'
Features:

See merge request jjimenez/safekat!761
2025-05-01 04:16:42 +00:00
cf5a42de8d Merge branch 'main' into feat/ot-new-features 2025-05-01 06:15:26 +02:00
a259d76e5e ot new features 2025-05-01 06:02:22 +02:00
f696153d74 Merge branch 'fix/pliegos_presupuesto' into 'main'
terminado

See merge request jjimenez/safekat!760
2025-04-30 18:24:13 +00:00
9181905233 terminado 2025-04-30 20:23:45 +02:00
0ec7dff479 Merge branch 'feat/importador_bubok' into 'main'
Primera version del importador de Bubok

See merge request jjimenez/safekat!759
2025-04-30 13:39:21 +00:00
b0fb0f18fb Primera version del importador de Bubok 2025-04-30 15:36:33 +02:00
cf4c4df80a Features:
- Prototipo PDF
 - Ferro PDF
 - Ferro OK fecha cambiado a Ferro/Prototipo OK
 - Comentarios para orden,impresion,cubierta,encuadernacion y logistica
 - Migración para comentarios
 - Tarifas acabado migraciones con campos para identificar mejor si es plastificado,plakene,retractilado y el tipo de cada uno
2025-04-30 09:23:37 +02:00
36c9227586 fix pdf tables encuadernacion. Add tarifa acabado configuration for ots 2025-04-30 01:25:24 +02:00
4e9dfb51c7 Merge branch 'fix/descuento_con_ajuste' into 'main'
arreglado

See merge request jjimenez/safekat!757
2025-04-29 18:03:58 +00:00
5aab9a33ac arreglado 2025-04-29 20:03:02 +02:00
ea762a09c0 Merge branch 'fix/confirmar_presupuesto_ajustado' into 'main'
corregido

See merge request jjimenez/safekat!756
2025-04-29 17:56:28 +00:00
21014d029f corregido 2025-04-29 19:56:08 +02:00
9c31f2bbc5 Merge branch 'add/configuracion_cliente_cambios_importador_catalogo' into 'main'
terminado

See merge request jjimenez/safekat!755
2025-04-29 17:33:59 +00:00
b288ca498c terminado 2025-04-29 19:30:35 +02:00
96a6845c0c Merge branch 'feat/importador_rama_2' into 'main'
Feat/importador rama 2

See merge request jjimenez/safekat!754
2025-04-29 15:10:55 +00:00
eed5c0994e Importador rama con ajuste del precio 2025-04-29 17:09:19 +02:00
e2ab42cd84 Arreglado bug impresora de tickets (logistica) 2025-04-29 17:01:16 +02:00
7da76af866 Primera version del importador RAMA 2025-04-29 15:42:50 +02:00
bf1e66d746 Corregido bug en API imprimelibros 2025-04-29 12:40:35 +02:00
adccc414be Merge branch 'fix/bugs-ot' into 'main'
Fix/bugs ot

See merge request jjimenez/safekat!752
2025-04-28 06:13:50 +00:00
95fa192cb9 remove ? from orden_trabajo pdf 2025-04-28 08:12:22 +02:00
9310d2dabd delete class text-center from div.card otTask 2025-04-28 08:06:44 +02:00
3abf45ca6e tiempo real tarea empty when created 2025-04-28 08:00:39 +02:00
6ea22066c2 Merge branch 'feat/festivos-calendar' into 'main'
Feat/festivos calendar

See merge request jjimenez/safekat!751
2025-04-28 00:11:16 +00:00
bf21a336b1 Merge branch 'main' into feat/festivos-calendar 2025-04-28 02:10:52 +02:00
d1e5731d1d create POD dates pedido 2025-04-28 02:03:40 +02:00
029757bb40 add calendar festivos 2025-04-28 00:42:15 +02:00
bb4c9690b9 Merge branch 'feat/importador_rama' into 'main'
Feat/importador rama

See merge request jjimenez/safekat!750
2025-04-27 20:01:26 +00:00
6d45a950df Trabajando JS 2025-04-27 22:00:52 +02:00
6f8890a8b1 Merge branch 'main' into 'feat/importador_rama'
Main

See merge request jjimenez/safekat!749
2025-04-27 18:56:08 +00:00
c093c01c00 Merge branch 'main' into feat/festivos-calendar 2025-04-27 19:30:31 +02:00
a4532a7ff6 Merge branch 'fix/filter-datatable-ot' into 'main'
Fix/filter datatable ot

See merge request jjimenez/safekat!748
2025-04-27 17:27:30 +00:00
31a12ff343 try catch getTiempoProcesamientoHHMM 2025-04-27 19:26:02 +02:00
1d6f5fe53e default table encuadernacion 2025-04-27 19:24:11 +02:00
0b767c63e9 fix filter ferro 2025-04-27 19:13:06 +02:00
e464652fe2 festivo entity model 2025-04-27 19:01:23 +02:00
dd20f2a20e Merge branch 'maquinista-change-user' into 'main'
Maquinista change user

See merge request jjimenez/safekat!747
2025-04-27 16:54:35 +00:00
97554bffc9 add maquinista change user session 2025-04-27 18:53:24 +02:00
73e9e941ed Merge branch 'main' into maquinista-change-user 2025-04-27 12:25:09 +02:00
05720cf1ce Merge branch 'fix/migrate' into 'main'
fix migrate class name

See merge request jjimenez/safekat!746
2025-04-27 10:20:33 +00:00
04e9e3ee6f fix migrate class name 2025-04-27 12:18:20 +02:00
9804a6a927 change user session 2025-04-27 12:17:31 +02:00
3402e67fb2 Merge branch 'add/envio_ferros' into 'main'
Add/envio ferros

See merge request jjimenez/safekat!745
2025-04-27 10:14:05 +00:00
b1932e6f85 terminado envio de ferros 2025-04-27 12:12:52 +02:00
13ae70236e Merge branch 'feat/sk-44' into 'main'
Feat/sk 44

See merge request jjimenez/safekat!744
2025-04-27 09:00:23 +00:00
4d8332e625 Merge branch 'main' into feat/sk-44 2025-04-27 10:59:41 +02:00
c75d08b3c3 ot pliegos 2025-04-27 10:58:23 +02:00
a0b5f3b4df trabajando en envio de ferros 2025-04-27 09:51:52 +02:00
0e444295e3 trabajando en el formulario envio de ferros 2025-04-27 09:51:04 +02:00
ae7707057a Cambiando titulo pagina 2025-04-27 09:17:46 +02:00
ff115f4f20 Configurando logica de captacion del Excel 2025-04-27 09:16:15 +02:00
45e41c77e4 tablas encuadernacion ot pdf 2025-04-27 08:20:35 +02:00
ae456c8890 Implementado script principal 2025-04-27 00:00:58 +02:00
e8958dc893 Implementado menu lateral 2025-04-26 23:23:04 +02:00
b0ac132e59 Arreglado bug en archivo de migrate del catalogo 2025-04-26 23:05:15 +02:00
b50e564641 Desplegando arcihvos iniciales 2025-04-26 21:32:22 +02:00
894770d6ce Merge branch 'feat/importador_rama' of https://git.imnavajas.es/jjimenez/safekat into feat/importador_rama 2025-04-26 21:25:18 +02:00
367c7c2ea8 Merge branch 'main' into 'feat/importador_rama'
Main

See merge request jjimenez/safekat!743
2025-04-26 19:24:58 +00:00
9375b9b624 Añadiendo idiomas 2025-04-26 21:22:39 +02:00
9a6a4f89a2 Merge branch 'add/files_albaranes' into 'main'
subidos ficheros

See merge request jjimenez/safekat!742
2025-04-26 16:09:09 +00:00
7f31e65960 subidos ficheros 2025-04-26 18:08:41 +02:00
5aa2a2e6c9 Merge branch 'add/logistica_albaranes' into 'main'
Add/logistica albaranes

See merge request jjimenez/safekat!741
2025-04-26 15:27:46 +00:00
dfbcb13ba5 hecho tema albaranes logistica 2025-04-26 17:27:29 +02:00
033184cfa2 Iniciando herramienta de importacion desde catalogo 2025-04-26 16:52:59 +02:00
25b6d14423 falta boton borrar albaranes! 2025-04-26 14:16:32 +02:00
96bd24ae8b Merge branch 'add/impresion_etiquetas_envios' into 'main'
Add/impresion etiquetas envios

See merge request jjimenez/safekat!740
2025-04-26 08:51:24 +00:00
b5b86b4164 terminado a falta de pruebas 2025-04-26 10:50:59 +02:00
ef173ab0fc Merge branch 'main' into add/impresion_etiquetas_envios 2025-04-26 09:56:47 +02:00
f473caf06c Merge branch 'fix/change_pedido_ot_logistica' into 'main'
terminado

See merge request jjimenez/safekat!739
2025-04-26 07:55:29 +00:00
5e8a7f8bd4 terminado 2025-04-26 09:54:56 +02:00
905112334f Merge branch 'fix/php-syntax' into 'main'
<php syntax

See merge request jjimenez/safekat!738
2025-04-25 17:34:29 +00:00
d0f37cb714 <php syntax 2025-04-25 19:32:26 +02:00
151e4a2d7a cambios 2025-04-25 17:50:30 +02:00
05ebfa06df Merge branch 'feat/view-maquinista' into 'main'
Feat/view maquinista

See merge request jjimenez/safekat!737
2025-04-25 11:22:19 +00:00
dafdf68c41 view maquinista 2025-04-25 13:20:35 +02:00
4379a9d23b erase ot dates 2025-04-25 12:57:14 +02:00
cc2c9eee1c maquina button 2025-04-25 11:30:41 +02:00
b942064608 Merge branch 'main' into feat/view-maquinista 2025-04-25 07:41:25 +02:00
52b3b1ae4d maquinista view-basic 2025-04-25 07:40:20 +02:00
86dafb1133 Merge branch 'add/fechaEmbalajeForEnvio' into 'main'
cambiado ael añadir envios

See merge request jjimenez/safekat!736
2025-04-24 21:44:35 +00:00
5c68334e9a cambiado ael añadir envios 2025-04-24 23:44:07 +02:00
f16654f4ad Merge branch 'fix/findpedidoLogistica' into 'main'
corregido el añadir cuando no es multienvio y select añadir lineas

See merge request jjimenez/safekat!735
2025-04-24 16:40:46 +00:00
a1fd7075d6 corregido el añadir cuando no es multienvio y select añadir lineas 2025-04-24 18:40:10 +02:00
4fd242d4d2 Merge branch 'fix/facturas_problems' into 'main'
terminado

See merge request jjimenez/safekat!734
2025-04-24 10:01:38 +00:00
3838bcb536 terminado 2025-04-24 12:01:06 +02:00
e2011529b4 Merge branch 'fix/facturas_problema_albaranes_2' into 'main'
solucionado el totl aceptado

See merge request jjimenez/safekat!733
2025-04-24 09:02:06 +00:00
616c12002e solucionado el totl aceptado 2025-04-24 11:01:38 +02:00
ab36e86bdb Merge branch 'fix/facturas_problema_albaranes' into 'main'
solucionado

See merge request jjimenez/safekat!732
2025-04-24 08:56:17 +00:00
1ce4ac36a6 solucionado 2025-04-24 10:55:52 +02:00
7bfb49f412 Merge branch 'add/finalizar_envios_logistica' into 'main'
Add/finalizar envios logistica

See merge request jjimenez/safekat!731
2025-04-24 07:05:23 +00:00
f7b9c23f69 parece terminado los envios 2025-04-24 00:32:53 +02:00
f7d1c59c6a Merge branch 'fix/round_tiempo_rot_descuento_admin' into 'main'
corregidos los dos fallos

See merge request jjimenez/safekat!730
2025-04-23 15:42:50 +00:00
e918b5f400 corregidos los dos fallos 2025-04-23 17:41:43 +02:00
8b949a3173 Merge branch 'main' into add/finalizar_envios_logistica 2025-04-23 17:22:40 +02:00
e0916b567c tabajando 2025-04-23 17:22:12 +02:00
3779b3b8a0 Merge branch 'fix/bug_catalogo_rutas' into 'main'
Arreglado renaming de las rutas

See merge request jjimenez/safekat!729
2025-04-23 13:26:56 +00:00
6175da1d61 Arreglado renaming de las rutas 2025-04-23 15:26:22 +02:00
9473c10f97 Merge branch 'bug/ruta_duplicada' into 'main'
Renombrada ruta duplicada

See merge request jjimenez/safekat!728
2025-04-23 07:16:56 +00:00
800d32afde Renombrada ruta duplicada 2025-04-23 09:16:13 +02:00
00401aaf7f Merge branch 'feat/catalogo' into 'main'
Feat/catalogo

See merge request jjimenez/safekat!727
2025-04-22 20:58:42 +00:00
919c80fa9b Version 1.0 2025-04-22 22:57:27 +02:00
b5b4d6b026 añadidos ficheros 2025-04-22 22:20:21 +02:00
5ac1e3d4c1 finalizar envio ok 2025-04-22 22:20:03 +02:00
7dee2c26e8 Añadidas labels 2025-04-22 15:52:48 +02:00
649a244a10 Optimizando vista html 2025-04-22 12:00:12 +02:00
288a3f02eb Merge branch 'main' into feat/view-maquinista 2025-04-22 10:37:41 +02:00
952500e10e Merge branch 'main' into feat/view-maquinista 2025-04-22 10:34:06 +02:00
2cfe03b2ec Merge branch 'fix/papel-impresion-routes' into 'main'
Fix/papel impresion routes

See merge request jjimenez/safekat!726
2025-04-22 08:33:10 +00:00
b28c0d9f71 Merge branch 'main' into fix/papel-impresion-routes 2025-04-22 10:30:48 +02:00
01c7da8ca6 Merge branch 'main' of https://git.imnavajas.es/jjimenez/safekat 2025-04-22 10:30:23 +02:00
13128ebdae fix papel impresion plana filter 2025-04-22 10:30:05 +02:00
6016b6145c Merge branch 'add/view_logistica_principal' into 'main'
Add/view logistica principal

See merge request jjimenez/safekat!725
2025-04-22 08:26:52 +00:00
6450231b53 terminados albaranes 2025-04-22 10:26:33 +02:00
b86acc3949 fix papel route 2025-04-22 10:18:44 +02:00
92a6a3c16c ot tareas new migrations 2025-04-22 10:07:03 +02:00
62a95a0ca8 add views 2025-04-22 09:43:25 +02:00
ed5f73db25 Refactoring 2025-04-22 09:06:11 +02:00
ddf02f73b8 Añadido conenido merge 2025-04-22 08:40:49 +02:00
b555e988be Merge branch 'main' into 'feat/catalogo'
Main

See merge request jjimenez/safekat!724
2025-04-22 06:37:54 +00:00
2050f0ae1e botones albaran finalizado 2025-04-22 00:50:31 +02:00
fc1b69f2fe Merge branch 'main' into add/view_logistica_principal 2025-04-21 21:09:00 +02:00
946527cc1a Merge branch 'fix/plantillas_clientes_deleted_at_editor' into 'main'
arreglado

See merge request jjimenez/safekat!722
2025-04-21 15:42:34 +00:00
33d3e74e80 arreglado 2025-04-21 17:41:53 +02:00
67a7cda036 Cambios parciales 2025-04-21 15:39:02 +02:00
ed28263994 Merge branch 'fix/imposicion-ot-view' into 'main'
fix if imposicion null

See merge request jjimenez/safekat!721
2025-04-21 12:31:52 +00:00
0d24e50d01 fix if imposicion null 2025-04-21 14:29:51 +02:00
a27536e406 Merge branch 'fix/ot_view' into 'main'
Arreglado bug en visualizacion de OTs. Cambiada vista por defecto en listado a pendientes

See merge request jjimenez/safekat!719
2025-04-21 12:21:43 +00:00
4af34d7ba4 Arreglado bug en visualizacion de OTs. Cambiada vista por defecto en listado a pendientes 2025-04-21 14:21:19 +02:00
753aafe05d Resolviendo conflictos 2025-04-21 14:09:08 +02:00
63254f0bf3 Merge branch 'main' into 'feat/catalogo'
Main

See merge request jjimenez/safekat!718
2025-04-21 12:07:04 +00:00
0afd31aae0 Resolviendo conflictos 2025-04-21 14:06:47 +02:00
dd723f9889 Resolviendo conflictos 2025-04-21 14:06:13 +02:00
703781e115 Resolviendo conflictos 2025-04-21 13:59:55 +02:00
9ae3d8707c Merge branch 'fix/rutas_papeles_genericos' into 'main'
Arreglado bug de rutas

See merge request jjimenez/safekat!717
2025-04-21 11:35:36 +00:00
c344274f9d Arreglado bug de rutas 2025-04-21 13:35:12 +02:00
e18a39938b Revision con JJO 2025-04-21 13:26:00 +02:00
5ebf2c670f Merge branch 'fix/app-permissions' into 'main'
add 755 app

See merge request jjimenez/safekat!716
2025-04-21 10:56:43 +00:00
12e06937c4 add 755 app 2025-04-21 12:55:45 +02:00
fe164c4ab3 trabajando 2025-04-21 12:43:09 +02:00
9cb7762905 Creada migracion para tabla de isk's 2025-04-21 08:53:37 +02:00
548a444b7d Merge branch 'feat/imposiciones' into 'main'
Feat/imposiciones

See merge request jjimenez/safekat!715
2025-04-21 06:33:51 +00:00
969966ac78 add select imposicion datatable 2025-04-21 08:32:21 +02:00
b318721b90 button imprimir code safekat 2025-04-21 00:12:51 +02:00
a137ede1a7 fix sidebar toggle 2025-04-20 23:27:06 +02:00
5eaa5fea0b fix side bar toggle 2025-04-20 23:03:45 +02:00
19fd76e910 falta terminar albaranes 2025-04-20 22:10:56 +02:00
14b5f4bf95 Revisados formularios de crear y editar, con su validacion 2025-04-20 21:35:24 +02:00
61abcb3dbd trabajando en albaranes. Voy a quitar las cajas 2025-04-20 20:02:14 +02:00
f2ea93ddb6 fix menu toggle links 2025-04-20 20:01:15 +02:00
31524dcf61 fix menu toggle links 2025-04-20 20:00:52 +02:00
c3d38e29a4 imposiciones 2025-04-20 19:26:07 +02:00
f93ecda648 Creado concepto de ISK 2025-04-20 15:58:43 +02:00
49f9fe4009 Avances inicializacion edit 2025-04-19 22:27:27 +02:00
65c9b34f56 añadido switch a los grupos para seleccionar 2025-04-18 13:52:49 +02:00
46c29f3c13 añadidos links al pedido y al presupuesto 2025-04-18 13:42:45 +02:00
0b04e6dabd terminada envio lineas 2025-04-18 13:38:06 +02:00
15f6d0d675 voy a añadir grupos de cajas 2025-04-18 10:36:06 +02:00
3949607a3c trabajando en añadir lineas a envio 2025-04-17 13:47:26 +02:00
9e90ec798c Merge branch 'add/view_logistica_principal' of https://git.imnavajas.es/jjimenez/safekat into add/view_logistica_principal 2025-04-17 09:10:35 +02:00
76baae9e92 Merge branch 'main' into 'add/view_logistica_principal'
Main

See merge request jjimenez/safekat!714
2025-04-17 07:10:25 +00:00
52a4e7d37b Merge branch 'fix/ot-bugs' into 'main'
Fix/ot bugs

See merge request jjimenez/safekat!713
2025-04-16 18:31:44 +00:00
972d0c4ec8 pdf download file name 2025-04-16 20:31:18 +02:00
36f5d42d03 pdf uncomment 2025-04-16 20:27:08 +02:00
c28753e1f1 Merge branch 'fix/ot-bugs' into 'main'
fix pod and file if not exist

See merge request jjimenez/safekat!712
2025-04-16 18:26:15 +00:00
8e97e7b58c fix pod and file if not exist 2025-04-16 20:25:13 +02:00
f19d2b7ffe Merge branch 'fix/ot-bugs' into 'main'
fix ot

See merge request jjimenez/safekat!711
2025-04-16 17:57:24 +00:00
2a8c4b9da6 fix ot 2025-04-16 19:55:30 +02:00
d50b511e83 Merge branch 'add/view_logistica_principal' of https://git.imnavajas.es/jjimenez/safekat into add/view_logistica_principal 2025-04-16 18:24:53 +02:00
3ada529b6e trabajando 2025-04-16 18:24:48 +02:00
02a64fa40a Merge branch 'main' into 'add/view_logistica_principal'
Main

See merge request jjimenez/safekat!710
2025-04-16 16:24:25 +00:00
c42f223b9a Configurando la logica del catalogo (JS) 2025-04-16 16:10:04 +02:00
173afe403e Merge branch 'feat/ot-general-features' into 'main'
ot general features

See merge request jjimenez/safekat!709
2025-04-16 13:52:28 +00:00
c76f4428a6 ot general features 2025-04-16 15:51:09 +02:00
6a4e753a06 Merge branch 'feat/ot-pdf-colores' into 'main'
colores header pdf ot

See merge request jjimenez/safekat!708
2025-04-16 07:15:26 +00:00
7ee844fb0c colores header pdf ot 2025-04-16 09:14:16 +02:00
6d5b8ab621 Importando estilo del comparador 2025-04-15 22:11:58 +02:00
a74021f97d Merge branch 'main' into 'feat/catalogo'
Main

See merge request jjimenez/safekat!707
2025-04-15 19:07:51 +00:00
725ea61078 Eliminada subida de ficheros y configurado menu de catalogo (no beta) 2025-04-15 21:05:33 +02:00
5dbb40af1d Merge branch 'fix/pedido-espera-update-ot' into 'main'
fix update pedido espera update

See merge request jjimenez/safekat!706
2025-04-15 17:46:28 +00:00
c6db000057 fix update pedido espera update 2025-04-15 19:39:07 +02:00
6a4e9b611e Merge branch 'add/view_logistica_principal' of https://git.imnavajas.es/jjimenez/safekat into add/view_logistica_principal 2025-04-15 18:48:07 +02:00
fedc608463 cambios antes del pull 2025-04-15 18:48:01 +02:00
4667e77144 Merge branch 'main' into 'add/view_logistica_principal'
Main

See merge request jjimenez/safekat!705
2025-04-15 16:47:08 +00:00
7cf1bf006d Prrrrrrrrrrr 2025-04-15 16:05:11 +02:00
10e18d60e4 Merge branch 'feat/colors-plannings' into 'main'
add colors plannings

See merge request jjimenez/safekat!703
2025-04-15 07:55:36 +00:00
67e588dd67 Primera version visual formulario catalogo completa 2025-04-15 09:54:33 +02:00
0fe2470477 add colors plannings 2025-04-15 09:53:50 +02:00
ea59390b75 Merge branch 'feat/sk-38+messages+dates' into 'main'
Feat/sk 38+messages+dates

See merge request jjimenez/safekat!702
2025-04-15 06:27:41 +00:00
a52745fe09 fix cols 2025-04-15 01:42:20 +02:00
2102a44a1e Merge branch 'feat/ot-messages' into feat/sk-38+messages+dates 2025-04-15 01:32:20 +02:00
ab99baaa81 add new dates in form 2025-04-15 01:30:46 +02:00
9f46569b01 add messages to ot 2025-04-15 00:42:24 +02:00
14c5cf493c add new dates 2025-04-14 23:36:39 +02:00
16dc39ee15 generando el grupo de envios 2025-04-14 22:00:52 +02:00
ebf0a9d5d7 feat colors 2025-04-14 20:41:23 +02:00
c157b1215c Merge branch 'add/view_logistica_principal' of https://git.imnavajas.es/jjimenez/safekat into add/view_logistica_principal 2025-04-14 20:07:36 +02:00
c226f031d9 trabajando en selector de pedidos 2025-04-14 20:07:29 +02:00
f9909bd8cd Merge branch 'main' into 'add/view_logistica_principal'
Main

See merge request jjimenez/safekat!701
2025-04-14 18:07:14 +00:00
c75a2f9ef4 Construyendo el formulario de edicion 2025-04-14 14:45:35 +02:00
137d5b9db2 Merge branch 'feat/sk-40/sk-37' into 'main'
Feat/sk 40/sk 37

See merge request jjimenez/safekat!700
2025-04-14 06:51:33 +00:00
0d21a7ab3b Merge branch 'main' into feat/sk-40/sk-37 2025-04-14 08:50:36 +02:00
e9827c3557 fechas pedido and imposiciones 2025-04-14 08:05:03 +02:00
f0a4f19089 vista creada de envios 2025-04-13 20:28:05 +02:00
084f3220e1 Merge branch 'fix/flujo_facturas_precio' into 'main'
reflejado diferentes ivas en total de factura

See merge request jjimenez/safekat!699
2025-04-13 12:13:24 +00:00
b28b8b761e reflejado diferentes ivas en total de factura 2025-04-13 14:13:05 +02:00
42a0aed019 Merge branch 'fix/deleted_at/plantilla_precios' into 'main'
fix deleted at

See merge request jjimenez/safekat!698
2025-04-13 07:55:09 +00:00
f343071311 fix deleted at 2025-04-13 09:54:17 +02:00
e2da90926d Listado de libros de catalogo 2025-04-13 09:46:47 +02:00
08a91294b4 dates users ot 2025-04-13 09:43:15 +02:00
f5d01e520a Merge branch 'main' into feat/imposiciones/sk-40 2025-04-12 23:54:52 +02:00
ba9c4dc339 imposiciones 2025-04-12 23:53:48 +02:00
41159d1588 select imposicion route 2025-04-12 23:53:28 +02:00
5e8da603f9 Merge branch 'main' into 'feat/catalogo'
Main

See merge request jjimenez/safekat!697
2025-04-12 20:21:30 +00:00
f031e31930 Merge branch 'mod/autoroute' into 'main'
Mod/autoroute

See merge request jjimenez/safekat!696
2025-04-12 20:20:11 +00:00
e8123c9fb8 Cambiado el flag de autorute a ON 2025-04-12 22:19:48 +02:00
abc8db6b8b Merge branch 'main' into 'mod/autoroute'
terminado añadir usuarios y fechas a pedidos. añadido inaplazable. color en...

See merge request jjimenez/safekat!695
2025-04-12 20:18:05 +00:00
a31e0bddb6 Añadido RBAC directory 2025-04-12 22:14:57 +02:00
9981f878d1 Inicializacion del modulo catalogo 2025-04-12 22:04:34 +02:00
7350e193e5 Merge branch 'fix/rbac_init' into 'main'
Comprobar que el directorio RBAC existe y añadido .gitkeep

See merge request jjimenez/safekat!694
2025-04-12 19:11:48 +00:00
9ee2a833b5 Comprobar que el directorio RBAC existe y añadido .gitkeep 2025-04-12 21:11:20 +02:00
8cd4570845 Merge branch 'mod/flujo_facturas' into 'main'
terminado el flujo completo de facturas, incluyendo cambio en el texto de...

See merge request jjimenez/safekat!693
2025-04-12 15:48:21 +00:00
89531f1a1b terminado el flujo completo de facturas, incluyendo cambio en el texto de pedidos y facturas cuando no tiene factura validada 2025-04-12 17:47:36 +02:00
8912606c9a pagos en borrador 2025-04-12 12:37:57 +02:00
f966f2d47a Merge branch 'fix/facturas_suma_alineamiento' into 'main'
solucionado

See merge request jjimenez/safekat!692
2025-04-12 08:51:07 +00:00
2e845b7355 solucionado 2025-04-12 10:50:50 +02:00
803b979e0d Merge branch 'fix/error_no_inaplazable' into 'main'
arreglado problema

See merge request jjimenez/safekat!691
2025-04-12 08:18:51 +00:00
79fcb1e3fe arreglado problema 2025-04-12 10:18:32 +02:00
9b6b66af13 Merge branch 'mod/pedidos_user_fechas' into 'main'
terminado añadir usuarios y fechas a pedidos. añadido inaplazable. color en...

See merge request jjimenez/safekat!690
2025-04-12 08:02:28 +00:00
3d535e4ed5 Merge branch 'main' into 'mod/pedidos_user_fechas'
Main

See merge request jjimenez/safekat!689
2025-04-12 08:01:59 +00:00
bb9f6210e7 terminado añadir usuarios y fechas a pedidos. añadido inaplazable. color en rojo en fechas cuando inaplazable 2025-04-12 10:00:24 +02:00
da8917b0d3 Merge branch 'fix/sk-41' into 'main'
Fix/sk 41

See merge request jjimenez/safekat!688
2025-04-12 06:01:17 +00:00
38d60402c0 constraint btn-edit event inside table not in $(document) 2025-04-12 08:00:32 +02:00
e7394999ab constraint btn-edit event inside table not in $(document) 2025-04-12 08:00:26 +02:00
ba54d99185 remove doble slash ad form url 2025-04-12 07:59:57 +02:00
efb50383b7 add class table-responsive 2025-04-12 07:59:33 +02:00
de8ae93871 Merge branch 'fix/sk-36' into 'main'
Fix/sk 36

See merge request jjimenez/safekat!687
2025-04-11 05:04:09 +00:00
defb7373c4 remove unused imports 2025-04-11 07:03:08 +02:00
a4f6f8cdb3 migration drop is_deleted 2025-04-11 07:01:39 +02:00
1e339b5503 delete is_deleted field 2025-04-11 06:56:55 +02:00
9e591a099d Merge branch 'fix/user-import-model' into 'main'
Fix/user import model

See merge request jjimenez/safekat!686
2025-04-11 01:36:08 +00:00
269410c2c7 Merge branch 'main' of https://git.imnavajas.es/jjimenez/safekat 2025-04-11 03:34:10 +02:00
49f3430f12 Merge branch 'fix/facturas_pdf' into 'main'
Arreglado bug al generar PDF de facturas

See merge request jjimenez/safekat!685
2025-04-10 20:42:05 +00:00
64e4f51e13 Arreglado bug al generar PDF de facturas 2025-04-10 22:41:38 +02:00
10781c40a9 Merge branch 'mod/facturas_trello' into 'main'
Mod/facturas trello

See merge request jjimenez/safekat!684
2025-04-10 14:59:28 +00:00
026a109b5e terminado 2025-04-10 16:58:54 +02:00
cce8b1845f Merge branch 'main' into 'mod/facturas_trello'
Main

See merge request jjimenez/safekat!683
2025-04-10 13:34:31 +00:00
7139bb377c falta autonumeric 2025-04-10 15:34:14 +02:00
29e130458a Merge branch 'mod/pdf_facturas' into 'main'
Actualizado el pdf de facturas para eliminar precio por linea

See merge request jjimenez/safekat!682
2025-04-10 12:34:22 +00:00
d8cb02271e Actualizado el pdf de facturas para eliminar precio por linea 2025-04-10 14:33:35 +02:00
b37f3f663a Merge branch 'main' of https://git.imnavajas.es/jjimenez/safekat 2025-04-09 07:05:11 +02:00
014b48e693 fix user model imports 2025-04-09 07:04:06 +02:00
af57f7d5ae Modificado Paises al metodo JS 2025-04-09 00:37:30 +02:00
b7c5c328da Merge branch 'main' into 'mod/autoroute'
Main

See merge request jjimenez/safekat!681
2025-04-08 20:44:10 +00:00
5a2b2ee7cb Resolviendo conflictos 2025-04-08 22:43:49 +02:00
94a2a1dd2e Resolviendo conflictos 2025-04-08 22:41:25 +02:00
84155d1f71 Merge branch 'fix/rolesPermissions_view' into 'main'
modificada la vista cuando hay más de 3 permisos

See merge request jjimenez/safekat!680
2025-04-08 20:38:29 +00:00
fc52417b53 modificada la vista cuando hay más de 3 permisos 2025-04-08 22:37:53 +02:00
03135fdac7 Añadidos archivos de rutas para presupuestos y compras 2025-04-08 15:22:39 +02:00
3cfdc584e5 Añadida estructura de rutas en carpeta dedicada 2025-04-08 15:04:14 +02:00
c0de7ec238 Cambiadas rutas de maquinas, papel generico, papel impresion, perfil y paises 2025-04-08 14:45:14 +02:00
ae9af197ac Merge branch 'fix/arreglar_resumen_cliente_vs_admin' into 'main'
Fix/arreglar resumen cliente vs admin

See merge request jjimenez/safekat!679
2025-04-07 22:44:08 +00:00
ab4afe7492 Merge branch 'main' into 'fix/arreglar_resumen_cliente_vs_admin'
Main

See merge request jjimenez/safekat!678
2025-04-07 22:43:25 +00:00
982b008ada Merge branch 'fix/compras_proveedores' into 'main'
Arreglado menu compras/proveedores

See merge request jjimenez/safekat!677
2025-04-07 22:42:27 +00:00
036c11b4ab Arreglado menu compras/proveedores 2025-04-08 00:41:31 +02:00
644ad41001 todo okgit pullgit pull 2025-04-08 00:28:45 +02:00
b413245683 Merge branch 'main' into 'fix/arreglar_resumen_cliente_vs_admin'
Main

See merge request jjimenez/safekat!676
2025-04-07 22:19:36 +00:00
0116553b2b Merge branch 'rev/roles_2' into 'main'
Rev/roles 2

See merge request jjimenez/safekat!675
2025-04-07 21:59:31 +00:00
4b57c716ab Refactorizazion 2025-04-07 23:58:44 +02:00
df05f4b5b4 Revisados roles de pedidos y corregidos bugs de poner autoroute = false 2025-04-07 23:49:35 +02:00
6c20121f0c Merge branch 'main' into 'fix/arreglar_resumen_cliente_vs_admin'
Main

See merge request jjimenez/safekat!674
2025-04-07 21:39:12 +00:00
885aea495c falta factores cliente 2025-04-07 23:38:31 +02:00
a6f07a15b5 Añadidos permisos para Produccion 2025-04-07 23:20:07 +02:00
432567e964 Permisos produccion 2025-04-07 22:56:07 +02:00
470732ca39 Merge branch 'rev/roles_1' into 'main'
Rev/roles 1

See merge request jjimenez/safekat!673
2025-04-07 20:35:18 +00:00
5b15d7a72e Subiendo menu importador 2025-04-07 22:34:40 +02:00
64a6e0c5f4 Merge branch 'main' into 'rev/roles_1'
Main

See merge request jjimenez/safekat!672
2025-04-07 20:30:49 +00:00
c8598cbd27 Resolviendo conflictos 2025-04-07 22:30:29 +02:00
e96c738839 Merge branch 'mod/ajustes_mail' into 'main'
Mod/ajustes mail

See merge request jjimenez/safekat!671
2025-04-07 20:17:28 +00:00
a62e51d31c Merge branch 'main' into 'mod/ajustes_mail'
Main

See merge request jjimenez/safekat!670
2025-04-07 20:16:02 +00:00
4f5bc3301f Eliminados ajustes de sistemas. Ahora estan en variables del ERP 2025-04-07 22:14:44 +02:00
4633fa623a Merge branch 'add/tablaCredito_presuAdmin_old_erp' into 'main'
añadido pendiente en erp antiguo

See merge request jjimenez/safekat!669
2025-04-07 19:32:56 +00:00
ce1d94bbda añadido pendiente en erp antiguo 2025-04-07 21:32:36 +02:00
387667b0c2 Merge branch 'fix/lista_papel_impre_activo' into 'main'
quitada la condición isactivo en el listado

See merge request jjimenez/safekat!668
2025-04-07 16:38:50 +00:00
66825d3286 quitada la condición isactivo en el listado 2025-04-07 18:38:29 +02:00
3baa7c9e51 Merge branch 'rev/roles_1' of https://git.imnavajas.es/jjimenez/safekat into rev/roles_1 2025-04-07 09:55:35 +02:00
c450d4f804 Revisando roles y añadido clase beta al CSS 2025-04-07 09:55:30 +02:00
937af8f5d9 Merge branch 'main' into 'rev/roles_1'
Main

See merge request jjimenez/safekat!667
2025-04-07 07:54:11 +00:00
6045d65935 Merge branch 'mod/listado_plantillas_tarifas' into 'main'
Mod/listado plantillas tarifas

See merge request jjimenez/safekat!666
2025-04-07 05:11:04 +00:00
78584f22c3 cambiado a papel generico la descripción del pedido (y de facturas por tanto) 2025-04-07 07:10:17 +02:00
2de72e4278 añadidos totales a tarifas de clientes 2025-04-06 19:35:39 +02:00
e5b2bc19d4 Merge branch 'fix/permisos-mensajeria-sidebar' into 'main'
Fix/permisos mensajeria sidebar

See merge request jjimenez/safekat!665
2025-04-06 07:50:27 +00:00
ce325d73dc Merge branch 'main' into fix/permisos-mensajeria-sidebar 2025-04-06 09:49:46 +02:00
301152c6e2 Merge branch 'feat/sk-34/filter-maquina-padre' into 'main'
Feat/sk 34/filter maquina padre

See merge request jjimenez/safekat!663
2025-04-06 07:43:31 +00:00
1b451ab08e Merge branch 'feat/sk-32' into 'main'
Feat/sk 32

See merge request jjimenez/safekat!662
2025-04-06 07:42:31 +00:00
c42a7bae44 Merge branch 'main' into fix/permisos-mensajeria-sidebar 2025-04-06 09:40:09 +02:00
c6bc2e532f Merge branch 'fix/maquina-form-bugs' into 'main'
table papeles impresion responsive

See merge request jjimenez/safekat!661
2025-04-06 07:37:26 +00:00
2b343b0dd9 add filter maquina padre in datatablePlanningPlana 2025-04-06 09:33:44 +02:00
89ec78bc31 add select filter maquina padre 2025-04-06 09:32:53 +02:00
2857697fd2 add padre_id to select in planningPlanaQueryDatatable 2025-04-06 09:32:42 +02:00
2eb51ffd55 maquina padre plana 2025-04-06 09:32:13 +02:00
b320856af8 select maquina plana padre 2025-04-06 09:32:04 +02:00
071dceced8 table papeles impresion responsive 2025-04-06 06:17:19 +02:00
75eea1a736 Merge branch 'main' into feat/sk-32 2025-04-06 06:03:44 +02:00
c14eb1f3c3 button to sm. Acorddion default collapsed 2025-04-06 06:02:51 +02:00
7aa1a33767 fix switches inaplazable y revisada css 2025-04-06 06:02:27 +02:00
f56ede87da reorder sections 2025-04-06 06:02:02 +02:00
ea11011aca buttons to btn-sm 2025-04-06 06:01:50 +02:00
7a316d9b81 update with pedido espera 2025-04-06 06:01:32 +02:00
5051bddf36 add translations 2025-04-06 06:01:20 +02:00
98d47a0f0f remove pedido_espera_by cast 2025-04-06 06:01:12 +02:00
cfa3f7329f add error resposne to get_orden_trabajo_summary 2025-04-06 06:00:52 +02:00
f362087c01 add pedido espera switch 2025-04-06 06:00:09 +02:00
4343b86640 fix sistema/intranet path 2025-04-06 05:59:37 +02:00
ccfc78ed0d add block ui and file zone 2025-04-06 05:59:23 +02:00
4fb6533926 notiflix 2025-04-06 05:59:04 +02:00
2c59ac33df Merge branch 'fix/add_merma_servicios' into 'main'
solucionado. También corregidos añadir margen en envios de cliente y problema...

See merge request jjimenez/safekat!660
2025-04-05 08:25:34 +00:00
73e6106e4f solucionado. También corregidos añadir margen en envios de cliente y problema al cargar cubierta con solapas 2025-04-05 10:25:08 +02:00
b17abbdfa8 upload file feature 2025-04-05 09:40:51 +02:00
60b77453d9 resourcePath config value 2025-04-05 09:40:38 +02:00
e29e77703d orden trabajo files methods 2025-04-05 09:40:18 +02:00
139724ae8a update model with files and new attributes 2025-04-05 09:40:08 +02:00
7dd2e8c1c6 update entity with new attributes 2025-04-05 09:39:57 +02:00
87b52afab3 update entity with new attributes 2025-04-05 09:39:44 +02:00
0533d051c4 add migration column is pedido espera 2025-04-05 09:39:34 +02:00
fa03a872dc orden trabajo 2025-04-05 09:39:24 +02:00
c31aa262e2 upload files 2025-04-05 09:39:17 +02:00
87dcd73c40 Merge branch 'fix/lp_negrohq' into 'main'
arraglado

See merge request jjimenez/safekat!659
2025-04-05 06:49:48 +00:00
21dceb2c23 arraglado 2025-04-05 08:49:24 +02:00
1a3b067fbc Merge branch 'fix/remove_dual_presupuesto_aceptado' into 'main'
corregido

See merge request jjimenez/safekat!658
2025-04-04 16:30:42 +00:00
c493f7c8ac corregido 2025-04-04 18:30:24 +02:00
4545c33a27 Merge branch 'fix/cargar_user_id_presu_admin' into 'main'
corregido

See merge request jjimenez/safekat!657
2025-04-04 16:21:44 +00:00
e70e3b9683 corregido 2025-04-04 18:21:25 +02:00
f937695714 Merge branch 'fix/percent_margin_resumen_admin' into 'main'
corregido

See merge request jjimenez/safekat!656
2025-04-04 16:14:54 +00:00
6b1dc57821 corregido 2025-04-04 18:14:31 +02:00
077cfd7d82 Merge branch 'add/ajustar_margen' into 'main'
Add/ajustar margen

See merge request jjimenez/safekat!655
2025-04-04 15:04:15 +00:00
244361a1ce Merge branch 'main' into 'add/ajustar_margen'
Mergeados UserModel's y eliminadas referencias a App\Models\UserModel a favor...

See merge request jjimenez/safekat!654
2025-04-04 15:03:45 +00:00
cddf64b025 terminada modificacion 2025-04-04 17:03:08 +02:00
c9d6196aac Merge branch 'bug/users_overwrited' into 'main'
Mergeados UserModel's y eliminadas referencias a App\Models\UserModel a favor...

See merge request jjimenez/safekat!653
2025-04-04 07:53:46 +00:00
a0cb703991 trabajando 2025-04-04 09:21:36 +02:00
2d794aa1a3 Merge branch 'main' into fix/permisos-mensajeria-sidebar
Sección habilitada para todos los roles excepto cliente-administrador y cliente
2025-04-04 08:53:59 +02:00
6594cb6f51 Merge branch 'main' into bug/users_overwrited 2025-04-04 01:33:35 +02:00
c832af90d0 add import ChatNotificationModel 2025-04-04 01:32:50 +02:00
3d6e8b4886 update with ot files 2025-04-04 00:52:41 +02:00
00ff185cf1 orden_trabajo_files_table migrate 2025-04-04 00:51:55 +02:00
1777f435d9 get file and upload_files methods 2025-04-04 00:51:43 +02:00
b141dcacb8 add upload get files for ots 2025-04-04 00:51:06 +02:00
eae40ff4d8 Merge branch 'add/ajustar_margen' of https://git.imnavajas.es/jjimenez/safekat into add/ajustar_margen 2025-04-03 23:37:20 +02:00
cdf70c19ff añadidos ficheros nuevos 2025-04-03 23:37:14 +02:00
1d4f8696e1 Merge branch 'main' into 'add/ajustar_margen'
Main

See merge request jjimenez/safekat!651
2025-04-03 21:36:49 +00:00
6208839a12 empezando modificaciones 2025-04-03 23:36:12 +02:00
8830f59665 Merge branch 'rev/roles' into 'main'
Rev/roles

See merge request jjimenez/safekat!650
2025-04-03 20:21:42 +00:00
5b048b8a1b Revision roles soporte de tickets 2025-04-03 22:21:01 +02:00
92f7d30c99 Revision facturas en vista cliente 2025-04-03 22:09:28 +02:00
c9e655ca82 Revisado roles sistema y facturas 2025-04-03 21:44:58 +02:00
750847e3b6 Revisado roles Compras 2025-04-03 21:14:39 +02:00
d017115530 Merge branch 'main' into feat/sk-32 2025-04-03 20:30:17 +02:00
27126dbaed Merge branch 'main' into fix/permisos-mensajeria-sidebar 2025-04-03 20:23:02 +02:00
41bdae0623 fix focus dropdown notifications unviewed 2025-04-03 20:20:49 +02:00
e593f3000b roles message datatatables 2025-04-03 20:20:36 +02:00
0cde6d5fc5 allow all roles except cliente-administrador y cliente 2025-04-03 19:51:52 +02:00
465ab4c8f5 add cargo_null key 2025-04-03 19:51:19 +02:00
dc4647fee7 add default value if cargo is null in query 2025-04-03 19:51:07 +02:00
5d4cc98a91 Merge branch 'add/roles_facturas' into 'main'
añadidos roles facturacion

See merge request jjimenez/safekat!649
2025-04-03 17:41:06 +00:00
cbf4ddd550 añadidos roles facturacion 2025-04-03 19:40:33 +02:00
40b37962a8 Merge branch 'fix/resumen_margen_envio' into 'main'
arreglado el problema de que no se actualizaba bien el resumen cuando se...

See merge request jjimenez/safekat!648
2025-04-03 17:17:52 +00:00
4f07f45676 arreglado el problema de que no se actualizaba bien el resumen cuando se clickaba en recoger en taller 2025-04-03 19:17:34 +02:00
398afbaeda Arreglado bug añadir usuarios 2025-04-03 14:16:43 +02:00
a123c2dfa7 Mergeados UserModel's y eliminadas referencias a App\Models\UserModel a favor de App\Models\Usuarios\UserModel 2025-04-03 13:54:19 +02:00
ac804e9720 Eliminadas referencias a UsersEntity 2025-04-03 13:29:32 +02:00
ab63043f36 Unificada entidad de usuarios a UserEntity 2025-04-03 13:26:44 +02:00
b79f490f17 add check horas planning plana 2025-04-03 01:08:29 +02:00
bb848d391f Merge branch 'fix/sk-33' into 'main'
Fix/sk 33

See merge request jjimenez/safekat!647
2025-04-02 20:26:33 +00:00
cecf193e37 Merge branch 'main' into fix/sk-33 2025-04-02 22:25:22 +02:00
9cbbddcc1c fix chat view 2025-04-02 22:24:32 +02:00
5f3bc61a41 Merge branch 'fix/maquina_form_variantes' into 'main'
arreglado

See merge request jjimenez/safekat!646
2025-04-02 18:42:41 +00:00
0a10c91159 arreglado 2025-04-02 20:42:27 +02:00
2ff4a8fb9d Merge branch 'fix/porcentajes_resumen_admin' into 'main'
arreglado

See merge request jjimenez/safekat!645
2025-04-02 18:22:13 +00:00
d294ea2811 arreglado 2025-04-02 20:21:57 +02:00
69f6d6cbeb chat select cliente contactos 2025-04-02 20:19:16 +02:00
9e9eb1f56f Merge branch 'fix/actualizar_presupuestos_acabados' into 'main'
arreglado

See merge request jjimenez/safekat!644
2025-04-02 18:08:45 +00:00
91c820feed arreglado 2025-04-02 20:08:30 +02:00
b279bd5321 Merge branch 'mod/cambiar_proveedor_enc_admin' into 'main'
hecha la modificacione

See merge request jjimenez/safekat!643
2025-04-02 17:45:12 +00:00
9b83f6e722 hecha la modificacione 2025-04-02 19:44:54 +02:00
b5cc032afc Merge branch 'fix/guardar_presupuesto_coste_envio' into 'main'
arreglado

See merge request jjimenez/safekat!642
2025-04-02 17:17:55 +00:00
88e98962d1 arreglado 2025-04-02 19:17:40 +02:00
9d071e462c constraint chat functionalities to all roles, excep and 2025-04-02 18:49:36 +02:00
d51949c593 Merge branch 'fix/logistica-controller' into 'main'
fix logistica controller

See merge request jjimenez/safekat!641
2025-04-02 16:43:48 +00:00
4d21ff78ff fix logistica controller 2025-04-02 18:43:13 +02:00
3dc7b816a5 Merge branch 'mod/envio_resumen_admin' into 'main'
Mod/envio resumen admin

See merge request jjimenez/safekat!640
2025-04-02 16:39:49 +00:00
6e5d2c3e94 Merge branch 'main' into 'mod/envio_resumen_admin'
Main

See merge request jjimenez/safekat!639
2025-04-02 16:39:27 +00:00
a481375028 modificado 2025-04-02 18:38:48 +02:00
371e986baf Merge branch 'feat/printer-labels' into 'main'
Feat/printer labels

See merge request jjimenez/safekat!638
2025-04-02 16:30:14 +00:00
4872e498a5 Modificado el controlador 2025-04-02 15:53:30 +02:00
c960fd8539 Tunning parameters! 2025-04-02 14:03:32 +02:00
9924f27b5b tmp file 2025-04-02 14:00:10 +02:00
492c7366cf add ftp send printer 2025-04-02 13:54:51 +02:00
dc4db78b76 Merge branch 'feat/printer-labels' of https://git.imnavajas.es/jjimenez/safekat into feat/printer-labels 2025-04-02 13:54:06 +02:00
41291c82fd fx 2025-04-02 13:53:41 +02:00
69aa3f4837 Merge branch 'main' into feat/printer-labels 2025-04-02 13:50:34 +02:00
b4a835bbfd fix ftp send printer command 2025-04-02 13:42:24 +02:00
ef79cc5c2e Merge branch 'main' into 'feat/printer-labels'
Main

See merge request jjimenez/safekat!637
2025-04-02 10:14:38 +00:00
0f5e8a223b Merge branch 'fix/importador_papel_diferente' into 'main'
corregido typo en papelInteriorDiferente

See merge request jjimenez/safekat!636
2025-04-02 08:22:33 +00:00
ecbd762c7f corregido typo en papelInteriorDiferente 2025-04-02 10:22:11 +02:00
d42f46d280 etiqueta impresora 2025-04-02 08:16:58 +02:00
c2b61a3d99 Merge branch 'add/logistica_files' into 'main'
añadidos ficheros

See merge request jjimenez/safekat!635
2025-04-01 18:31:46 +00:00
babd832606 añadidos ficheros 2025-04-01 20:31:24 +02:00
210c87ab11 Merge branch 'add/vista_panel_logistica' into 'main'
añadido el panel (la vista)

See merge request jjimenez/safekat!634
2025-04-01 18:29:40 +00:00
efcda66c0b añadido el panel (la vista) 2025-04-01 20:28:56 +02:00
ff4587333a Merge branch 'mod/importador_presupuesto_gramajes_select' into 'main'
añadidos selects a los gramajes. si hay cambios se pone en naranja

See merge request jjimenez/safekat!633
2025-04-01 18:04:27 +00:00
121a29d493 añadidos selects a los gramajes. si hay cambios se pone en naranja 2025-04-01 20:04:05 +02:00
bb78f9cbd8 Merge branch 'fix/presupuesto_comentarios_pdf' into 'main'
Arreglada superposicion del footer con las observaciones del PDF

See merge request jjimenez/safekat!632
2025-04-01 08:06:56 +00:00
29245d45c4 Arreglada superposicion del footer con las observaciones del PDF 2025-04-01 10:06:28 +02:00
8a9df3a41a Merge branch 'fix/ot-tareas-table-fk' into 'main'
Fix/ot tareas table fk

See merge request jjimenez/safekat!631
2025-03-31 19:01:17 +00:00
d44686607a Merge branch 'main' into fix/ot-tareas-table-fk 2025-03-31 21:00:50 +02:00
432cc6be01 fix foreign keys set CASCADE constraint 2025-03-31 20:59:49 +02:00
04a2a44760 Merge branch 'feat/listados_cliente_form' into 'main'
Feat/listados cliente form

See merge request jjimenez/safekat!630
2025-03-31 18:45:18 +00:00
3cb512d93a añadidos presupuestos en cliente 2025-03-31 20:42:14 +02:00
fb2d12e318 con totales 2025-03-31 17:31:56 +02:00
c5feb39e8b Merge branch 'feat/listados_cliente_form' of https://git.imnavajas.es/jjimenez/safekat into feat/listados_cliente_form 2025-03-31 09:58:06 +02:00
d5534269b3 añadido facturas. faltan filtros pedidos 2025-03-31 09:57:45 +02:00
dde339ad44 Merge branch 'main' into 'feat/listados_cliente_form'
Main

See merge request jjimenez/safekat!629
2025-03-31 07:48:41 +00:00
cdc4bf6fcd Merge branch 'feat/corte-ot-planning' into 'main'
toggle corte rotativa planning

See merge request jjimenez/safekat!628
2025-03-31 07:06:51 +00:00
460cb0344f toggle corte rotativa planning 2025-03-31 09:05:03 +02:00
c7fdd1a9a3 Merge branch 'fix/sk-7/bugs' into 'main'
Fix/sk 7/bugs

See merge request jjimenez/safekat!627
2025-03-30 22:22:34 +00:00
c65c6571cd Merge branch 'main' into fix/sk-7/bugs 2025-03-31 00:19:12 +02:00
ba0ad10935 fix bugs sk-7 2025-03-31 00:17:49 +02:00
e1fa993fcd añadido facturas. faltan filtros pedidos 2025-03-30 21:36:17 +02:00
4991642d48 feat delete portada and remove loader 2025-03-30 19:30:30 +02:00
053ce49279 fix encuadernacion pliegos ot pdf and tareas maquinas primera 2025-03-30 18:20:05 +02:00
bc969828b9 ot pdf download 2025-03-30 14:22:43 +02:00
f553641818 Merge branch 'fix/varios_presupuesto_admin' into 'main'
arreglado calculo de credito total y vista en euros del toast del total de presupuesto en admin

See merge request jjimenez/safekat!626
2025-03-30 08:30:08 +00:00
5a5ce4835b arreglado calculo de credito total y vista en euros del toast del total de presupuesto en admin 2025-03-30 10:29:38 +02:00
4810ab99c1 Merge branch 'fix/calculo_creditos_presupuesto' into 'main'
arreglado problema con el resumen y valores totales a la hora de crear presupuestr

See merge request jjimenez/safekat!625
2025-03-29 13:04:25 +00:00
18f391a733 arreglado problema con el resumen y valores totales a la hora de crear presupuestr 2025-03-29 14:03:56 +01:00
1bd27776f4 Merge branch 'add/tabla_credito_presupuesto' into 'main'
Add/tabla credito presupuesto

See merge request jjimenez/safekat!624
2025-03-29 10:32:27 +00:00
30a6de5e75 Merge branch 'main' into 'add/tabla_credito_presupuesto'
Main

See merge request jjimenez/safekat!623
2025-03-29 10:31:40 +00:00
d1a9aaac77 añadida tabla de credito al presupuesto 2025-03-29 11:31:03 +01:00
e520b5b621 Merge branch 'feat/sk-7/planning' into 'main'
Feat/sk 7/planning

See merge request jjimenez/safekat!622
2025-03-29 10:09:22 +00:00
50cd951755 Merge branch 'main' into feat/sk-7/planning 2025-03-29 11:08:34 +01:00
8c64b678fe planning plana 2025-03-29 11:07:36 +01:00
8d289fde15 Merge branch 'fix/tarifas_encuadernacion_view' into 'main'
arreglado form de tarifas enc

See merge request jjimenez/safekat!621
2025-03-28 12:29:27 +00:00
c4b1620c1b arreglado form de tarifas enc 2025-03-28 13:29:01 +01:00
adfa8bc465 Merge branch 'add/calculo_credito_cliente' into 'main'
Add/calculo credito cliente

See merge request jjimenez/safekat!620
2025-03-27 23:53:07 +00:00
33ce64df0f terminada revision de pedidos 2025-03-28 00:52:49 +01:00
0e91105f68 Merge branch 'main' into 'add/calculo_credito_cliente'
Main

See merge request jjimenez/safekat!619
2025-03-27 16:54:12 +00:00
06bd6d4870 Merge branch 'mod/add_pedidos_facturas_produccion' into 'main'
modificado select de añadir pedidos en facturas

See merge request jjimenez/safekat!618
2025-03-27 16:39:06 +00:00
e3c494e68d modificado select de añadir pedidos en facturas 2025-03-27 17:38:42 +01:00
47455cd9c2 Merge branch 'fix/email_service' into 'main'
Añadido archivos EmailServies.php

See merge request jjimenez/safekat!617
2025-03-27 13:29:13 +00:00
5623df8797 Añadido archivos EmailServies.php 2025-03-27 14:28:56 +01:00
08cbee4ae8 Merge branch 'main' into 'add/calculo_credito_cliente'
Main

See merge request jjimenez/safekat!616
2025-03-27 13:02:39 +00:00
6929db5abc Merge branch 'feat/sk-7/planning' into 'main'
Feat/sk 7/planning

See merge request jjimenez/safekat!615
2025-03-27 13:01:32 +00:00
f43dd069d6 email Service merge 2025-03-27 14:00:55 +01:00
5a5e0be855 planning rot 2025-03-27 13:57:37 +01:00
3430b2d9d1 Merge branch 'main' into 'add/calculo_credito_cliente'
Main

See merge request jjimenez/safekat!614
2025-03-27 11:24:03 +00:00
793f378f98 cambiado controlador test para evitar errores en el merge 2025-03-27 12:23:49 +01:00
670c10fdde Merge branch 'dev/mail_service' into 'main'
Implementado servicio de envio de emails y funcion de envio a correo unico en etorno de desarrollo

See merge request jjimenez/safekat!613
2025-03-27 11:08:35 +00:00
f37805d310 Implementado servicio de envio de emails y funcion de envio a correo unico en etorno de desarrollo 2025-03-27 12:08:09 +01:00
e6ce820480 papel rotativa 2025-03-27 01:21:52 +01:00
1b38861465 credito 2025-03-26 23:31:31 +01:00
e44421fb4d fix store ot 2025-03-26 23:29:19 +01:00
81573eede4 rotativa planning 2025-03-26 21:01:31 +01:00
09e8af15cc probando todo 2025-03-26 20:59:04 +01:00
4a6b974e94 Merge branch 'fix/max_solapas_admin' into 'main'
arreglado

See merge request jjimenez/safekat!612
2025-03-26 18:37:23 +00:00
ee7c161ef2 arreglado 2025-03-26 19:36:50 +01:00
ff73caec21 Merge branch 'fix/open_cliente_presupuesto' into 'main'
modificado el link a cliente (icono busqueda) desde presupuesto admin

See merge request jjimenez/safekat!611
2025-03-26 18:03:31 +00:00
f89f3bf00f modificado el link a cliente (icono busqueda) desde presupuesto admin 2025-03-26 19:03:08 +01:00
77093e7311 añadidas las conexiones a las vistas 2025-03-26 14:50:45 +01:00
f2aa8f6287 Merge branch 'fix/generar_albaranes_ocultar' into 'main'
arreglado bug en albaranes

See merge request jjimenez/safekat!610
2025-03-25 23:06:21 +00:00
13693655f1 arreglado bug en albaranes 2025-03-26 00:05:44 +01:00
927b58245d Merge branch 'feat/sk-31' into 'main'
add all message datatable and alertboxes instead of toast

See merge request jjimenez/safekat!609
2025-03-25 19:15:09 +00:00
d15bbb42f1 add all message datatable and alertboxes instead of toast 2025-03-25 20:14:07 +01:00
99bd10b979 Merge branch 'fix/preview-presupuesto-cliente' into 'main'
Fix/preview presupuesto cliente

See merge request jjimenez/safekat!608
2025-03-25 17:55:11 +00:00
9c3ee4b24a Merge branch 'main' into fix/preview-presupuesto-cliente 2025-03-25 18:54:45 +01:00
43dd04a0a2 fix preview download 2025-03-25 18:51:44 +01:00
8caa6e8bab fix download 2025-03-25 18:29:39 +01:00
9ebdc4441f Merge branch 'fix/guardar_tiradas_alternativas' into 'main'
arreglado el guardar tiradas alternativas en presupuesto admin

See merge request jjimenez/safekat!607
2025-03-25 17:25:36 +00:00
37fba3604a arreglado el guardar tiradas alternativas en presupuesto admin 2025-03-25 18:25:11 +01:00
c3ab272de3 Merge branch 'mod/pedidos_albaranes' into 'main'
Mod/pedidos albaranes

See merge request jjimenez/safekat!606
2025-03-25 17:00:25 +00:00
c54242eb24 terminadas modificaciones albaranes 2025-03-25 18:00:02 +01:00
180b845b1a modificando albaranes 2025-03-25 17:44:43 +01:00
7b3096efb3 Merge branch 'feat/sk-31' into 'main'
Feat/sk 31

See merge request jjimenez/safekat!605
2025-03-24 21:47:38 +00:00
20db840bf9 Merge branch 'main' into feat/sk-31 2025-03-24 22:46:25 +01:00
74867ca1ac send email 2025-03-24 22:45:02 +01:00
3c4b7e71e4 Merge branch 'fix/falta_ficheros' into 'main'
añadidos ficheros faltantes

See merge request jjimenez/safekat!604
2025-03-24 10:49:00 +00:00
9d6ead4472 añadidos ficheros faltantes 2025-03-24 11:48:11 +01:00
c0d54e28b7 message refactor 2025-03-24 08:12:06 +01:00
754bea37a8 Merge branch 'mod/pedido_form' into 'main'
Mod/pedido form

See merge request jjimenez/safekat!603
2025-03-23 18:41:27 +00:00
67546d347f añadido calculo y aviso de unidades en albaranes 2025-03-23 19:41:10 +01:00
a18207202c añadido generar factura desde pedido 2025-03-23 13:14:46 +01:00
fc62ef582a Merge branch 'mod/vista_factura_list' into 'main'
mejorada la vista de lista de facturas

See merge request jjimenez/safekat!602
2025-03-22 17:51:17 +00:00
6979670eae mejorada la vista de lista de facturas 2025-03-22 18:50:44 +01:00
8dc6d7fee2 Merge branch 'mod/listado_facturas' into 'main'
Mod/listado facturas

See merge request jjimenez/safekat!601
2025-03-21 17:27:59 +00:00
e1d208a4dd resuelto problema presupuesto cliente 2025-03-21 18:27:31 +01:00
af25237fa5 modificado el listado. faltan los selects 2025-03-20 22:26:48 +01:00
a1cef4eac3 Merge branch 'mod/open_cliente_from' into 'main'
añadido icono para abrir cliente en presupuesto

See merge request jjimenez/safekat!600
2025-03-20 18:10:56 +00:00
7986627a62 añadido icono para abrir cliente en presupuesto 2025-03-20 19:10:39 +01:00
61af547135 Merge branch 'main' into feat/sk-31 2025-03-20 08:21:42 +01:00
6e96beeec8 messages departments section 2025-03-20 08:20:50 +01:00
0fd4fd4410 Merge branch 'fix/problemas_presu_admin' into 'main'
Fix/problemas presu admin

See merge request jjimenez/safekat!599
2025-03-19 19:55:37 +00:00
f6c2e608cf corregidos varios fallos en el importador. Añadidos avisos de error y success al importar 2025-03-19 20:55:08 +01:00
756578a251 añadido footer con los usuarios en pedidos 2025-03-19 19:41:17 +01:00
63ec2c8bf0 añadido footer con los usuarios en facturas 2025-03-19 19:38:05 +01:00
8f6c86bad5 añadido footer de modificaciones en presupuesto 2025-03-19 17:39:51 +01:00
7106d46106 se ha añadido el iva reducido en el presupuesto de administrador 2025-03-19 14:41:13 +01:00
b9a742a7a7 solucionados algunos problemas con las tiradas alternativas 2025-03-19 12:19:08 +01:00
042ab22b08 Merge branch 'fix/presupuestoservice_paginas' into 'main'
arreglado problema en presupuesto cliente service que machacaba el numero de paginas

See merge request jjimenez/safekat!598
2025-03-18 19:45:11 +00:00
e3cb1f81b9 arreglado problema en presupuesto cliente service que machacaba el numero de paginas 2025-03-18 20:44:44 +01:00
bbd8104ce7 Merge branch 'add/import_old_presupuestos' into 'main'
Add/import old presupuestos

See merge request jjimenez/safekat!597
2025-03-18 19:22:17 +00:00
60554fd479 cambiado breadcrumb y titulo de la página 2025-03-18 20:21:46 +01:00
e9c889624d terminado importador 2025-03-18 20:19:54 +01:00
daafdf2d5a faltan las direcciones 2025-03-18 15:58:03 +01:00
5e542dc862 Merge branch 'main' into 'add/import_old_presupuestos'
Main

See merge request jjimenez/safekat!596
2025-03-18 09:21:18 +00:00
ac2d93eb7a trabajando en el envio de datos 2025-03-18 10:20:42 +01:00
2dfa0a947a Merge branch 'fix/tiempo_min_servicios' into 'main'
Correccion redondeo a cero

See merge request jjimenez/safekat!595
2025-03-18 09:20:02 +00:00
9370442103 Correccion redondeo a cero 2025-03-18 10:19:24 +01:00
d417db18e2 fix store message 2025-03-17 23:16:11 +01:00
4ef91da9b3 add sweetAlert js 2025-03-17 06:59:33 +01:00
3662613ba5 add client to chat 2025-03-17 06:50:35 +01:00
55157d23aa message client department 2025-03-16 23:13:03 +01:00
b627146dc4 añadido el select2 de los acabados 2025-03-16 21:21:04 +01:00
e71dd46a48 terminada la recogida de datos fundamentales 2025-03-16 21:13:22 +01:00
f6da97d9eb Merge branch 'main' into 'add/import_old_presupuestos'
Main

See merge request jjimenez/safekat!594
2025-03-15 08:13:55 +00:00
ed7e697d2d Merge branch 'fix/permisos_tarifas' into 'main'
añadido permisos de borrar en las listas de las tarifas

See merge request jjimenez/safekat!593
2025-03-14 09:55:05 +00:00
bc03dd6a46 añadido permisos de borrar en las listas de las tarifas 2025-03-14 10:54:36 +01:00
cd3df81bc9 trabajando en el importador 2025-03-13 22:17:20 +01:00
02596457d8 Configuracion para acceso a bbdd remota 2025-03-13 15:30:12 +01:00
36c5728b30 Merge branch 'fix/new_presu_cliente_ser_extra' into 'main'
corregido

See merge request jjimenez/safekat!592
2025-03-12 17:05:51 +00:00
c1ba45f124 corregido 2025-03-12 18:05:27 +01:00
6ff93a034c Merge branch 'fix/overwirte_api' into 'main'
Repuestas las modificaciones que se han sobrescrito

See merge request jjimenez/safekat!591
2025-03-09 19:26:22 +00:00
9ada8d0ba0 Repuestas las modificaciones que se han sobrescrito 2025-03-09 20:25:47 +01:00
76208d9720 Merge branch 'fix/ajustar_precios_envio' into 'main'
ajustado para que de el mismo precio de envio (problema con los decimales)

See merge request jjimenez/safekat!590
2025-03-06 19:16:02 +00:00
a4658ce104 ajustado para que de el mismo precio de envio (problema con los decimales) 2025-03-06 20:15:38 +01:00
44d484da29 Merge branch 'fix/acabados_presupuesto_admin' into 'main'
Fix/acabados presupuesto admin

See merge request jjimenez/safekat!589
2025-03-05 18:53:14 +00:00
ce95556a88 arreglado el insertar servicios de acabado (cogia los servicios compuestos) 2025-03-05 19:52:37 +01:00
904e429c95 quitada la visibilidad de las columnas para debug en acabados 2025-03-05 19:50:39 +01:00
ecba8a73af solucionado el problema al insertar lineas con los acabados en presupuesto admin 2025-03-05 19:49:58 +01:00
8ef08d93e9 Merge branch 'mod/quitar_ser_plegado_guardar' into 'main'
quitado el meter el servicio de plegado de guardas

See merge request jjimenez/safekat!588
2025-03-05 17:13:34 +00:00
f0e9f3562c quitado el meter el servicio de plegado de guardas 2025-03-05 18:13:11 +01:00
f78d392d59 Merge branch 'mod/ancho_max_solapas' into 'main'
cambiado el calculo del ancho máximo de solapas. ahora se compara con el 95% del ancho del libro

See merge request jjimenez/safekat!587
2025-03-05 16:52:39 +00:00
10778831e5 cambiado el calculo del ancho máximo de solapas. ahora se compara con el 95% del ancho del libro 2025-03-05 17:52:16 +01:00
7660c1400b Merge branch 'feat/editorjs-layout-plugin' into 'main'
add layout

See merge request jjimenez/safekat!586
2025-03-05 09:52:00 +00:00
a233467539 add layout 2025-03-05 10:50:47 +01:00
c699da12c8 Merge branch 'fix/svg-resize-previews' into 'main'
Fix/svg resize previews

See merge request jjimenez/safekat!585
2025-03-04 23:52:00 +00:00
172165c27a remove btn refresh preview 2025-03-05 00:51:14 +01:00
b6a17e0d34 resize svg previews 2025-03-05 00:49:05 +01:00
d65105ed13 Merge branch 'mod/servicios_extra_cliente' into 'main'
Mod/servicios extra cliente

See merge request jjimenez/safekat!584
2025-03-04 19:13:32 +00:00
2edde4943d terminado incluyendo el menu lateral 2025-03-04 20:13:11 +01:00
2587a6b4ac terminados servicios extra 2025-03-04 19:01:30 +01:00
e5e53c026a Merge branch 'fix/api_il_guardar' into 'main'
Corregida ruta api/salvar

See merge request jjimenez/safekat!583
2025-03-02 21:00:55 +00:00
4c75cb6f94 Corregida ruta api/salvar 2025-03-02 21:02:42 +01:00
e8af8aad43 Merge branch 'feat/wiki' into 'main'
Feat/wiki

See merge request jjimenez/safekat!582
2025-03-02 12:44:46 +00:00
24412c63ca add name translation wiki-section 2025-03-02 13:44:10 +01:00
18700b6c96 add translations 2025-03-02 12:29:01 +01:00
df2707063b Merge branch 'feat/wiki' into 'main'
Feat/wiki

See merge request jjimenez/safekat!581
2025-03-02 09:25:35 +00:00
3140e527e8 feat wiki/ayuda section 2025-03-02 10:22:01 +01:00
b99fb1a3e4 Merge branch 'fix/servicios_defecto' into 'main'
Fix/servicios defecto

See merge request jjimenez/safekat!580
2025-02-27 16:18:34 +00:00
e9612b0bc2 añadido la linea de servicio para ferro digital 2025-02-27 17:18:16 +01:00
de01161964 solucionado problema con los checks de retractilado 2025-02-27 17:10:10 +01:00
1857fb0537 Merge branch 'fix/ser_solapas_repetido_en_admin' into 'main'
arreglado. añadida comprobación para los demás servicios

See merge request jjimenez/safekat!579
2025-02-27 15:41:02 +00:00
3809493c79 arreglado. añadida comprobación para los demás servicios 2025-02-27 16:40:43 +01:00
157bff170c Merge branch 'fix/añadir_solapas_sobrec_admin' into 'main'
arreglado fallo en la obtención del papel interior en presu cliente

See merge request jjimenez/safekat!578
2025-02-27 15:30:07 +00:00
dfa9f76621 arreglado fallo en la obtención del papel interior en presu cliente 2025-02-27 16:29:31 +01:00
b126c910d6 Merge branch 'mod/comentarios_admin' into 'main'
ya se puede pulsar enter dentro del comentario. se vuelve a ver la exclamación cuando hay

See merge request jjimenez/safekat!577
2025-02-27 15:13:06 +00:00
34c79118b7 ya se puede pulsar enter dentro del comentario. se vuelve a ver la exclamación cuando hay 2025-02-27 16:12:15 +01:00
f945d19972 Merge branch 'add/lomo_redondo_service' into 'main'
Add/lomo redondo service

See merge request jjimenez/safekat!576
2025-02-27 14:59:34 +00:00
a58d8a2b81 modificado para presupuesto cliente 2025-02-27 15:59:15 +01:00
a9333448ee modificado para presupuesto admin 2025-02-27 14:45:51 +01:00
c86f1799b5 Merge branch 'fix/mermas_pod' into 'main'
arreglado typo en el calculo de mermas

See merge request jjimenez/safekat!575
2025-02-27 12:55:51 +00:00
977ab6400f arreglado typo en el calculo de mermas 2025-02-27 13:55:27 +01:00
8e3df0f113 Merge branch 'fix/add_serv_acabado' into 'main'
arreglado

See merge request jjimenez/safekat!574
2025-02-27 06:39:34 +00:00
ac606b28e0 arreglado 2025-02-27 07:39:00 +01:00
71590ba2ce Merge branch 'add/serv_acabado_desdoblados' into 'main'
Add/serv acabado desdoblados

See merge request jjimenez/safekat!573
2025-02-26 20:32:06 +00:00
94c8076f3a modificado presupuesto cliente 2025-02-26 21:31:42 +01:00
4adc124ca2 añadidos ficheros nuevos 2025-02-26 21:11:41 +01:00
794e549abc Merge branch 'add/serv_acabado_desdoblados' of https://git.imnavajas.es/jjimenez/safekat into add/serv_acabado_desdoblados 2025-02-26 21:10:57 +01:00
34378e0d93 servicios desdoblados en presupuesto admin 2025-02-26 21:09:39 +01:00
3204d550b7 Merge branch 'main' into 'add/serv_acabado_desdoblados'
Main

See merge request jjimenez/safekat!572
2025-02-26 08:18:27 +00:00
4bf8018c65 Merge branch 'fix/presupuesto_pdf_fb' into 'main'
Fix/presupuesto pdf fb

See merge request jjimenez/safekat!571
2025-02-26 07:33:51 +00:00
26980297ed Merge branch 'main' into 'fix/presupuesto_pdf_fb'
Main

See merge request jjimenez/safekat!570
2025-02-26 07:25:59 +00:00
0b786d42a7 Merge branch 'fix/messages' into 'main'
fix datatable messages

See merge request jjimenez/safekat!569
2025-02-26 07:19:16 +00:00
ae561d1e19 fix datatable messages 2025-02-26 08:11:12 +01:00
30e1561a0b trabajando en el edit 2025-02-25 21:31:32 +01:00
3406fb3005 editor form 2025-02-25 18:41:59 +01:00
ff59207d4c arreglado merma pod 2025-02-25 17:15:31 +01:00
fcd6adebb7 Implementacion de feedback JM sobre presupuestos 2025-02-25 15:36:11 +01:00
fbfa70a734 realizada la lista 2025-02-24 20:59:32 +01:00
4601b15abe realizada la lista 2025-02-24 20:59:21 +01:00
c1cae0fcf7 añadida migracion y modelo, entidad y controlador basicos 2025-02-24 09:59:35 +01:00
c5f1f0e55a Merge branch 'fix/confirmar_presupuesto' into 'main'
Fix/confirmar presupuesto

See merge request jjimenez/safekat!568
2025-02-23 20:26:12 +00:00
dc92e352b9 resuelto problema al confirmar presupuesto precio distinto 2025-02-23 21:25:53 +01:00
046c31eb62 resolviendo el problema 2025-02-23 19:41:35 +01:00
eea947e80b wiki features 2025-02-23 00:14:07 +01:00
d347c9187b Merge branch 'feat/presupuestos_pdf' into 'main'
Revisada la generacion de presupuestos en PDf

See merge request jjimenez/safekat!567
2025-02-22 22:26:47 +00:00
0f7fa4a809 Revisada la generacion de presupuestos en PDf 2025-02-22 23:25:52 +01:00
f270b6dee8 wiki 2025-02-22 20:56:06 +01:00
190037f9df Merge branch 'mod/serv_defecto_admin' into 'main'
quitado el botón de servicios defecto. Se añaden automaticamente cuando se crea

See merge request jjimenez/safekat!566
2025-02-22 18:26:12 +00:00
73980295da quitado el botón de servicios defecto. Se añaden automaticamente cuando se crea 2025-02-22 19:25:19 +01:00
339c979ded Merge branch 'main' into feat/wiki 2025-02-22 07:26:52 +01:00
03870cf133 Merge branch 'fix/toast' into 'main'
fix toast presupuesto

See merge request jjimenez/safekat!565
2025-02-22 06:26:20 +00:00
e7088b635a fix toast presupuesto 2025-02-22 07:15:49 +01:00
def7539710 Merge branch 'fix/comparador_rotativa_admin' into 'main'
arreglado problemas rotativa y comparador rotativa

See merge request jjimenez/safekat!564
2025-02-21 16:26:33 +00:00
6264dbe17e arreglado problemas rotativa y comparador rotativa 2025-02-21 17:26:07 +01:00
755b12e830 Merge branch 'dev/api_il_2' into 'main'
Dev/api il 2

See merge request jjimenez/safekat!563
2025-02-21 13:04:40 +00:00
83dedefa23 Merge branch 'main' into 'dev/api_il_2'
Main

See merge request jjimenez/safekat!562
2025-02-21 13:03:55 +00:00
feea7d7437 Implementacion API IL guardar 2025-02-21 14:02:47 +01:00
c666925101 Merge branch 'fix/factor' into 'main'
Fix/factor

See merge request jjimenez/safekat!561
2025-02-20 19:45:49 +00:00
068a2307bc arreglado 2025-02-20 20:45:33 +01:00
9329aececc solucionado 2025-02-20 20:28:29 +01:00
9311c7b9ae Merge branch 'mod/texto_coste_maquina' into 'main'
arreglado factor resumen y cambiado texto

See merge request jjimenez/safekat!560
2025-02-20 19:25:10 +00:00
851b224149 arreglado factor resumen y cambiado texto 2025-02-20 20:24:54 +01:00
627d59444b Merge branch 'fix/costes_impresion_rot_resumen' into 'main'
corregido

See merge request jjimenez/safekat!559
2025-02-20 19:13:40 +00:00
8c771d9779 corregido 2025-02-20 20:13:20 +01:00
e32a5e4820 Merge branch 'fix/tarifas_extra_presu_cliente' into 'main'
Fix/tarifas extra presu cliente

See merge request jjimenez/safekat!558
2025-02-20 19:00:25 +00:00
ad0f5d4234 solucionado problema en getdata en resumen y totalizador coste maquina 2025-02-20 20:00:06 +01:00
ebaf4364ac resuelto el problema de los servicios acabado 2025-02-20 19:19:43 +01:00
bff5830c9b Merge branch 'mod/horas_maquinas_a_margen' into 'main'
terminado

See merge request jjimenez/safekat!557
2025-02-20 18:01:58 +00:00
91796e993c terminado 2025-02-20 19:01:16 +01:00
091088085c Merge branch 'dev/api_il_2' of https://git.imnavajas.es/jjimenez/safekat into dev/api_il_2 2025-02-20 12:06:44 +01:00
e81dc3f88f Refector 2025-02-20 12:06:21 +01:00
9d423c7fa9 Merge branch 'main' into 'dev/api_il_2'
create migration to add check_presupuesto_cliente column to tarifas tables...

See merge request jjimenez/safekat!556
2025-02-20 10:58:11 +00:00
cf74749889 Merge branch 'feat/soporte' into 'main'
Feat/soporte

See merge request jjimenez/safekat!555
2025-02-20 09:51:16 +00:00
fdd5076920 añadida validacion 2025-02-20 10:50:23 +01:00
b0c2beb334 Merge branch 'main' into 'feat/soporte'
create migration to add check_presupuesto_cliente column to tarifas tables...

See merge request jjimenez/safekat!554
2025-02-20 08:59:47 +00:00
a3cf44d405 Merge branch 'fix/toast-width-total-presupuesto' into 'main'
reduce size toast total presupuesto

See merge request jjimenez/safekat!553
2025-02-20 07:37:07 +00:00
e76540ab52 reduce size toast total presupuesto 2025-02-20 08:36:39 +01:00
4fee73229b Merge branch 'feat/add-check-cliente-tarifa-extra' into 'main'
create migration to add check_presupuesto_cliente column to tarifas tables...

See merge request jjimenez/safekat!552
2025-02-20 07:25:32 +00:00
1af261eff9 add mostrar_presupuesto_cliente field in tarifas extra y preimpresion 2025-02-20 08:24:01 +01:00
84e7bf3dbb Resolviendo bugs para integracion end2end de IL 2025-02-19 22:04:51 +01:00
b6decf8657 terminado 2025-02-19 21:35:55 +01:00
fea409b5ad haciendo el buscador 2025-02-19 15:00:20 +01:00
1da50e9f01 Merge branch 'main' into 'feat/soporte'
Main

See merge request jjimenez/safekat!551
2025-02-19 13:02:31 +00:00
4576747ac1 Merge branch 'fix/preview_presu_cliente_solapas' into 'main'
arreglado

See merge request jjimenez/safekat!550
2025-02-19 09:55:05 +00:00
35c988a0be arreglado 2025-02-19 10:52:45 +01:00
b22012d170 Merge branch 'fix/autonumeric-precio-tarifa-maquina-editor' into 'main'
add 6 decimal places precio tarifa impresion maquina

See merge request jjimenez/safekat!549
2025-02-18 18:34:14 +00:00
da7d768f36 add 6 decimal places precio tarifa impresion maquina 2025-02-18 19:33:24 +01:00
c905e7c005 Merge branch 'main' into 'feat/soporte'
Main

See merge request jjimenez/safekat!548
2025-02-18 11:13:37 +00:00
bd8ed62423 Merge branch 'fix/buscador_servicios' into 'main'
arreglado nombre de la table en el buscador del select2

See merge request jjimenez/safekat!547
2025-02-18 11:10:37 +00:00
878efb4378 arreglado nombre de la table en el buscador del select2 2025-02-18 12:10:09 +01:00
a8339390b8 Merge branch 'fix/comercial_presu_cliente_menu' into 'main'
corregidos permisos borrar en presupuestos

See merge request jjimenez/safekat!546
2025-02-18 11:01:10 +00:00
af9986f354 corregidos permisos borrar en presupuestos 2025-02-18 12:00:44 +01:00
2402ea2835 Merge branch 'fix/tapa_blanda_sin_solapas_quitaroffset' into 'main'
solucionado el problema

See merge request jjimenez/safekat!545
2025-02-18 10:29:24 +00:00
dd54c69aba solucionado el problema 2025-02-18 11:28:51 +01:00
4beef3b0ae Merge branch 'fix/margenes-maquinas-format' into 'main'
fix decimals number

See merge request jjimenez/safekat!544
2025-02-18 08:27:53 +00:00
4409ed8652 fix decimals number 2025-02-18 08:26:18 +00:00
1ea00b5522 editorjs 2025-02-18 08:15:26 +00:00
4b1092df5f editorjs 2025-02-18 08:15:14 +00:00
3cdc38b822 terminadas respuesta. falta repasar todo y cabecera datatable y permisos menus y botones 2025-02-17 20:56:32 +01:00
61fdceb8e1 add field activo in papel_generico 2025-02-16 23:04:15 +00:00
ea8765e708 add field checkbox (acabado,manipulado,encuadernacion) 2025-02-16 22:41:08 +00:00
71b8b2db13 add mostrar_en_presupuesto_cliente field in models,entities and datatables in list views 2025-02-16 20:10:27 +00:00
8b03dc6de6 change table name to mostrar_en_presupuesto_cliente 2025-02-16 19:54:21 +00:00
b6b8df0061 create migration to add check_presupuesto_cliente column to tarifas tables (encuadernacion,manipulado,acabado) 2025-02-16 19:53:02 +00:00
3c1ef699bf fix toast 2025-02-16 19:38:30 +00:00
809a705c88 terminado tickets. faltan respuestas 2 2025-02-16 18:58:38 +01:00
aff79ec3d6 terminado tickets. faltan respuestas 2025-02-16 18:52:56 +01:00
82665c778d add toast to show total presupuesto 2025-02-16 09:54:13 +00:00
47fa27402f message Service added 2025-02-16 08:10:07 +00:00
4364bc3c07 message service 2025-02-15 17:54:53 +01:00
4a8aaf906c trabajando en la lista de tickets 2025-02-15 17:54:49 +01:00
a616ec7ba7 trabajando en el formulario de añadir 2025-02-14 23:45:28 +01:00
b3cc82636d empezada la estructura de tickets 2025-02-14 12:14:23 +01:00
eea415fb47 Merge branch 'fix/papel_especial_interior_cliente' into 'main'
corregido error en get papel especial interior

See merge request jjimenez/safekat!543
2025-02-13 18:02:19 +00:00
5045431b97 corregido error en get papel especial interior 2025-02-13 19:01:28 +01:00
8657218c7a Merge branch 'fix/coser_hilo_admin' into 'main'
corregido error de la tarifa cosido

See merge request jjimenez/safekat!542
2025-02-12 18:02:19 +00:00
5b7493f3cf corregido error de la tarifa cosido 2025-02-12 19:01:44 +01:00
3f7e95322c Merge branch 'add/guardas_negro_hq' into 'main'
añadida posibilidad de guardas negrohq

See merge request jjimenez/safekat!541
2025-02-11 18:03:40 +00:00
b8b5d5f69b añadida posibilidad de guardas negrohq 2025-02-11 19:03:15 +01:00
7066a63254 Merge branch 'fix/merma_POD_presuadmin' into 'main'
Fix/merma pod presuadmin

See merge request jjimenez/safekat!540
2025-02-10 19:01:49 +00:00
10d5c286a6 añadido calcular mermas en el draw de la slineas presupuesto 2025-02-10 20:01:21 +01:00
343899013f error en faja.getVal(). error en gramaje guardas 2025-02-10 19:48:35 +01:00
c1509baef9 Merge branch 'fix/guardas_sin_impresion' into 'main'
arreglado guardas sin impresion. arreglado error en comparador para evitar...

See merge request jjimenez/safekat!539
2025-02-10 17:53:20 +00:00
77adb8ac37 Merge branch 'main' into 'fix/guardas_sin_impresion'
Main

See merge request jjimenez/safekat!538
2025-02-10 17:53:03 +00:00
bf987a7ce3 arreglado guardas sin impresion. arreglado error en comparador para evitar cuando se carga. Corregidos decimales en presu cliente tarjeta tiradas 2025-02-10 18:52:14 +01:00
84a1b3cf98 Merge branch 'fix/login-redirect' into 'main'
fix xmlhttprequest

See merge request jjimenez/safekat!537
2025-02-10 17:17:05 +00:00
97a05d5568 fix xmlhttprequest 2025-02-10 18:16:16 +01:00
32a80370d9 Merge branch 'fix/login-redirect' into 'main'
fix login redirect ajax request

See merge request jjimenez/safekat!536
2025-02-10 17:14:03 +00:00
49a1904eae fix login redirect ajax request 2025-02-10 18:11:46 +01:00
3b80471773 Merge branch 'fix/autonumeric-tintas-datatable' into 'main'
Fix/autonumeric tintas datatable

See merge request jjimenez/safekat!535
2025-02-10 08:48:33 +00:00
0457ac97eb fix autonumeric datatable & editor datatable consumo tintas 2025-02-10 09:47:55 +01:00
977cdeb12b delete is deleted column 2025-02-10 09:42:48 +01:00
73d8c919bc Merge branch 'fix/sk-12' into 'main'
Fix/sk 12

See merge request jjimenez/safekat!534
2025-02-10 08:35:46 +00:00
071d386d36 redirect notification message to model edit form 2025-02-10 09:32:48 +01:00
41783f5b25 fix message cliente direct from model js 2025-02-10 07:56:48 +01:00
0d2a57592c remove is_deleted 2025-02-10 07:26:27 +01:00
a07e68a603 Merge branch 'add/mostrar_lomo_cubierta' into 'main'
añadidos lomos en resumen lateral y final. Arreglado tb alto de preview en presupuesto admin

See merge request jjimenez/safekat!533
2025-02-09 14:21:01 +00:00
7b7e386ffd añadidos lomos en resumen lateral y final. Arreglado tb alto de preview en presupuesto admin 2025-02-09 15:20:31 +01:00
e8145888c9 Merge branch 'fix/cambio_cubierta_guardar_valores' into 'main'
Fix/cambio cubierta guardar valores

See merge request jjimenez/safekat!532
2025-02-09 12:31:56 +00:00
5475fd8ad9 Merge branch 'fix/cambio_cubierta_guardar_valores' of https://git.imnavajas.es/jjimenez/safekat into fix/cambio_cubierta_guardar_valores 2025-02-09 13:31:22 +01:00
206a5e0cca Merge branch 'main' into 'fix/cambio_cubierta_guardar_valores'
Main

See merge request jjimenez/safekat!531
2025-02-09 12:31:15 +00:00
b496553e09 solucionado el problema que se perdia la config cuando se cambiaba el tipo de cubierta 2025-02-09 13:31:13 +01:00
383c51ee1e Merge branch 'refactor/sk-12-21' into 'main'
Refactor/sk 12 21

See merge request jjimenez/safekat!530
2025-02-09 12:25:48 +00:00
ff92691a07 Merge branch 'main' into refactor/sk-12-21 2025-02-09 13:24:55 +01:00
8cbcd3ccb7 change Chat text to Mensajes Clientes 2025-02-09 13:22:59 +01:00
363976833c Merge branch 'mod/papel_seleccionable_sobre_guardas' into 'main'
papel y gramaje  sobrecubierta y guardas seleccionable

See merge request jjimenez/safekat!529
2025-02-09 12:16:23 +00:00
348dda9cd1 papel y gramaje sobrecubierta y guardas seleccionable 2025-02-09 13:16:03 +01:00
9b7c6c4ec1 add autonumeric format & fix editor btn in tarifa impresion maquina 2025-02-09 13:12:37 +01:00
3efec5e6cb add autonumeric to number cells of datatables and editorDatatable 2025-02-09 12:40:52 +01:00
816a321e1a format autonumeric column total_tirada 2025-02-09 12:35:38 +01:00
8105388563 fix column total_presupuesto for autonumeric format 2025-02-09 12:34:10 +01:00
c3791ac343 fix render in column total_presupuesto for autonumeric format 2025-02-09 12:31:38 +01:00
eb722ebbca autonumeric format in tableOfTarifaencuadernacionlineasHoras 2025-02-09 12:28:34 +01:00
aebc38a126 tarifa acabo lineas format number datatable 2025-02-09 12:14:34 +01:00
ad8bdb7d5e Merge branch 'main' into refactor/sk-21 2025-02-09 12:06:24 +01:00
5db68ed991 Merge branch 'add/mensaje_acabados_cliente' into 'main'
añadido mensaje para avisar de la cubierta sin acabado

See merge request jjimenez/safekat!528
2025-02-09 09:07:52 +00:00
32398d8742 añadido mensaje para avisar de la cubierta sin acabado 2025-02-09 10:07:27 +01:00
f532c79b27 add format number in datatables 2025-02-09 00:25:52 +01:00
cf6d4318c3 Merge branch 'add/ducplicar_presu_cliente' into 'main'
añadido botón duplicar presupuesto en cliente

See merge request jjimenez/safekat!527
2025-02-08 21:34:53 +00:00
5ad2fcd566 añadido botón duplicar presupuesto en cliente 2025-02-08 22:34:31 +01:00
21a4e5b8bd Merge branch 'main' into refactor/sk-21 2025-02-08 19:04:18 +01:00
a138330e24 Merge branch 'fix/guardas_presupuesto_admin' into 'main'
arreglado problema con las guardas y solicitudes comparador

See merge request jjimenez/safekat!526
2025-02-06 18:37:17 +00:00
09683d9be5 arreglado problema con las guardas y solicitudes comparador 2025-02-06 19:36:48 +01:00
6cc9045eb4 Merge branch 'fix/cargando_comparador' into 'main'
solucionado el problema

See merge request jjimenez/safekat!525
2025-02-06 10:16:43 +00:00
82537d9806 solucionado el problema 2025-02-06 11:16:12 +01:00
04e5090095 Merge branch 'fix/fileUploadDropzone' into 'main'
fix initialization of fileUploadDropzone

See merge request jjimenez/safekat!524
2025-02-06 10:09:59 +00:00
bddd99cec0 fix initialization of fileUploadDropzone 2025-02-06 11:08:54 +01:00
b096d0469d Merge branch 'fix/requiere_papel_comparador' into 'main'
Fix/requiere papel comparador

See merge request jjimenez/safekat!523
2025-02-05 23:35:20 +00:00
bbe802d2b7 arreglados buscadores de papeles en presupuesto admin 2025-02-06 00:34:53 +01:00
2a32bc0b80 se actualiza el comparador despues de cargar para evitar el mensaje de seleccione papel 2025-02-06 00:15:49 +01:00
38db358eae Merge branch 'fix/tiempo_maquina_decimales' into 'main'
redondeado el tiempo de maquina  a2 decimales

See merge request jjimenez/safekat!522
2025-02-05 20:34:23 +00:00
021cd51666 redondeado el tiempo de maquina a2 decimales 2025-02-05 21:33:40 +01:00
77bb8cad91 Merge branch 'fix/alto_faja_maquinas_lineaspresu' into 'main'
arreglado el alto de faja para el desplegable de maquinas en presu admin....

See merge request jjimenez/safekat!521
2025-02-05 18:59:26 +00:00
1b4d287892 arreglado el alto de faja para el desplegable de maquinas en presu admin. corregido error en manipulados 2025-02-05 19:59:00 +01:00
3c47b7b596 Merge branch 'fix/preview_problem' into 'main'
Fix/preview problem

See merge request jjimenez/safekat!520
2025-02-05 18:45:54 +00:00
ad83489840 solucionados fallos en el calculo del ancho y alto maximo en faja 2025-02-05 19:45:36 +01:00
c596b9ea3a asegurando que los datos sean float 2025-02-05 18:30:30 +01:00
2855e2a985 Merge branch 'fix/validation_faja' into 'main'
corregido error en validador faja. tambien errores al cargar

See merge request jjimenez/safekat!519
2025-02-05 17:15:14 +00:00
b21edbe915 corregido error en validador faja. tambien errores al cargar 2025-02-05 18:14:38 +01:00
186adbee00 Merge branch 'fix/visibility-accordion' into 'main'
Fix/visibility accordion

See merge request jjimenez/safekat!518
2025-02-05 10:13:21 +00:00
319a7e0992 fix view tarifa-maquinas edit 2025-02-05 11:12:36 +01:00
8a965c9d8e fix:edge visibility css accordion 2025-02-05 10:02:02 +01:00
3b61f0a8c6 Merge branch 'fix/datatable-editor-btn-new' into 'main'
fix btn-new datatable editor

See merge request jjimenez/safekat!517
2025-02-05 07:55:55 +00:00
5ea0b6a467 fix btn-new datatable editor 2025-02-05 08:54:31 +01:00
23a6e4e8e5 autonumeric 2025-02-05 04:17:52 +01:00
f4ccc283cc Merge branch 'fix/use_tiradas_alternativas' into 'main'
corregidas direfencias en totales presupuestos. tiradas alternativas ok....

See merge request jjimenez/safekat!516
2025-02-04 19:31:36 +00:00
2149796cbb corregidas direfencias en totales presupuestos. tiradas alternativas ok. corregido calculo envio base 2025-02-04 20:31:04 +01:00
430cf0fd6c trabajando en resumen 2025-02-04 09:26:32 +01:00
61c2e885eb Merge branch 'fix/cargar_presu_admin_servicios_solapas' into 'main'
añadido flag cargando para evitar eventos

See merge request jjimenez/safekat!515
2025-02-03 18:45:42 +00:00
09f44ca3aa añadido flag cargando para evitar eventos 2025-02-03 19:42:35 +01:00
bea385378d Merge branch 'fix/faja_comparador' into 'main'
presu cliente save faja comp

See merge request jjimenez/safekat!514
2025-02-03 09:13:40 +00:00
0264fdc5b9 presu cliente save faja comp 2025-02-03 10:13:13 +01:00
db2aee6342 Merge branch 'fix/presu_cliente_faja_comp' into 'main'
guarda faja en el comparador en cliente. Se fuerza una forma horizontal para faja

See merge request jjimenez/safekat!513
2025-02-03 08:59:42 +00:00
a7b9feba5d guarda faja en el comparador en cliente. Se fuerza una forma horizontal para faja 2025-02-03 09:59:16 +01:00
db0a537bd8 Merge branch 'fix/presu_cliente_sin_faja' into 'main'
Fix/presu cliente sin faja

See merge request jjimenez/safekat!512
2025-02-03 07:47:05 +00:00
b97f7fda24 el plastificado por defecto en faja a ninguno 2025-02-03 08:44:12 +01:00
f5e6828212 arreglado el problema de la faja 2025-02-03 08:41:29 +01:00
cab416ce7e Merge branch 'add/faja_cliente' into 'main'
Add/faja cliente

See merge request jjimenez/safekat!511
2025-02-02 20:11:05 +00:00
b4fa79cc5c terminada faja 2025-02-02 21:10:29 +01:00
27c1e511b3 Merge branch 'main' into 'add/faja_cliente'
Main

See merge request jjimenez/safekat!510
2025-02-02 11:21:19 +00:00
264838e62a corregidos algunos fallos en admin y añadido selector papel y gramaje faja cliente 2025-02-02 12:20:35 +01:00
b67b41148b Merge branch 'dev/api_work' into 'main'
Dev/api work

See merge request jjimenez/safekat!509
2025-02-02 10:01:54 +00:00
430e20201e Añadidas rutas 2025-02-02 11:00:07 +01:00
963b46c48d HEad fixed 2025-02-02 10:55:03 +01:00
d61ea0d380 Arreglo para merge 2025-02-02 10:04:42 +01:00
9ed6e7b230 Arreglo para merge 2025-02-02 10:02:34 +01:00
af3eea3e12 Merge branch 'add/fajas_admin' into 'main'
Add/fajas admin

See merge request jjimenez/safekat!506
2025-02-01 18:11:45 +00:00
5984f53bad terminada faja en admin 2025-02-01 19:11:05 +01:00
2a1bcbd53d guardado de linea faja 2025-02-01 18:31:31 +01:00
3bfaa65d19 Merge branch 'add/fajas_admin' of https://git.imnavajas.es/jjimenez/safekat into add/fajas_admin 2025-02-01 13:28:45 +01:00
e17e72f46d terminada faja en presu admin a falta de preview 2025-02-01 13:28:38 +01:00
a05398e0aa Merge branch 'main' into 'add/fajas_admin'
Main

See merge request jjimenez/safekat!505
2025-02-01 09:56:37 +00:00
28d8434b05 Merge branch 'fix/ancho_alto_per_en_admin' into 'main'
error cambiado ancho por alto personalizado al cargar

See merge request jjimenez/safekat!504
2025-02-01 09:56:12 +00:00
c7491db102 error cambiado ancho por alto personalizado al cargar 2025-02-01 10:55:52 +01:00
432a41b879 Merge branch 'main' into 'add/fajas_admin'
Main

See merge request jjimenez/safekat!503
2025-02-01 09:52:29 +00:00
e413f5b26e Merge branch 'fix/sangre_alto_exteriores' into 'main'
fix problem

See merge request jjimenez/safekat!502
2025-02-01 09:45:53 +00:00
b29b061f74 fix problem 2025-02-01 10:45:28 +01:00
a75ef4eae6 guardado faja datos libro 2025-02-01 10:43:49 +01:00
31f7f92448 trabajando en eventos de lineas 2025-01-31 10:14:47 +01:00
5ca35554e5 Merge branch 'add/solapas_maximas_admin' into 'main'
Add/solapas maximas admin

See merge request jjimenez/safekat!501
2025-01-30 16:50:17 +00:00
b87a75d1fa pruebas solapas max 2025-01-29 21:16:40 +01:00
2871326989 arreglados multiples fallos de presupuesto admin y problema en los forms de las tarifas 2025-01-29 20:42:19 +01:00
7e3d1d5df4 Merge branch 'fix/papeles_especiales_interior' into 'main'
arreglado el problema de coger el tipo de impresion y tirada

See merge request jjimenez/safekat!500
2025-01-29 09:19:53 +00:00
1ef49490bd arreglado el problema de coger el tipo de impresion y tirada 2025-01-29 10:19:25 +01:00
2e1e6d4408 Merge branch 'fix/papeles_genericos_presupuesto_rot' into 'main'
añadido que solo compruebe el ancho en vertical si es rotativa

See merge request jjimenez/safekat!499
2025-01-29 08:50:20 +00:00
5b89cc0c1d añadido que solo compruebe el ancho en vertical si es rotativa 2025-01-29 09:49:52 +01:00
20442bb784 Merge branch 'fix/papeles_especiales_cliente' into 'main'
corregido error en papeles especiales

See merge request jjimenez/safekat!498
2025-01-29 08:44:15 +00:00
2af5a0155c corregido error en papeles especiales 2025-01-29 09:43:34 +01:00
961ea42ac4 Merge branch 'feat/sk-20' into 'main'
Feat/sk 20

See merge request jjimenez/safekat!497
2025-01-28 19:27:48 +00:00
bf49d601cf fix dropzone when presupuesto is borrador 2025-01-28 20:27:15 +01:00
22f78363cb Merge branch 'main' into feat/sk-20 2025-01-28 19:04:21 +01:00
6f016dda6d Merge branch 'fix/presu_admin_errors' into 'main'
arreglado el preview de rotativa a color del admin y restaurado el...

See merge request jjimenez/safekat!496
2025-01-28 17:48:01 +00:00
e87e278dd0 modificados todos los buscadores de papeles y gramajes para ver el alto y el ancho (admin y cliente) 2025-01-28 18:47:20 +01:00
2df3f5914e resueltos errores con la rotativa. Quitado retractilado de cubierta cliente y Ninguno por defecto en acabados 2025-01-27 18:45:38 +01:00
8417c2401f quitado el 2 que usaba el muiltiplicador 2025-01-24 09:56:07 +01:00
2e1a6222ef arreglado el preview de rotativa a color del admin y restaurado el multiplicador en getcosteslineasrotativa 2025-01-24 09:05:11 +01:00
d219237440 Merge branch 'fix/preview_isCosido' into 'main'
arreglado el error en la vista

See merge request jjimenez/safekat!495
2025-01-23 22:38:33 +00:00
900400f494 arreglado el error en la vista 2025-01-23 23:38:11 +01:00
19220ab985 sk-20 : add form files to presupuesto admin 2025-01-23 20:25:28 +01:00
910df7b822 Merge branch 'mod/exceso_solapas_cubierta_sobrecubierta' into 'main'
Mod/exceso solapas cubierta sobrecubierta

See merge request jjimenez/safekat!494
2025-01-23 13:30:32 +00:00
9619dfbfb5 Merge branch 'main' into 'mod/exceso_solapas_cubierta_sobrecubierta'
Main

See merge request jjimenez/safekat!493
2025-01-23 13:30:04 +00:00
0d3ea391d7 falta calcular maximo solapas 2025-01-23 14:26:51 +01:00
25040ad6b5 Merge branch 'fix/sk-19' into 'main'
refactor upload files from stp side

See merge request jjimenez/safekat!492
2025-01-23 10:48:30 +00:00
98d8d45899 Merge branch 'main' into 'mod/exceso_solapas_cubierta_sobrecubierta'
Main

See merge request jjimenez/safekat!491
2025-01-23 09:54:38 +00:00
a32b8befcb cambiados servicios de solapas en el presupuesto cliente 2025-01-23 10:49:08 +01:00
330d1c7a4f refactor upload files from stp side 2025-01-23 10:36:15 +01:00
1c3f045488 Merge branch 'fix/tarifa-maquina-form' into 'main'
hide in tarifa-maquinas form when form is add

See merge request jjimenez/safekat!490
2025-01-23 00:09:36 +00:00
cb661b55ac hide in tarifa-maquinas form when form is add 2025-01-23 01:08:40 +01:00
36107bd825 Merge branch 'fix/tarifa-maquina-form' into 'main'
fix js in tarifa new form

See merge request jjimenez/safekat!489
2025-01-22 23:51:58 +00:00
66d90ac15b fix js in tarifa new form 2025-01-23 00:51:01 +01:00
c6b7505f1b corregido error get lineas (no incluia el nombre del papel generico 3 2025-01-23 00:13:34 +01:00
b315a44c9a corregido error get lineas (no incluia el nombre del papel generico 2 2025-01-23 00:03:02 +01:00
e05e807b65 corregido error get lineas (no incluia el nombre del papel generico 2025-01-23 00:02:24 +01:00
dd2f19b86c corregido error getlineaspresupuesto 2025-01-22 23:49:31 +01:00
0f9395115f modificando presupuestos. falta preguntar si añadir solapas (cubierta) y solapas (sobrecubierta) 2025-01-22 23:43:19 +01:00
f9b84fa443 Merge branch 'main' into 'mod/exceso_solapas_cubierta_sobrecubierta'
quitada la condicion que comprobaba que los papeles tenian el mismo gramaje...

See merge request jjimenez/safekat!488
2025-01-22 17:48:43 +00:00
4d343ec59c Merge branch 'fix/add_papel_maquina_error_mismo_gramaje' into 'main'
quitada la condicion que comprobaba que los papeles tenian el mismo gramaje...

See merge request jjimenez/safekat!487
2025-01-22 17:48:04 +00:00
bd9764ffab quitada la condicion que comprobaba que los papeles tenian el mismo gramaje para seleccionarlos dentro de una máquina 2025-01-22 18:47:35 +01:00
c40945f91a Merge branch 'feat/sk-18' into 'main'
Feat/sk 18

See merge request jjimenez/safekat!486
2025-01-22 16:45:33 +00:00
ecd280928e add js duplicate functionality 2025-01-22 17:44:46 +01:00
e37dbe85a2 add duplicate button and modal form 2025-01-22 17:44:16 +01:00
bc02e3f2bb add MaquinaService class 2025-01-22 17:44:05 +01:00
1a05fe762a add new translations 2025-01-22 17:43:42 +01:00
3bcd9466c6 add method to get relations 2025-01-22 17:43:28 +01:00
eb692a121e add duplicate method 2025-01-22 17:43:16 +01:00
92298cf5f1 add maquina_duplicate rule 2025-01-22 17:43:07 +01:00
36a0f018ae add maquina service 2025-01-22 17:42:59 +01:00
93c350ed5c add duplicate route for maquinas 2025-01-22 17:42:51 +01:00
18c267ce04 int is not a valid validation rule, changed to integer 2025-01-22 17:39:39 +01:00
d427ed308d maquina duplicate 2025-01-22 16:54:49 +01:00
fe289bc3ce Merge branch 'feat/sk-17' into 'main'
fix duplicate

See merge request jjimenez/safekat!485
2025-01-21 08:58:02 +00:00
01498361e3 fix duplicate 2025-01-21 09:56:59 +01:00
bb6e5fb5ca Merge branch 'add/presu_admin_add_services' into 'main'
Add/presu admin add services

See merge request jjimenez/safekat!484
2025-01-21 07:33:13 +00:00
62d1ca88c1 Merge branch 'main' into 'add/presu_admin_add_services'
Main

See merge request jjimenez/safekat!483
2025-01-21 07:32:52 +00:00
d7011acba4 Merge branch 'feat/sk-17' into 'main'
feat : duplicar papel impresion con relaciones

See merge request jjimenez/safekat!482
2025-01-20 21:19:22 +00:00
aa5dea2cfb feat : duplicar papel impresion con relaciones 2025-01-20 22:18:10 +01:00
036998e71a añadidos todos los servicios a falta del solapas grandes (incluido plegado de guardas) 2025-01-20 20:15:27 +01:00
5ffb52d6e8 Cambios en la API con imprimelibros 2025-01-20 14:58:59 +01:00
e7163efc5e Merge branch 'fix/maquinas_papeles_seleccionados' into 'main'
corregido el problema que no cogia la rotativa al mostrar los papeles

See merge request jjimenez/safekat!481
2025-01-20 11:59:04 +00:00
398cb23f11 corregido el problema que no cogia la rotativa al mostrar los papeles 2025-01-20 12:58:42 +01:00
f4ef65ab78 Merge branch 'fix/margenes_papel_pedido' into 'main'
corregido error al calcular el precio de pliego. Se usaban paginas libro en lugar paginas pedido

See merge request jjimenez/safekat!480
2025-01-20 11:46:50 +00:00
591a872234 corregido error al calcular el precio de pliego. Se usaban paginas libro en lugar paginas pedido 2025-01-20 12:46:10 +01:00
e5b5e86dc8 Merge branch 'mod/presupuesto_admin' into 'main'
Mod/presupuesto admin

See merge request jjimenez/safekat!479
2025-01-19 18:47:22 +00:00
fee6e3b674 fastforward problem
Merge branch 'mod/presupuesto_admin' of https://git.imnavajas.es/jjimenez/safekat into mod/presupuesto_admin
2025-01-19 19:46:09 +01:00
d458498fad terminado guardar en el add 2025-01-19 19:45:42 +01:00
9b0604bed6 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!478
2025-01-18 11:02:48 +00:00
acab62674e Merge branch 'feat/maquina-tarea-form' into 'main'
change servicio cliente to maquina tareas

See merge request jjimenez/safekat!477
2025-01-18 08:50:57 +00:00
84accc8e03 change servicio cliente to maquina tareas 2025-01-18 09:49:00 +01:00
c478659124 modificacion de la api y de la funcion calcular en el presupuesto cliente 2025-01-17 15:01:41 +01:00
88e503067a pruebas presupuestocliente 2025-01-17 14:53:14 +01:00
ceaaf7b2dc Iniciada 2025-01-17 14:23:00 +01:00
ad62c7bdc4 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!476
2025-01-17 12:30:11 +00:00
c5440ad76e Merge branch 'mod/open_maquinas_innewtab' into 'main'
ahora se pueden abrir maquinas en pestañas

See merge request jjimenez/safekat!475
2025-01-17 12:29:38 +00:00
2284d5fbd8 ahora se pueden abrir maquinas en pestañas 2025-01-17 13:29:10 +01:00
8bea6264c5 trabajadno en guardar 2025-01-17 13:18:08 +01:00
306addd9ad Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!474
2025-01-16 18:31:08 +00:00
6bea1c8b13 Merge branch 'dev/api_il' into 'main'
Implementado filtro CORS y ejemplo de resources para la API

See merge request jjimenez/safekat!473
2025-01-15 20:05:43 +00:00
e1a163ef8c Implementado filtro CORS y ejemplo de resources para la API 2025-01-15 21:05:12 +01:00
874200fe67 getobjetolp cogia el cosido como null 2025-01-15 14:21:27 +01:00
ed5635e783 comprobado que hay datos al cargar las tiradas alternativas 2025-01-15 11:08:14 +01:00
8df52ea657 quitado el evento de las fajas a color 2025-01-15 11:05:24 +01:00
74baeb5cfa corregido error al mostrar en resumen con el iva 2025-01-15 09:59:27 +01:00
15d9a42740 seleccionar la tirada seleccionada en direcciones en presu cliente 2025-01-15 09:45:14 +01:00
9063588bcd ahora si 2025-01-15 09:37:11 +01:00
586d76896f corregido error en preview 2025-01-15 09:35:53 +01:00
f6684563cf quitada faja color de la lista de items 2025-01-15 09:33:02 +01:00
2fc1c637ed añadidos los get para las lineas de presupuesto borrados por error 2025-01-15 09:16:44 +01:00
1722dbecdb empezado el add 2025-01-15 02:30:03 +01:00
0336b2eb60 hecho el guardar de los envios, lineas y servicios 2025-01-15 02:13:36 +01:00
a9eece668c trabajando en guardar 2025-01-15 01:50:15 +01:00
a4394ed470 trabajando en añadir tiradas alternativas 2025-01-14 20:33:55 +01:00
28a133f687 terminados envios 2025-01-13 21:34:18 +01:00
522e026ded trabajando en direcciones! 2025-01-13 01:51:36 +01:00
c6d1d06d8a falta update servicios 2025-01-12 21:47:39 +01:00
f93251b7bf Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!471
2025-01-11 17:18:34 +00:00
0b2f2a446e añadido fichero servicios.js 2025-01-11 18:17:41 +01:00
2aae650196 servicios acabado finalizados 2025-01-11 18:17:03 +01:00
8d5649a51d Merge branch 'fix/bug-chat-notification-login-logout' into 'main'
Fix/bug chat notification login logout

See merge request jjimenez/safekat!470
2025-01-11 10:48:48 +00:00
c7a24c77b4 Merge branch 'main' of https://git.imnavajas.es/jjimenez/safekat 2025-01-11 11:47:39 +01:00
4842356f8d bug chat notification when logout 2025-01-11 11:46:34 +01:00
7bb7b807a5 trabajando en servicios acabado 2025-01-10 00:05:35 +01:00
7e7c686f79 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!469
2025-01-09 17:50:48 +00:00
1dd02a9b66 modificaciones 2025-01-09 18:50:37 +01:00
5d4e59acd5 Merge branch 'feat/screenshot-forma' into 'mod/presupuesto_admin'
add downloadPreviewImage function to download image as png from the current shape selected

See merge request jjimenez/safekat!468
2025-01-09 17:47:58 +00:00
130457f0ef modificaciones 2025-01-09 18:35:24 +01:00
571d4df828 Merge branch 'clean/project' into 'main'
Clean/project

See merge request jjimenez/safekat!467
2025-01-08 20:50:25 +00:00
795cda0fd1 Añadido archivo editorconfig con reglas 2025-01-08 21:48:25 +01:00
a565bb8fe5 Eliminados archivos que no se usan 2025-01-08 21:47:20 +01:00
72ca022e16 Merge branch 'fix/menus' into 'main'
Actalizado label Presupuesto clientes en seccion de roles

See merge request jjimenez/safekat!466
2025-01-08 20:12:38 +00:00
b0cb2bffca Actalizado label Presupuesto clientes en seccion de roles 2025-01-08 21:12:03 +01:00
5edc85c9f7 add downloadPreviewImage function to download image as png from the current shape selected 2025-01-08 20:56:27 +01:00
642b445cd2 lineas presupuesto actualizadas con tirada 2025-01-08 17:34:29 +01:00
a88f3fb009 trabajando en previews. falta probar rotativa, y terminar cubierta 2025-01-06 19:57:49 +01:00
73afe4e4c1 trabajando en previews. falta probar rotativa, y terminar cubierta 2025-01-06 19:56:03 +01:00
212b1f4d08 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!465
2025-01-06 11:48:28 +00:00
5a6174a597 Merge branch 'fix/nav-link-message-accordion' into 'main'
Fix/nav link message accordion

See merge request jjimenez/safekat!464
2025-01-05 09:40:15 +00:00
f0757a4be6 fix navlink 2025-01-05 10:39:42 +01:00
50b057d4e5 fix/nav-link-message-accordion 2025-01-05 10:37:37 +01:00
05de0091bd Merge branch 'fix/uri-message-notification' into 'main'
Fix/uri message notification

See merge request jjimenez/safekat!463
2025-01-05 09:30:51 +00:00
b076db3a7c fix uri chat notifications 2025-01-05 10:29:07 +01:00
dac82253a2 fix uri messages 2025-01-04 17:36:58 +01:00
ee22aaab16 Merge branch 'fix/maquinas_encuadernacion' into 'main'
fix select tarifa maquina encuadernado

See merge request jjimenez/safekat!462
2025-01-04 11:53:28 +00:00
6433faec02 fix select tarifa maquina encuadernado 2025-01-04 12:52:26 +01:00
4777e22952 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!461
2025-01-03 15:47:04 +00:00
3c3bea27c9 Merge branch 'fix/plantillas_clientes_error_add' into 'main'
Fix/plantillas clientes error add

See merge request jjimenez/safekat!460
2025-01-03 15:46:20 +00:00
9b6cc84d4f funcionando crear editar y todo lo demas 2025-01-03 16:45:56 +01:00
012723d955 no se ve el loader 2025-01-03 16:06:14 +01:00
adacb6ddc8 falta editar 2025-01-03 16:03:54 +01:00
49cb2d1a38 Merge branch 'mod/presupuesto_admin' of https://git.imnavajas.es/jjimenez/safekat into mod/presupuesto_admin 2025-01-03 10:59:16 +01:00
163d8421a5 trabajando en la preview 2025-01-03 10:59:03 +01:00
82414d8393 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!459
2025-01-02 16:55:50 +00:00
879d34306b resolviendo problemas merge 2025-01-02 17:55:34 +01:00
ff082dac7f cargar lineas problema lomo 2025-01-02 17:49:59 +01:00
883308d052 Merge branch 'feat/ordenes-trabajo' into 'main'
feat confirm alert pedido to produccion

See merge request jjimenez/safekat!458
2025-01-02 16:49:02 +00:00
4f7cbb99fd feat confirm alert pedido to produccion 2025-01-02 17:47:57 +01:00
e9d4b0971b trabajando en guardar presupuesto hasta las lineas de presupuesto 2025-01-02 17:33:23 +01:00
0a45a7b01e Merge branch 'feat/ordenes-trabajo' into 'main'
Feat/ordenes trabajo

See merge request jjimenez/safekat!457
2025-01-02 16:22:05 +00:00
dc599e009a Merge branch 'main' into feat/ordenes-trabajo 2025-01-02 17:19:52 +01:00
b50ba4f2a3 ordenes trabajo 2025-01-02 10:50:56 +01:00
2231e943c7 trabajando en lineas presupuesto eventos 2024-12-31 12:37:16 +01:00
1ccade47a3 trabajando en lineas presupuesto 2024-12-27 18:10:35 +01:00
ef58fe7209 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!456
2024-12-27 09:49:48 +00:00
09a7ab5e50 Merge branch 'mod/lomo_min_max_cliente' into 'main'
Mod/lomo min max cliente

See merge request jjimenez/safekat!455
2024-12-26 19:44:56 +00:00
8ad09ed495 no borrar papeles cuando se cambia tipo libro 2024-12-26 20:44:30 +01:00
0781a283eb borrado del error 2024-12-26 19:24:25 +01:00
a29df443bd primera version del calculo del lomo 2024-12-26 18:29:32 +01:00
93d3793ef9 cambiado POD para cogerlo de la nueva tabla de variables 2024-12-26 16:28:26 +01:00
d53b63d032 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!453
2024-12-26 13:18:04 +00:00
afb7ca0812 Merge branch 'fix/update_dir_tiradas_selected' into 'main'
Fix/update dir tiradas selected

See merge request jjimenez/safekat!454
2024-12-26 13:17:37 +00:00
d0bdef58c2 solucionado el error que cambiaba la tirada de envio al actualizar presupuesto 2024-12-26 14:17:11 +01:00
f61c9928dc error en la validacion al guardar 2024-12-26 13:46:43 +01:00
616e662896 no se podia pasar de pagina en cosido. error en la validacion 2024-12-26 13:38:32 +01:00
340ab4ec5f Merge branch 'main' into feat/ordenes-trabajo 2024-12-26 13:38:29 +01:00
2d9b1603a3 tareas 2024-12-26 13:37:18 +01:00
33a20b9b25 Merge branch 'fix/cosido_fresado_check_paginas' into 'main'
Fix/cosido fresado check paginas

See merge request jjimenez/safekat!452
2024-12-26 10:31:15 +00:00
6308b4d883 solucionado el problema al seleccionar cosido o grapado para paginas no multiplo de 4 2024-12-26 11:30:55 +01:00
b80480a101 bug en errores servicio defecto (nombre variable antigua) 2024-12-26 10:49:38 +01:00
a3ac7150e5 Merge branch 'fix/presu_cliente_precio_u_resumen' into 'main'
arreglado precio unidad en resumen

See merge request jjimenez/safekat!451
2024-12-26 09:39:56 +00:00
9e1983ee66 arreglado precio unidad en resumen 2024-12-26 10:39:37 +01:00
b3fcdba990 Merge branch 'fix/orden_lista_maquinas' into 'main'
arraglado bug al ordenar maquinas por nombre

See merge request jjimenez/safekat!450
2024-12-26 09:27:45 +00:00
157e212065 arraglado bug al ordenar maquinas por nombre 2024-12-26 10:27:25 +01:00
b1fe5f2b56 Merge branch 'fix/lista_papel_generico' into 'main'
arreglado que no busque los papeles borrados

See merge request jjimenez/safekat!449
2024-12-26 09:22:16 +00:00
3212d00cfe arreglado que no busque los papeles borrados 2024-12-26 10:21:39 +01:00
9dd3f8598e Merge branch 'fix/recoger_taller_cargar' into 'main'
cargar recoger en taller arreglado

See merge request jjimenez/safekat!448
2024-12-26 09:09:57 +00:00
54579b36bf cargar recoger en taller arreglado 2024-12-26 10:09:39 +01:00
2890eacb74 Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!447
2024-12-26 08:55:44 +00:00
f0dcdc55d9 Merge branch 'fix/presupuesto_manipulados_default' into 'main'
arreglado incluir servicios manipulado defecto

See merge request jjimenez/safekat!446
2024-12-26 08:55:07 +00:00
fc94fcc55e arreglado incluir servicios manipulado defecto 2024-12-26 09:54:42 +01:00
c05b117c77 Merge branch 'main' into feat/ordenes-trabajo 2024-12-26 08:44:19 +01:00
66a36bcf3b add tareas orden de trabajo 2024-12-24 18:55:07 +01:00
7608793c8a Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!445
2024-12-24 16:45:50 +00:00
495fc6e73f Merge branch 'fix/guardar_solapas_pre_cliente' into 'main'
algunas mejoras para cuando no hay servicios defecto

See merge request jjimenez/safekat!444
2024-12-24 16:45:03 +00:00
bd92842877 algunas mejoras para cuando no hay servicios defecto 2024-12-24 17:43:44 +01:00
60706ecfc2 add maquinas tareas 2024-12-24 12:51:44 +01:00
6790c21675 feat tarifa maquinas 2024-12-24 09:00:56 +01:00
c3098b054e trabajando en lomo redondo 2024-12-19 12:54:16 +01:00
77db3104d3 comparador cubierta y sobrecubierta terminado 2024-12-19 11:12:40 +01:00
57c34b768d Merge branch 'main' into 'mod/presupuesto_admin'
Main

See merge request jjimenez/safekat!443
2024-12-19 08:02:26 +00:00
446f071dd2 Merge branch 'fix/consumo_tintas_papel' into 'main'
arreglado valor por defecto en consumo tintas papeles impresion

See merge request jjimenez/safekat!442
2024-12-19 08:01:49 +00:00
1f74b38b8d arreglado valor por defecto en consumo tintas papeles impresion 2024-12-19 09:01:04 +01:00
8dca0936c5 trabajando en cubierta 2024-12-18 22:32:23 +01:00
41b4ec5cd3 tarifa maquinas 2024-12-18 09:30:21 +01:00
bb138019d5 terminado comparador plana 2024-12-17 23:35:44 +01:00
2df473edb6 trabajando en el comparador 2024-12-17 21:47:08 +01:00
643f84684a trabajando en comparador 2024-12-17 14:38:02 +01:00
4e7f53ba6c trabajando en el comparador 2024-12-17 12:55:44 +01:00
43f2daea59 ot 2024-12-16 09:19:08 +01:00
7aa75cdd59 trabajando en eventos datosLibro 2024-12-16 00:14:56 +01:00
586dfa7343 trabajando en datoslibro 2024-12-15 21:13:25 +01:00
422ade0030 merge from main 2024-12-15 19:49:33 +01:00
d7d1791d64 Merge branch 'feat/message-direct-cliente' into 'main'
send direct message to client users from presupuesto,facturas or pedido forms

See merge request jjimenez/safekat!441
2024-12-15 16:58:19 +00:00
4cacf28d49 send direct message to client users from presupuesto,facturas or pedido forms 2024-12-15 17:57:22 +01:00
d5719b70a1 ots 2024-12-15 16:07:54 +01:00
7998e2424e Merge branch 'mod/maquinas_list' into 'main'
modificado el listado de maquinas

See merge request jjimenez/safekat!440
2024-12-15 12:14:59 +00:00
fce30342a7 modificado el listado de maquinas 2024-12-15 13:14:30 +01:00
8d25991ddc Merge branch 'fix/usuarios_clientes' into 'main'
implementado pestaña clientes en usuarios

See merge request jjimenez/safekat!439
2024-12-15 11:25:17 +00:00
9a0581319c implementado pestaña clientes en usuarios 2024-12-15 12:24:49 +01:00
7c5fdc0c88 Merge branch 'mod/userList' into 'main'
añadida columna cliente a la lista de usuarios

See merge request jjimenez/safekat!438
2024-12-15 10:00:54 +00:00
721eb445dc añadida columna cliente a la lista de usuarios 2024-12-15 11:00:28 +01:00
45f31049ab Merge branch 'mod/client_list' into 'main'
cambiada lista de clientes a nuevo formato

See merge request jjimenez/safekat!437
2024-12-15 09:50:26 +00:00
ba793730f3 cambiada lista de clientes a nuevo formato 2024-12-15 10:49:49 +01:00
c0297b6cba Merge branch 'fix/confirmar_presupuesto' into 'main'
arreglados problemas al confirmar con direcciones. También se ha arreglado un...

See merge request jjimenez/safekat!436
2024-12-14 18:30:40 +00:00
afd0b038c9 corregido get papel de guardas 2024-12-14 19:30:22 +01:00
e92179697b arreglados problemas al confirmar con direcciones. También se ha arreglado un problema al generar el resumen 2024-12-14 19:29:13 +01:00
2b9de61864 Merge branch 'mod/recoger_taller_presucliente' into 'main'
añadiro recoger en taller en direcciones presupuesto cliente

See merge request jjimenez/safekat!435
2024-12-14 12:53:47 +00:00
6cb70f1a79 añadiro recoger en taller en direcciones presupuesto cliente 2024-12-14 13:53:24 +01:00
bef0c95a4f Merge branch 'mod/acabados_cubierta_sobre_presucliente' into 'main'
Mod/acabados cubierta sobre presucliente

See merge request jjimenez/safekat!434
2024-12-14 12:23:39 +00:00
271ec8c807 calcular y guardar presupuestos adaptados a los nuevos acabados. Migracion en la bbdd 2024-12-14 13:23:16 +01:00
b4de7978cc realizado los cambios en los selects 2024-12-14 10:36:51 +01:00
4b4c320e04 Merge branch 'mod/tarjeta_tiradas_precio_decimales' into 'main'
sustituido . por ,

See merge request jjimenez/safekat!433
2024-12-14 08:42:47 +00:00
9ae9b4e7a7 sustituido . por , 2024-12-14 09:42:29 +01:00
5a1fcb4eaa Merge branch 'mod/busqueda_user_sin_tildes' into 'main'
cambiada el buscador en usuarios para que sea tilde insensitive

See merge request jjimenez/safekat!432
2024-12-14 08:30:30 +00:00
1dd442d25a cambiada el buscador en usuarios para que sea tilde insensitive 2024-12-14 09:29:55 +01:00
c175cc392c Merge branch 'fix/servicios_acabado_presupuestos' into 'main'
solucionado guardado de servicios acabado cubierta y sobrecubierta

See merge request jjimenez/safekat!431
2024-12-12 19:39:01 +00:00
aebfeb77d9 solucionado guardado de servicios acabado cubierta y sobrecubierta 2024-12-12 20:38:36 +01:00
74de9330cc Merge branch 'fix/select_comercial_soporte_clientes' into 'main'
arreglado en buscador que salia el usuario updated en lugar del comercial

See merge request jjimenez/safekat!430
2024-12-12 17:36:06 +00:00
b333ad736c arreglado en buscador que salia el usuario updated en lugar del comercial 2024-12-12 18:35:19 +01:00
71157bfda5 ot relations 2024-12-11 10:19:55 +01:00
f70f6a0929 servicio cliente tareas 2024-12-10 07:35:38 +01:00
9a57312601 servicio cliente tareas 2024-12-10 07:35:25 +01:00
ad11dc2443 Merge branch 'mod/user_list' into 'main'
corregida busqueda de usuarios. también el mail obligatorio y borrar los chat...

See merge request jjimenez/safekat!429
2024-12-09 18:45:24 +00:00
719455567e corregida busqueda de usuarios. también el mail obligatorio y borrar los chat departaments con soft delete 2024-12-09 19:44:44 +01:00
0b4105f5bd change migration 2024-12-08 19:01:43 +01:00
5ce47dc6ce ot dev 2024-12-08 18:50:18 +01:00
d9d3bd69c0 Merge branch 'fix/cliente_aplicar_plantillas' into 'main'
solucionados problemas en tarifas cliente

See merge request jjimenez/safekat!428
2024-12-07 11:35:32 +00:00
ece908c954 solucionados problemas en tarifas cliente 2024-12-07 12:35:08 +01:00
94ca8a5a7a Merge branch 'fix/plantillas_clientes' into 'main'
arreglados bugs en plantillas cliente

See merge request jjimenez/safekat!427
2024-12-07 11:01:18 +00:00
39ca7e83eb arreglados bugs en plantillas cliente 2024-12-07 12:00:47 +01:00
ed67af00b4 Merge branch 'main' into feat/ordenes-trabajo 2024-12-05 20:32:32 +01:00
1b09d6c7a9 Merge branch 'mod/plantillas_cliente' into 'main'
Mod/plantillas cliente

See merge request jjimenez/safekat!426
2024-12-04 23:15:25 +00:00
9fa31c5d8e terminado 2024-12-05 00:15:08 +01:00
73821603b4 Merge branch 'main' into 'mod/plantillas_cliente'
Main

See merge request jjimenez/safekat!425
2024-12-04 23:13:41 +00:00
3aaee893eb Merge branch 'fix/message-issue' into 'main'
Fix/message issue

See merge request jjimenez/safekat!424
2024-12-04 17:35:30 +00:00
ea4d4327b7 fix chat_department as object 2024-12-04 18:31:18 +01:00
16cec58431 default message when no notifications 2024-12-04 18:26:37 +01:00
8f907b2762 remove this.selectUsers repeated 2024-12-04 18:19:29 +01:00
e24839019a ots 2024-12-04 18:15:59 +01:00
d02e7e03f4 arraglado bug tarifas cliente 2024-12-04 14:08:37 +01:00
a7cda851f0 trabajando en editar plantillas 2024-12-04 12:34:10 +01:00
3fb37af0f8 terminadas tarifas cliente 2024-12-03 22:59:57 +01:00
65f179bdd8 Merge branch 'mod/tarifas_clientes' into 'main'
Mod/tarifas clientes

See merge request jjimenez/safekat!423
2024-12-03 16:51:30 +00:00
aa22b81c96 terminada pestaña cliente tarifas 2024-12-03 17:51:03 +01:00
abf60e62c4 Merge branch 'main' into 'mod/tarifas_clientes'
Main

See merge request jjimenez/safekat!422
2024-12-03 07:42:33 +00:00
0f305c16b3 Merge branch 'fix/presupuesto_cliente_20241202' into 'main'
resuelto direcciones en nuevo presupuesto cliente y quitar check papeles distintos

See merge request jjimenez/safekat!421
2024-12-02 19:50:55 +00:00
2c3b8cb581 resuelto direcciones en nuevo presupuesto cliente y quitar check papeles distintos 2024-12-02 20:50:11 +01:00
6bd9580c43 Merge branch 'fix/maquinas_POD_solo_hq2' into 'main'
para POD siempre es HQ

See merge request jjimenez/safekat!420
2024-12-02 18:44:42 +00:00
515d275c7e para POD siempre es HQ 2024-12-02 19:44:23 +01:00
2b876f623e Merge branch 'fix/papeles_estandar_solo_rot_4' into 'main'
POD siempre en hq

See merge request jjimenez/safekat!419
2024-12-02 18:23:36 +00:00
af131b6658 POD siempre en hq 2024-12-02 19:23:13 +01:00
54de854bbc Merge branch 'fix/papeles_estandar_solo_rot_2' into 'main'
corregido para POD

See merge request jjimenez/safekat!418
2024-12-02 18:06:16 +00:00
3c8d99c873 corregido para POD 2024-12-02 19:05:57 +01:00
67734cc427 Merge branch 'fix/papeles_estandar_solo_rot' into 'main'
añadido que si no es pod busca papel rotativa para color y negro

See merge request jjimenez/safekat!417
2024-12-02 18:01:55 +00:00
310b4e7a43 añadido que si no es pod busca papel rotativa para color y negro 2024-12-02 19:01:21 +01:00
53ed8299df Merge branch 'fix/rotativa_cosido_cliente' into 'main'
solucionado problema

See merge request jjimenez/safekat!416
2024-12-02 17:22:53 +00:00
6eb4446aff solucionado problema 2024-12-02 18:22:26 +01:00
9bec8f7adb haciendo el borrar! 2024-12-02 15:10:26 +01:00
510e33b5fa trabajando en el editor 2024-12-01 20:44:15 +01:00
ce050cf07d Merge branch 'refactor/messages-view' into feat/ordenes-trabajo 2024-11-30 17:10:26 +01:00
a1ddc8a520 Merge branch 'main' into 'mod/tarifas_clientes'
Main

See merge request jjimenez/safekat!415
2024-11-30 12:59:44 +00:00
d870fca64d trabajando en el datatable 2024-11-30 13:59:05 +01:00
7550f41e16 Merge branch 'refactor/messages-view' into 'main'
Refactor/messages view

See merge request jjimenez/safekat!414
2024-11-29 21:07:59 +00:00
2bef4e1139 Merge branch 'main' into refactor/messages-view 2024-11-29 22:06:49 +01:00
2e767889ef message chat section 2024-11-29 22:05:50 +01:00
c9c462ab92 Merge branch 'main' into 'mod/tarifas_clientes'
Main

See merge request jjimenez/safekat!413
2024-11-29 17:08:13 +00:00
117c5f2f97 Merge branch 'fix/añadir_manipulado_solapas_grandes2' into 'main'
añadido el guardar para el servicio de manipulado de solapas grandes

See merge request jjimenez/safekat!412
2024-11-29 16:56:23 +00:00
5c705ebf64 añadido el guardar para el servicio de manipulado de solapas grandes 2024-11-29 17:56:02 +01:00
ce33239835 Merge branch 'fix/añadir_manipulado_solapas_grandes' into 'main'
cambiado el servicio de solapas grandes del 79 al 73

See merge request jjimenez/safekat!411
2024-11-29 16:37:56 +00:00
5169a86cf4 cambiado el servicio de solapas grandes del 79 al 73 2024-11-29 17:37:32 +01:00
e1f02d4506 Merge branch 'main' into 'mod/tarifas_clientes'
Main

See merge request jjimenez/safekat!410
2024-11-29 16:09:47 +00:00
5e60351755 Merge branch 'mod/quitar_max_solapas_presu_admin' into 'main'
eliminada la funcion de comprobar tamaño maximo en el presupuesto administrador

See merge request jjimenez/safekat!409
2024-11-29 16:09:16 +00:00
81d52f0064 eliminada la funcion de comprobar tamaño maximo en el presupuesto administrador 2024-11-29 17:08:50 +01:00
4cf4e3fcfd trabajando 2024-11-29 17:06:23 +01:00
fe4c7c1218 Merge branch 'dev/calculo_solapas_automatico_cliente' into 'main'
añadido calculo dinamico de ancho maximo de solapas. Añadido servicio especial...

See merge request jjimenez/safekat!408
2024-11-29 10:26:16 +00:00
b314e4a1de añadido calculo dinamico de ancho maximo de solapas. Añadido servicio especial para solapas grandes. Corregidos algunos bugs 2024-11-29 11:25:38 +01:00
c1aecb43f2 messages chat view 2024-11-28 16:07:11 +01:00
524eb68b1c Merge branch 'fix/servicios_defecto_deleted_at' into 'main'
Fix/servicios defecto deleted at

See merge request jjimenez/safekat!407
2024-11-28 09:39:54 +00:00
54092fb29b corregido typo en presupuesto admin 2024-11-28 10:39:29 +01:00
58e51273b8 añadido deleted at en la busqueda de servicios defecto 2024-11-28 10:08:59 +01:00
093aa42e67 messages view 2024-11-28 09:14:59 +01:00
ac40c95d5b Merge branch 'dev/tick_papel_impresion_tapa_dura' into 'main'
añadido tick en papeles impresion para papel de tapa dura. añadida...

See merge request jjimenez/safekat!406
2024-11-27 14:34:24 +00:00
e70f0a0807 añadido tick en papeles impresion para papel de tapa dura. añadida funcionalidad presupuesto cliente 2024-11-27 15:33:55 +01:00
8a7a487dc0 Merge branch 'fix/cargar_presu_cliente_grmaje_cubierta' into 'main'
borradas lineas de lo antiguo

See merge request jjimenez/safekat!405
2024-11-27 09:22:21 +00:00
f3f8b7d194 borradas lineas de lo antiguo 2024-11-27 10:21:54 +01:00
0329c3284d Merge branch 'mig/tarifas_fresado_t_d' into 'main'
Mig/tarifas fresado t d

See merge request jjimenez/safekat!404
2024-11-27 08:11:03 +00:00
325c0acd1d Creado util para clonar tarifas de encuadernacion 2024-11-27 09:10:21 +01:00
71f75283e8 Merge branch 'main' into 'mig/tarifas_fresado_t_d'
Main

See merge request jjimenez/safekat!403
2024-11-27 07:27:25 +00:00
a112729931 Merge branch 'mod/papeles_cubierta_presu_cliente' into 'main'
añadidos seleccion de papeles cubierta desde bbdd

See merge request jjimenez/safekat!402
2024-11-26 19:29:19 +00:00
389501961b añadidos seleccion de papeles cubierta desde bbdd 2024-11-26 20:28:50 +01:00
184e4f3427 Actualizacion automatica: 2024-11-26 16:13:34 2024-11-26 16:13:36 +01:00
3400c5f77c Merge branch 'fix/busqueda_papeles_interior_cliente' into 'main'
añadido tick a papeles interior. ese tick se usa en la busqueda

See merge request jjimenez/safekat!400
2024-11-25 17:50:22 +00:00
fd0989f764 añadido tick a papeles interior. ese tick se usa en la busqueda 2024-11-25 18:49:46 +01:00
108af267e7 Merge branch 'fix/texto_imp_color' into 'main'
arreglado updatePapeles

See merge request jjimenez/safekat!399
2024-11-24 19:13:00 +00:00
649a19fd45 arreglado updatePapeles 2024-11-24 20:12:40 +01:00
f1654ace80 Merge branch 'dev/papeles_from_bd_presu_cliente' into 'main'
Dev/papeles from bd presu cliente

See merge request jjimenez/safekat!398
2024-11-24 19:04:26 +00:00
bcbf14c41f diseño interior con selector de papeles 2024-11-24 20:03:42 +01:00
b42b34f350 generando papeles especiales 2024-11-22 14:04:53 +01:00
e070edc10c Merge branch 'main' into 'dev/papeles_from_bd_presu_cliente'
Main

See merge request jjimenez/safekat!397
2024-11-22 10:44:55 +00:00
ffc976683f Merge branch 'fix/solapas_preview_cliente' into 'main'
arreglada cota en solapas tapa blanda

See merge request jjimenez/safekat!396
2024-11-22 10:44:12 +00:00
3548be722e arreglada cota en solapas tapa blanda 2024-11-22 11:43:37 +01:00
19bd409efa selectores de papel y gramaje. falta validacion 2024-11-21 21:57:06 +01:00
1a51d2ef99 Merge branch 'fix/permisos_menus' into 'main'
Arreglado bug archivo borrado en presupuesto_cliente_menu

See merge request jjimenez/safekat!395
2024-11-21 20:51:07 +00:00
63aab4a27b Arreglado bug archivo borrado en presupuesto_cliente_menu 2024-11-21 21:48:26 +01:00
881109620a Merge branch 'bug/permisos_pedidos' into 'main'
Añadido control de permisos en Pedidos

See merge request jjimenez/safekat!394
2024-11-21 20:19:40 +00:00
90bfb08dc5 Añadido control de permisos en Pedidos 2024-11-21 21:19:17 +01:00
9a19c67cd9 Merge branch 'main' into 'dev/papeles_from_bd_presu_cliente'
Main

See merge request jjimenez/safekat!393
2024-11-21 19:20:44 +00:00
a529f88edf Merge branch 'mod/papelesImpresionTick' into 'main'
Mod/papeles impresion tick

See merge request jjimenez/safekat!392
2024-11-21 19:19:56 +00:00
3af5851af7 problema muestra genericos que no 2024-11-21 20:16:50 +01:00
5d0f212040 problema edit delete vista 2024-11-20 17:33:06 +01:00
791a17d3da modificado el papel impresion tick 2024-11-20 17:29:07 +01:00
80b4d3aaf4 Merge branch 'add/migrations_papeles' into 'main'
añadido fichero de migracion

See merge request jjimenez/safekat!390
2024-11-20 15:40:17 +00:00
9dee74e2cb añadido fichero de migracion 2024-11-20 16:39:57 +01:00
c15970a9cc Merge branch 'mod/add_check_papeles' into 'main'
Mod/add check papeles

See merge request jjimenez/safekat!389
2024-11-20 15:36:22 +00:00
e5159abf58 añadido los checks de web cliente en papeles 2024-11-20 16:35:48 +01:00
8be0e3d16c modificado form papel generico 2024-11-19 20:51:11 +01:00
9e4cd024bd Merge branch 'bug/add_user' into 'main'
Bug/add user

See merge request jjimenez/safekat!388
2024-11-18 21:01:18 +00:00
cb2ca522c6 Arreglado bug añadir usuarios con email repetido 2024-11-18 22:00:37 +01:00
006a9a1413 Actualizacion automatica: 2024-11-18 16:05:01 2024-11-18 16:05:01 +01:00
5fbfe97a59 Merge branch 'add/nullableEnClientes' into 'main'
añadido el fichero de nullable para la tabla clientes

See merge request jjimenez/safekat!387
2024-11-17 20:06:05 +00:00
0862128f60 añadido el fichero de nullable para la tabla clientes 2024-11-17 21:05:37 +01:00
9f46f7c8e5 Merge branch 'fix/añadir_cliente' into 'main'
modificado formulario cliente. Añadida migracion para la bbdd

See merge request jjimenez/safekat!386
2024-11-17 19:58:12 +00:00
2a73d29546 modificado formulario cliente. Añadida migracion para la bbdd 2024-11-17 20:54:11 +01:00
64efc15b3f Merge branch 'mod/rename_cosidotapablanda' into 'main'
Mod/rename cosidotapablanda

See merge request jjimenez/safekat!385
2024-11-16 08:08:44 +00:00
df3ab47526 Cambiado la url de presupuestos adminstrador de cosidotapablanda a presupuestosadmin 2024-11-16 09:06:43 +01:00
9c14e77b10 Cambiando referencias a cosidotapablanca por presupuestoadmin 2024-11-14 21:31:22 +01:00
b512875739 Merge branch 'mod/papeles_cliente_bbdd' into 'main'
Mod/papeles cliente bbdd

See merge request jjimenez/safekat!384
2024-11-14 19:44:01 +00:00
c19d1ffae8 muchos cambios (y no los papeles) 2024-11-14 20:43:13 +01:00
923c283c22 arreglados algunos fallos. Añadido boton imprimir2 2024-11-13 23:05:14 +01:00
1b453961e1 arreglados algunos fallos. Añadido boton imprimir 2024-11-13 23:04:52 +01:00
33db277af2 añadida migracion 2024-11-13 22:16:31 +01:00
d9e5f1c6df añadido menu cliente para moviles 2024-11-13 21:18:44 +01:00
72a7010eee corregido error en presupuestosencuadernaciones para saber si es pod 2024-11-13 18:03:13 +01:00
b6e9ee5f3e Merge branch 'mod/click_edit_list_presu' into 'main'
al clickar en una linea se edita

See merge request jjimenez/safekat!382
2024-11-13 16:02:24 +00:00
4a792464b4 al clickar en una linea se edita 2024-11-13 17:02:00 +01:00
88728c947a Merge branch 'mod/export_tarifas_manipulado' into 'main'
añadido el exportar de las tarifas de manipulado lineas

See merge request jjimenez/safekat!381
2024-11-13 15:47:54 +00:00
ba36ba001f añadido el exportar de las tarifas de manipulado lineas 2024-11-13 16:47:34 +01:00
da463318c7 Merge branch 'mod/resumen_lateral_posicion' into 'main'
modificado el sitio donde aparece el resumen lateral y el total del resumen

See merge request jjimenez/safekat!380
2024-11-13 15:45:07 +00:00
9b62d62941 modificado el sitio donde aparece el resumen lateral y el total del resumen 2024-11-13 16:44:44 +01:00
9561fc16e7 Merge branch 'mod/campos_no_editables' into 'main'
paginas totales a campo no editable

See merge request jjimenez/safekat!379
2024-11-13 15:41:42 +00:00
8dfa8ad3e9 paginas totales a campo no editable 2024-11-13 16:40:25 +01:00
262886a6b9 Merge branch 'mod/tamanio_inputs' into 'main'
realizados cambios

See merge request jjimenez/safekat!378
2024-11-13 09:20:42 +00:00
5a6dbe5ca8 realizados cambios 2024-11-13 10:20:15 +01:00
e5b892480b Merge branch 'bug/iva_reducido_resumen' into 'main'
arreglado seleccion iva reducido para resumen

See merge request jjimenez/safekat!377
2024-11-13 08:18:20 +00:00
d2050ca44d arreglado seleccion iva reducido para resumen 2024-11-13 09:17:44 +01:00
f92725b6e6 Merge branch 'fix/change_save_btn_presu_cliente' into 'main'
quitado el boton de guardar de datos generales

See merge request jjimenez/safekat!376
2024-11-13 08:09:51 +00:00
d43851647b quitado el boton de guardar de datos generales 2024-11-13 09:09:20 +01:00
4a1d87542a Merge branch 'fix/mensajes' into 'main'
Fix/mensajes

See merge request jjimenez/safekat!375
2024-11-13 08:03:33 +00:00
d7c42b350d Merge branch 'main' into fix/mensajes
Fix : arreglo mensajes departamentos numero total mensajes. No se mostraba bien en el JS
2024-11-13 09:02:00 +01:00
2d130fa1cc Merge branch 'dev/resumen_lateral' into 'main'
Dev/resumen lateral

See merge request jjimenez/safekat!374
2024-11-13 07:45:23 +00:00
a6bff58793 resumen lateral terminado 2024-11-13 08:44:31 +01:00
a285764c2c fix chat department message total count 2024-11-13 08:31:27 +01:00
a53f85f35c Merge branch 'main' into 'dev/resumen_lateral'
Main

See merge request jjimenez/safekat!373
2024-11-13 06:05:53 +00:00
d20ceaa161 Merge branch 'fix/mensajes' into 'main'
Fix/mensajes

See merge request jjimenez/safekat!372
2024-11-12 23:50:12 +00:00
e21e790309 Merge branch 'main' into fix/mensajes
Merge main into fix/messages
2024-11-13 00:48:58 +01:00
eb604f3293 fix : mensajes internos, arreglar total numero mensajes 2024-11-13 00:47:47 +01:00
6b8ebba4e2 Merge branch 'main' into 'dev/resumen_lateral'
Main

See merge request jjimenez/safekat!371
2024-11-12 18:49:14 +00:00
66cf7ec99e Merge branch 'bug/direcciones_total_error' into 'main'
modificado cómo se calcula el coste de las direcciones

See merge request jjimenez/safekat!370
2024-11-12 18:47:19 +00:00
71e95fe441 modificado cómo se calcula el coste de las direcciones 2024-11-12 19:46:57 +01:00
b0765fbe64 Merge branch 'bug/direcciones_total_error' into 'main'
comprueba ahora que son iguales

See merge request jjimenez/safekat!369
2024-11-12 18:15:08 +00:00
1a3fc3eb58 comprueba ahora que son iguales 2024-11-12 19:14:44 +01:00
17c117432a Merge branch 'fix/no_mostrar_cliente_presu_cliente' into 'main'
ocultado el cliente

See merge request jjimenez/safekat!368
2024-11-12 18:10:38 +00:00
fd693fbb53 ocultado el cliente 2024-11-12 19:09:47 +01:00
c32ebc153f Merge branch 'main' into 'dev/resumen_lateral'
Main

See merge request jjimenez/safekat!367
2024-11-12 17:58:26 +00:00
4400695dd7 borrado xdebug y cambiado gitignore 2024-11-12 18:58:11 +01:00
ceb733e28b borrado xdebug 2024-11-12 18:53:23 +01:00
da2d63ef78 Merge branch 'bug/direcciones_presu_cliente' into 'main'
arreglado bug en direcciones de envio. tarifas envio ordenables por 3 columnas

See merge request jjimenez/safekat!366
2024-11-12 17:47:33 +00:00
e159ac8762 arreglado bug en direcciones de envio. tarifas envio ordenables por 3 columnas 2024-11-12 18:46:16 +01:00
b97e027920 feat: mensajes directos cliente 2024-11-12 18:26:22 +01:00
7223b56db6 menu lateral datos generales 2024-11-12 01:08:53 +01:00
294bee54ab ots 2024-11-10 19:35:05 +01:00
b9a4c7cd8b Merge branch 'feat/ots' into feat/ordenes-trabajo 2024-11-09 16:20:28 +01:00
cc9eba99fb Merge branch 'bug/cargar_presupuesto_cliente' into 'main'
Bug/cargar presupuesto cliente

See merge request jjimenez/safekat!365
2024-11-09 11:16:07 +00:00
873adc5bf5 boton guardar en todas pags, resuelto preview cosido 2024-11-09 12:15:32 +01:00
11b14ccf76 resuelto problema cuando se crea el presupuesto desde administrador con las tiradas alternativas 2024-11-09 10:13:15 +01:00
2f95c0bc9a Merge branch 'bug/nuevas_dim_tarifa_enc' into 'main'
las tarifas estaban bien. arreglado bug de guardar en presupuesto administrador

See merge request jjimenez/safekat!364
2024-11-08 16:25:55 +00:00
dd46b7f978 las tarifas estaban bien. arreglado bug de guardar en presupuesto administrador 2024-11-08 17:25:04 +01:00
6fd0351f3e Merge branch 'bug/add_presu_cliente' into 'main'
añadido state a add de presupuesto cliente

See merge request jjimenez/safekat!363
2024-11-08 07:02:39 +00:00
3a6287f5d9 añadido state a add de presupuesto cliente 2024-11-08 08:01:52 +01:00
41cecedee8 Merge branch 'bug/arreglar_httpdocs' into 'main'
Bug/arreglar httpdocs

See merge request jjimenez/safekat!362
2024-11-07 19:25:22 +00:00
1b637cd5a4 arreglado todo 2024-11-07 20:24:40 +01:00
b251e0e56c añadidos assets y js 2024-11-07 20:17:58 +01:00
2f01f41599 Merge branch 'dev/presu_cliente_v2_problema_merge' into 'main'
copiada la rama presu_cliente_v2 en esta para poder hacer el merge al main

See merge request jjimenez/safekat!361
2024-11-07 18:21:10 +00:00
a880355012 copiada la rama presu_cliente_v2 en esta para poder hacer el merge al main 2024-11-07 19:20:12 +01:00
aeb5f9106f Merge branch 'revert-47e6cbb5' into 'main'
Revert "Merge branch 'feat/add-chat-presupuesto-cliente' into 'main'"

See merge request jjimenez/safekat!353
2024-10-23 05:18:14 +00:00
7ce2723a09 Revert "Merge branch 'feat/add-chat-presupuesto-cliente' into 'main'"
This reverts merge request !352
2024-10-23 05:18:00 +00:00
47e6cbb5f7 Merge branch 'feat/add-chat-presupuesto-cliente' into 'main'
Feat/add chat presupuesto cliente

See merge request jjimenez/safekat!352
2024-10-23 05:17:38 +00:00
8f2f19df1b fix mensajes internos 2024-10-23 05:14:31 +00:00
a3561d7623 add mensajeria module to presupuesto cliente edit 2024-10-23 05:14:04 +00:00
5e2d37ed26 add xdeubg 2024-10-23 05:10:33 +00:00
72b6845625 fix app.come_back button 2024-10-23 05:01:58 +00:00
9919496397 finalizado nuevo presupuesto cliente a falta de confirmar 2024-10-22 23:34:21 +02:00
33496d81ee Merge branch 'feat/tarifa-code' into 'dev/presu_cliente_v2'
Feat/tarifa code

See merge request jjimenez/safekat!351
2024-10-22 12:29:26 +00:00
a1f1151c1b error-presupuesto 2024-10-22 14:28:22 +02:00
b28b383136 Merge branch 'dev/presu_cliente_v2' into feat/tarifa-code 2024-10-22 14:22:07 +02:00
0a5f8dee68 espiral y wireo 2024-10-22 14:14:52 +02:00
7a3c11c343 Merge branch 'fix/visto-datatable-errores-presupuesto' into 'dev/presu_cliente_v2'
Fix/visto datatable errores presupuesto

See merge request jjimenez/safekat!350
2024-10-22 08:33:34 +00:00
4afb977577 Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2 2024-10-22 10:31:43 +02:00
262aa4a88f fix visto datatable errores-presupuesto 2024-10-22 10:30:47 +02:00
9f61faf67a preview casi 2024-10-22 10:29:34 +02:00
2f83526d7e comprobando presupuestos 2024-10-22 08:43:21 +02:00
e64788ddb5 remove * from label comment input form 2024-10-21 18:08:56 +00:00
1ed5c868b5 add comment and code to tarifas extra 2024-10-21 18:07:22 +00:00
ecb5abaa6d remove required from code field 2024-10-21 18:07:12 +00:00
b74495117f add code and comment to tarifas envios 2024-10-21 18:00:33 +00:00
db67b1946f add code and comment to tarifas encuadernacion 2024-10-21 17:56:39 +00:00
66a5651a30 add code and comment to tarifaacabado 2024-10-21 17:52:09 +00:00
2ff86a7743 add comment field 2024-10-21 17:46:46 +00:00
c7c9b54556 add code and comment tarifapreimpresion 2024-10-21 17:20:02 +00:00
9b964a89f6 add comment field 2024-10-21 17:06:03 +00:00
c6b1bd9292 add comment field 2024-10-21 17:05:50 +00:00
73a60466d3 add code field to models and entities 2024-10-21 16:51:19 +00:00
49e03fb7e9 fix : add breadcumbs and fix button save 2024-10-20 17:50:49 +00:00
62a3706049 cargando presu 2024-10-19 20:26:52 +02:00
1914cb01fe a punto de guardar 2024-10-19 14:32:49 +02:00
09e5149090 Mergeado
Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2
2024-10-19 13:04:05 +02:00
ac3a93370c fix : update visto errorPresupuestoForm 2024-10-19 10:00:31 +00:00
859f2a99be merge errores_presupuestos 2024-10-19 08:56:31 +00:00
4d20b4ac1c fix : contemplat que presupuesto_id es null 2024-10-19 08:54:53 +00:00
8135e635ab errores presupuesto 2024-10-19 10:38:13 +02:00
643e325e59 Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2 2024-10-19 09:42:06 +02:00
3c48d88357 cargando presu 2024-10-19 09:36:48 +02:00
15642d6e47 Merge branch 'feat/errores_presupuestos' into 'dev/presu_cliente_v2'
Feat/errores presupuestos

See merge request jjimenez/safekat!348
2024-10-19 07:34:00 +00:00
035d695780 merge changes from dev/presu_cliente_v2 2024-10-19 07:33:41 +00:00
f9b12cbcdd feat:errores presupuesto 2024-10-19 07:29:47 +00:00
f1df4559f7 error presupuestos 2024-10-18 16:00:10 +02:00
464e136025 cargando presupuesto datos generales 2024-10-18 14:33:27 +02:00
23491b2e1a add errores presupuesto 2024-10-17 23:48:16 +00:00
8a044d41fe cargando datos 2024-10-18 01:43:41 +02:00
7c9b8a0b6d guardar terminado 2024-10-17 22:22:43 +02:00
a0128d8f1e arreglado la comprobación del papelformato 2024-10-17 11:43:16 +02:00
fdf838c909 quitado rellenar presupuesto 2024-10-16 03:46:35 +02:00
b5924dceb5 falta preview resumen 2024-10-16 03:45:10 +02:00
3a623535df chat 2024-10-15 17:25:01 +00:00
2c5ea4d7ba Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2 2024-10-15 15:42:19 +02:00
19be8591f3 trabajando en el backend para papeles diferentes 2024-10-15 15:41:38 +02:00
a8a741f0bf trabajando en añadir las tiradas a las direcciones 2024-10-15 11:43:44 +02:00
6865d810da change title message notification dropdown 2024-10-15 05:20:35 +00:00
de9cf30aac solucionados todos los select2 en conflicto 2024-10-14 18:29:50 +02:00
29eeecb905 fix : mensaje-internos only users in group admin and beta 2024-10-14 16:20:59 +00:00
668d0d79e6 problema ruta papelformato 2024-10-14 18:19:41 +02:00
02aa1f2e45 merge feat/mensajes-internos 2024-10-14 13:33:09 +00:00
52303e9185 trabajando en el selector de cliente 2024-10-14 14:45:40 +02:00
7857e5992a test 2024-10-14 14:33:49 +02:00
f9b7de63fd Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2 2024-10-14 14:33:06 +02:00
9c3a7848f3 arreglado los select2 para que funcionen con el select2 de alvaro 2024-10-14 14:29:43 +02:00
6b49984c28 Merge branch 'main' into 'dev/presu_cliente_v2'
Main

See merge request jjimenez/safekat!347
2024-10-14 12:04:48 +00:00
44fc60372b Cogido el select2 de alvaro para problema del merge. 2024-10-14 14:03:24 +02:00
287335dc6b cogido select2 de alvaro 2024-10-14 13:58:50 +02:00
cb1d280b35 Merge branch 'bug/save_tarifas_extra' into 'main'
arreglado bug de tarifas extra importe fijo

See merge request jjimenez/safekat!345
2024-10-14 11:55:14 +00:00
c5c4a31521 arreglado bug de tarifas extra importe fijo 2024-10-14 13:54:08 +02:00
612b67883c Merge branch 'feat/mensajes-internos' into 'main'
feat : mensajes internos module

See merge request jjimenez/safekat!344
2024-10-13 23:13:14 +00:00
2012ada27f feat : mensajes internos module 2024-10-13 23:10:17 +00:00
7ad3133a15 acabando el tema de las direcciones 2024-10-14 00:50:15 +02:00
0eaac5af28 trabajando en el backend 2024-10-13 21:10:02 +02:00
e64022a7b7 falta boton add direcciones 2024-10-09 20:04:58 +02:00
a069b4109c trabajando en el componente direccion 2024-10-09 13:02:49 +02:00
92389bb5f5 Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2
mergeo de main
2024-10-08 15:15:25 +02:00
032b09f0a3 añadido direcciones 2024-10-08 15:14:12 +02:00
91f26520cb Merge branch 'main' into 'dev/presu_cliente_v2'
Main

See merge request jjimenez/safekat!343
2024-10-08 13:13:52 +00:00
dfd915e47f corregidos errores en logica 2024-10-08 14:07:29 +02:00
4045771c2d paginas para cosido multiplo de 4 2024-10-08 13:49:53 +02:00
1d3f817709 terminada la vista cubierta 2024-10-08 13:20:22 +02:00
2e2888ec26 solucionado el click de los gramajes 2024-10-07 11:31:01 +02:00
c7e2773116 orden de trabajo 2024-10-06 18:01:36 +00:00
78b255fa0d problema con los custom radiobutons 2024-10-06 19:52:24 +02:00
cece606bb1 trbajando en los custom checks 2024-10-05 19:17:52 +02:00
ba3ec185ef Merge branch 'feat/config-variables-app' into 'main'
feat: add config variable menu

See merge request jjimenez/safekat!342
2024-10-02 18:37:49 +00:00
8b10aa655a feat: add config variable menu 2024-10-02 18:32:52 +00:00
13e3a69cd6 añadido coger el idioma 2024-09-30 11:06:00 +02:00
f09d5aeceb modificado calssselect.js 2024-09-30 08:53:37 +02:00
daca044cf3 modificado datosgenerales.js 2024-09-30 08:52:14 +02:00
cb982bd38a añadidos los ficheros 2024-09-30 08:38:22 +02:00
69b27f0cd8 cambiando presupuesto cliente 2024-09-29 18:07:54 +02:00
8617553dea Merge branch 'dev/chat' into 'main'
Dev/chat

See merge request jjimenez/safekat!341
2024-09-26 13:14:14 +00:00
2049cb1e02 fix:conflicts 2024-09-26 13:13:58 +00:00
bdc5b0c442 feat:chat 2024-09-26 13:11:01 +00:00
c5a5f01fa0 fix : chat modules, notifications 2024-09-26 13:10:12 +00:00
c0e90a723b Merge branch 'dev/tokens' into 'main'
Configuracion inicial para usar atentificacion via JWT (requerido tocar el...

See merge request jjimenez/safekat!340
2024-09-26 12:03:47 +00:00
130c5dad88 Configuracion inicial para usar atentificacion via JWT (requerido tocar el composer para firebase/jwt 2024-09-26 14:01:58 +02:00
bd22e89a28 Merge branch 'dev/chat' into 'main'
Dev/chat

See merge request jjimenez/safekat!339
2024-09-26 07:53:15 +00:00
d3722440c3 fix chat 2024-09-26 07:51:53 +00:00
21c1bd9bd2 fix : add chat presupuesto cliente 2024-09-26 07:50:53 +00:00
a6dbe6de07 fix : cliente show departments chats 2024-09-26 07:33:34 +00:00
68d5a7157e Merge branch 'fix/porcentaje_total_presupuesto' into 'main'
corregida division por cero

See merge request jjimenez/safekat!338
2024-09-26 07:07:14 +00:00
bf568fec92 corregida division por cero 2024-09-26 09:06:34 +02:00
5aa1aa6222 Merge branch 'dev/chat' into 'main'
feat:chat modules

See merge request jjimenez/safekat!337
2024-09-25 17:44:02 +00:00
c651db61ff feat:chat modules 2024-09-25 17:42:55 +00:00
a2f91866f7 Merge branch 'dev/chat' into 'main'
Dev/chat

See merge request jjimenez/safekat!336
2024-09-23 08:10:57 +00:00
2fc9af9db4 Merge branch 'main' into dev/chat 2024-09-23 10:04:55 +02:00
d6a95f78ee feat : add chat in facturas,presupuestos y pedidos 2024-09-23 10:00:47 +02:00
766347ad81 feat: chat module 2024-09-23 09:19:45 +02:00
70fa74333d Merge branch 'fix/porcentaje_margen_total' into 'main'
añadido porcentaje al margen total

See merge request jjimenez/safekat!334
2024-09-22 10:13:04 +00:00
0b0b928619 añadido porcentaje al margen total 2024-09-22 12:12:40 +02:00
b1eeddc5bc Merge branch 'dev/add_precio_coste_servicios' into 'main'
añadido el coste en las tablas de los servicios

See merge request jjimenez/safekat!333
2024-09-22 09:56:47 +00:00
74041042c5 añadido el coste en las tablas de los servicios 2024-09-22 11:55:52 +02:00
bfea4aa67c feat : migration and chat models 2024-09-20 11:25:34 +02:00
b25abc19d9 feat : chat migrations 2024-09-20 08:54:43 +02:00
b7cfdf87b9 Merge branch 'fix/resumen_presupuesto2' into 'main'
cogerrido error margen

See merge request jjimenez/safekat!332
2024-09-19 07:18:56 +00:00
7d26975ac3 cogerrido error margen 2024-09-19 09:18:39 +02:00
0177ca0f73 Merge branch 'fix/resumen_presupuesto' into 'main'
cambiado el margen de servicios para que coincida con las tarifas. Las horas...

See merge request jjimenez/safekat!331
2024-09-19 07:13:47 +00:00
19e3e6ce0e cambiado el margen de servicios para que coincida con las tarifas. Las horas se meten como margen impresion 2024-09-19 09:13:25 +02:00
2f93a8a02c Merge branch 'fix/importe_minimo_presu' into 'main'
modificadas tarifas en las que import minimo y precio minimo no tenian...

See merge request jjimenez/safekat!330
2024-09-19 06:58:35 +00:00
1862d4ccf9 modificadas tarifas en las que import minimo y precio minimo no tenian sentido. Revision de Presupuestos* para calcular la tarifa 2024-09-19 08:58:15 +02:00
5c72771fbe trabajando en los errores de calculo de tarifas 2024-09-18 21:01:13 +02:00
8777ce19c1 Merge branch 'fix/importe_minimo_tarifas_presu' into 'main'
solucionado el problema del precio mínimo en los presupuestosencuadernacion....

See merge request jjimenez/safekat!329
2024-09-18 12:59:48 +00:00
64288baf54 solucionado el problema del precio mínimo en los presupuestosencuadernacion. Falta el resto de presupuestos 2024-09-18 14:59:06 +02:00
f8dd56b74c feat: add chat related models 2024-09-17 23:36:31 +02:00
db3f79da29 feat: add timestamp fields 2024-09-17 23:36:10 +02:00
51dc0ca676 feat: add chat migrations 2024-09-17 23:11:35 +02:00
639230f780 Merge branch 'mod/textos_color_impresion' into 'main'
Arreglo estetico de las opciones de impresion en presupuestos de clientes

See merge request jjimenez/safekat!328
2024-09-16 20:03:21 +00:00
d3ae73a82d Arreglo estetico de las opciones de impresion en presupuestos de clientes 2024-09-16 22:02:54 +02:00
cf3cebfcfb Merge branch 'main' into dev/chat 2024-09-16 20:45:58 +02:00
9ad062ed27 Merge branch 'fix/resumen_presupuesto_admin_servicios_margen' into 'main'
cambio en como se calcula el margen de servicios en presupuestos

See merge request jjimenez/safekat!327
2024-09-16 15:50:57 +00:00
2469101541 cambio en como se calcula el margen de servicios en presupuestos 2024-09-16 17:50:20 +02:00
4a3d594347 Merge branch 'fix/id_cliente_pedidos-facturas' into 'main'
customizada vista de peiddos y facturas cliente

See merge request jjimenez/safekat!326
2024-09-16 11:59:14 +00:00
4ce8b22c5a customizada vista de peiddos y facturas cliente 2024-09-16 13:58:53 +02:00
d860d6426c Merge branch 'fix/acabados_cubierta_p_cliente' into 'main'
corregido error en pasar acabados cubierta en presupuesto cliente

See merge request jjimenez/safekat!325
2024-09-16 10:09:46 +00:00
4b2b4dfade corregido error en pasar acabados cubierta en presupuesto cliente 2024-09-16 12:09:27 +02:00
dd9b49026b Merge branch 'feat/direcciones_cliente' into 'main'
añadida la vista para modificar las direcciones de cliente

See merge request jjimenez/safekat!324
2024-09-16 08:58:02 +00:00
07cd952532 añadida la vista para modificar las direcciones de cliente 2024-09-16 10:57:38 +02:00
ca5d70b37c Merge branch 'bug/ancho_libro_solapas' into 'main'
Modificado calculo del ancho de esquema de cubierta en admin y cliente para...

See merge request jjimenez/safekat!323
2024-09-14 19:57:57 +00:00
f8497e4388 Modificado calculo del ancho de esquema de cubierta en admin y cliente para tener en cuenta los 3mm de offset de solapas 2024-09-14 21:57:33 +02:00
150a7aa158 Merge branch 'bug/boton_imprimir_presu_cliente' into 'main'
Añadido boton imprimir en presupuesto cliente, tanto en presupuestos confirmados como no

See merge request jjimenez/safekat!322
2024-09-14 07:27:11 +00:00
19e81a6c25 Añadido boton imprimir en presupuesto cliente, tanto en presupuestos confirmados como no 2024-09-14 09:26:46 +02:00
6e0c22d981 Merge branch 'bugs/varios' into 'main'
Bugs/varios

See merge request jjimenez/safekat!321
2024-09-13 19:09:29 +00:00
2239d39919 Quitado menu vistas de impresion, maquetacion etc a clientes, solo ADMIN 2024-09-13 21:09:08 +02:00
d01fbbfe4b Añadida visualizacion de menus en roles cliente (admin/editor 2024-09-13 20:55:25 +02:00
9e57aef8bc Merge branch 'fix/servicios_defecto' into 'main'
solucionado el problema de calcular serv defecto en presupuestador admin....

See merge request jjimenez/safekat!320
2024-09-13 17:53:29 +00:00
6a307e9fe3 solucionado el problema de calcular serv defecto en presupuestador admin. Quitada merma para calcular precio servicios en presupuestador admin 2024-09-13 19:52:36 +02:00
26056082fa Merge branch 'bug/arreglar_vistas' into 'main'
Arreglado bug del direccionamiento en vista de clientes al listados de...

See merge request jjimenez/safekat!319
2024-09-13 13:11:15 +00:00
9cc8c40434 Añadido menu --Direcciones-- dentro de perfil clientes (admin y editor 2024-09-13 15:10:10 +02:00
99bdaf7a24 Arreglado bug del direccionamiento en vista de clientes al listados de clientes en lugar de al perfil 2024-09-13 14:54:55 +02:00
4614db53cf Merge branch 'main' into dev/chat 2024-09-07 20:30:51 +02:00
36a627b737 Merge branch 'fix/xml-upload' into 'main'
fix:pedido xml folder

See merge request jjimenez/safekat!318
2024-09-05 12:23:34 +00:00
6bddf1b997 fix:pedido xml folder 2024-09-05 12:38:25 +02:00
54731f65b2 Merge branch 'fix/error-pedido-xml' into 'main'
fix : remote dir for pedido files

See merge request jjimenez/safekat!317
2024-09-04 13:31:40 +00:00
333d9a8c09 fix : remote dir for pedido files 2024-09-04 15:30:08 +02:00
69917caed3 Merge branch 'fix/error-pedido-xml' into 'main'
fix : error naming HIDRIVE PORT

See merge request jjimenez/safekat!316
2024-09-03 10:50:13 +00:00
adb1335c17 fix : error naming HIDRIVE PORT 2024-09-03 12:48:58 +02:00
357966cf69 Merge branch 'feat/xml-pedido' into 'main'
Feat/xml pedido

See merge request jjimenez/safekat!315
2024-09-03 10:16:53 +00:00
7097ef72cc Merge branch 'main' into feat/xml-pedido 2024-09-02 23:36:42 +02:00
93714ac955 feat : add generate XML functionality in crearPedido 2024-09-02 23:33:48 +02:00
fe4fdb8607 feat: generateXML finished 2024-09-02 23:33:05 +02:00
6e41e73997 feat : add method getPedidoPresupuestoTipoImpresion 2024-09-02 23:32:11 +02:00
ebe649c7d8 feat : add method findByPresupuesto 2024-09-02 23:31:50 +02:00
68f2ccb1c5 feat : add class library for sftp 2024-09-02 23:31:20 +02:00
1d7f06b018 feat : after upload presupuesto file send to sftp server 2024-09-02 23:30:59 +02:00
295fd88201 feat: add class config for SFTP xml export 2024-09-02 23:29:14 +02:00
173b6d5a5d feat: add config class for XML export to sftp 2024-09-02 23:28:54 +02:00
23a34d10b0 delete 2024-09-02 23:28:03 +02:00
121708b71c add package phpseclib/phpseclib for stfp 2024-09-02 23:27:54 +02:00
403c742bf3 Merge branch 'mod/albaranes_del_confirmacion' into 'main'
añadida confirmación para borrar albaranes

See merge request jjimenez/safekat!313
2024-08-29 12:06:42 +00:00
8653971dd2 añadida confirmación para borrar albaranes 2024-08-29 14:05:17 +02:00
4e40d2e8f4 Merge branch 'mod/quitar_pais_req_presupuestos' into 'main'
quitado pais como campo obligatorio para nuevo presupuesto administrador

See merge request jjimenez/safekat!312
2024-08-29 09:56:18 +00:00
1f09a1c603 quitado pais como campo obligatorio para nuevo presupuesto administrador 2024-08-29 11:55:58 +02:00
1afa6bc520 Merge branch 'feat/proveedor_tarifas_manipulado' into 'main'
Feat/proveedor tarifas manipulado

See merge request jjimenez/safekat!311
2024-08-29 07:33:28 +00:00
e1a72e7874 modificado lo necesario para presupuesto cliente 2024-08-29 09:32:58 +02:00
b908c5b5bf modificado presupuesto comercial 2024-08-29 09:27:05 +02:00
43fdafc099 upload xml to server by ftp 2024-08-29 01:04:44 +02:00
3a0011b49a delete FTPService, moved to Libraries 2024-08-29 01:04:10 +02:00
c8335b5740 add SafekatFtpClient Library 2024-08-29 01:03:50 +02:00
8e5d208bbf add general_helper, deleted by error 2024-08-29 01:03:29 +02:00
01cc74ed60 delete ftp method 2024-08-29 01:03:00 +02:00
c3248cd3ec add FTP Config file 2024-08-29 01:02:33 +02:00
251268fb24 add Libraries path 2024-08-29 01:02:15 +02:00
eb4ea31cef add php ftp lib 2024-08-28 22:28:49 +02:00
da379a7af9 ftp service 2024-08-28 22:28:34 +02:00
f278f821b6 trabajando en presupuesto comercial 2024-08-28 18:47:53 +02:00
c8106eafa1 Merge branch 'main' into feat/xml-pedido 2024-08-28 07:56:12 +02:00
e2289030db arraglado fallo en buscador cuando se limpia, orden precios y replace de , a . 2024-08-27 19:04:18 +02:00
49314e166d terminadas modificaciones en tarifas acabado 2024-08-27 14:31:00 +02:00
1e347cc7d6 Merge branch 'mod/tarifas_cosido' into 'main'
Mod/tarifas cosido

See merge request jjimenez/safekat!310
2024-08-24 09:38:56 +00:00
597330adb7 insertado lo de los cuadernillos en presupuesto cliente 2024-08-24 11:38:22 +02:00
8c91be99c3 Merge branch 'main' into 'mod/tarifas_cosido'
Main

See merge request jjimenez/safekat!309
2024-08-23 11:45:11 +00:00
b9f28c5ee8 paginas por cuadernillo añadido a presupuesto comercial 2024-08-23 13:44:24 +02:00
d702b5aa92 Merge branch 'mod/titulos_tarifas' into 'main'
Cambiados textos de encabezados de tabla

See merge request jjimenez/safekat!308
2024-08-22 19:26:18 +00:00
21a955d4d2 Cambiados textos de encabezados de tabla 2024-08-22 21:22:06 +02:00
50334186f2 Merge branch 'bug/tiempo_t_enc_presupuestos' into 'main'
arreglado que no se mostraba el tiempo cuando se añadian los servicios por defecto

See merge request jjimenez/safekat!307
2024-08-20 11:23:38 +00:00
996cafeb65 arreglado que no se mostraba el tiempo cuando se añadian los servicios por defecto 2024-08-20 13:23:06 +02:00
ee45baec3b xml file generation 2024-08-19 08:23:39 +02:00
2734a94983 Merge branch 'pdf_factura' into 'main'
Pdf factura

See merge request jjimenez/safekat!306
2024-08-17 17:17:36 +00:00
242feffe7f Generados botones de exportar a excel en listado facturas (no logica 2024-08-17 19:15:09 +02:00
d8eefcf1b7 Implementados botones de imprimir factura y exportar lineas pedido 2024-08-17 18:37:13 +02:00
1170852209 Fix bug del id de factura 2024-08-16 16:01:43 +02:00
ec8288e6e4 Preparada factura en PDF 2024-08-16 15:44:45 +02:00
144faa9363 Merge branch 'main' into 'dev/chat'
Main

See merge request jjimenez/safekat!305
2024-08-16 08:51:39 +00:00
5169174e57 git push 2024-08-12 12:16:04 +02:00
070ffb934d xml envios 2024-08-12 10:59:53 +02:00
5648f43413 xml service 2024-08-12 08:02:14 +02:00
a91685747c Merge branch 'main' into feat/pedidos-export 2024-08-10 21:11:10 +02:00
665dc2d86d xml service 2024-08-10 21:09:56 +02:00
a8f8c4851a Merge branch 'dev/excel_pdf_facturas' into 'main'
Dev/excel pdf facturas

See merge request jjimenez/safekat!304
2024-08-08 12:50:44 +00:00
1ad6fe93b7 terminado tirada flexible 2024-08-08 14:49:37 +02:00
b95930dcc2 falta boton excedentes 2024-08-07 22:01:00 +02:00
d39a8a4e0b Merge branch 'main' into 'dev/excel_pdf_facturas'
Main

See merge request jjimenez/safekat!303
2024-08-06 07:18:46 +00:00
42d21c9ca1 Merge branch 'feat/facturas_tiradas_flex' into 'main'
Feat/facturas tiradas flex

See merge request jjimenez/safekat!302
2024-08-06 07:18:12 +00:00
74b722903f Merge branch 'main' into 'feat/facturas_tiradas_flex'
Main

See merge request jjimenez/safekat!301
2024-08-06 07:17:43 +00:00
c5867d25b5 Merge branch 'dev/totalizadores_pedidos' into 'main'
Dev/totalizadores pedidos

See merge request jjimenez/safekat!300
2024-08-05 19:25:40 +00:00
8ea0ab13c0 totalizadores implementados 2024-08-05 21:25:16 +02:00
4255b74f33 filtros columna en pedidos hecho 2024-08-05 17:59:00 +02:00
3d6aa77993 Merge branch 'main' into 'feat/facturas_tiradas_flex'
Main

See merge request jjimenez/safekat!298
2024-08-05 11:38:18 +00:00
d4373a401f Arreglando filtrado 2024-08-05 13:36:26 +02:00
7318e4bd7c Actualizacion automatica: 2024-07-31 22:54:20 2024-07-31 22:54:20 +02:00
d193ba0b5f Merge branch 'mod/formas_pago' into 'main'
Añadido CRUD para formas de pago

See merge request jjimenez/safekat!297
2024-07-31 20:19:20 +00:00
3f1165f323 Añadido CRUD para formas de pago 2024-07-31 22:18:53 +02:00
f3ad5d8b06 Merge branch 'main' into 'dev/chat'
Main

See merge request jjimenez/safekat!296
2024-07-31 18:41:45 +00:00
c5e4a70ec0 Actualizacion automatica: 2024-07-31 20:40:31 2024-07-31 20:40:33 +02:00
17aa1cf51e Merge branch 'feat/seccion_facturas_en_pedidos' into 'main'
finalizado el ver facturas en pedidos

See merge request jjimenez/safekat!295
2024-07-30 17:07:57 +00:00
6dd6622b35 finalizado el ver facturas en pedidos 2024-07-30 19:07:03 +02:00
8f2e99863d Merge branch 'feat/edit_factura' into 'main'
Feat/edit factura

See merge request jjimenez/safekat!293
2024-07-30 11:32:55 +00:00
38d3592461 edicion de facturas terminada a falta de tirada flexible 2024-07-30 13:30:33 +02:00
7813cf744b Arreglado bug para que salga en el menu configuracion papel generico y de impresion 2024-07-24 13:16:09 +02:00
1c0be4f96f aaa 2024-07-18 14:29:18 +02:00
4c33167764 casi terminado 2024-07-17 14:51:47 +02:00
99e9bf51a6 Merge branch 'main' into 'feat/edit_factura'
Main

See merge request jjimenez/safekat!292
2024-07-17 07:55:06 +00:00
5f03a3dfda Merge branch 'mod/user_pwd' into 'main'
Añadido campo de verficacion de contraseña y campo de notas

See merge request jjimenez/safekat!291
2024-07-16 20:52:42 +00:00
0b6ce06c96 Añadido campo de verficacion de contraseña y campo de notas 2024-07-16 22:52:05 +02:00
67fbc2589f trabajando en pagos (datepicker) 2024-07-16 22:11:21 +02:00
57688a5310 Merge branch 'feat/user_pwd' into 'main'
Feat/user pwd

See merge request jjimenez/safekat!290
2024-07-16 07:27:23 +00:00
944f92f3b0 Terminada gestion de contraseñas de usuarios en perfil y zona admin 2024-07-16 09:26:03 +02:00
ad266dd14f Merge branch 'main' into 'feat/user_pwd'
Main

See merge request jjimenez/safekat!289
2024-07-16 06:34:42 +00:00
722748aba4 Merge branch 'mod/profile_pwd' into 'main'
Añadido cambio de contraseña en perfil de usuario (mejorar UI

See merge request jjimenez/safekat!288
2024-07-15 21:20:37 +00:00
ad26a70aed Añadido cambio de contraseña en perfil de usuario (mejorar UI 2024-07-15 23:20:00 +02:00
159c4a6ce1 añadido opcion de crear contraseña en interfaz de administrador 2024-07-15 15:26:53 +02:00
ce7ba82bda Merge branch 'feat/add_edit_factura' into 'main'
Feat/add edit factura

See merge request jjimenez/safekat!286
2024-07-15 09:24:15 +00:00
955fa05666 commit para mergear antes de ramas nuevas 2024-07-15 11:23:13 +02:00
e18368e647 working 2024-07-10 12:28:48 +02:00
b6420b7b8a trabajando boton ver pedido 2024-07-10 00:25:26 +02:00
078205b552 añadiendo lineas 2024-07-09 20:25:32 +02:00
2b7b12fde7 añadiendo linea factura 2024-07-09 15:21:20 +02:00
5605a88846 editar factura 2024-07-07 19:25:39 +02:00
f46a03e66d avances de hoy 2024-07-06 22:44:29 +02:00
26f3057bbe Merge branch 'main' into 'dev/chat'
Main

See merge request jjimenez/safekat!284
2024-07-06 15:54:04 +00:00
c7d8d0c5cc Merge branch 'feat/entidades_modelos_facturas' into 'main'
Feat/entidades modelos facturas

See merge request jjimenez/safekat!283
2024-07-06 15:20:35 +00:00
a06efc5736 Merge branch 'main' into 'feat/entidades_modelos_facturas'
Instalada libreria de PHP para Excel y hecho primer ejemplo de creacion de...

See merge request jjimenez/safekat!282
2024-07-06 15:12:47 +00:00
35e4e8ef95 Configuraciones iniciales del sistema de mensajeria 2024-07-02 21:45:32 +02:00
95ca383215 Merge branch 'dev/excel' into 'main'
Instalada libreria de PHP para Excel y hecho primer ejemplo de creacion de...

See merge request jjimenez/safekat!281
2024-07-02 15:43:46 +00:00
d1495534e0 Instalada libreria de PHP para Excel y hecho primer ejemplo de creacion de excel. Esta hecho el excel de giros de SK (encabezados + dummy data 2024-07-02 14:07:01 +02:00
514711c5c2 Merge branch 'bud/tarifas_extras' into 'main'
Bud/tarifas extras

See merge request jjimenez/safekat!280
2024-07-02 11:34:05 +00:00
c8e3dfd873 Añadidos permisos a tarifas, salvo metodo delete 2024-07-02 10:40:17 +02:00
108899c796 Actualizacion automatica: 2024-07-02 01:01:40 2024-07-02 01:01:42 +02:00
1fb9977094 a 2024-06-28 20:45:41 +02:00
ca901b14f3 listado de facturas terminado. trabajando en añadir 2024-06-27 20:16:30 +02:00
fcaacfbb5d hechos modelos y entidades para facturas 2024-06-25 20:08:17 +02:00
2d0732c218 Añadidas tarifas extras, trabajando en permisos de tarifas 2024-06-18 22:33:07 +02:00
20702a47f8 Merge branch 'feat/presu_cliente_pass_id' into 'main'
Feat/presu cliente pass

See merge request jjimenez/safekat!279
2024-06-18 15:47:57 +00:00
5e876f07fb terminado y arreglado otros bugs 2024-06-18 17:47:21 +02:00
e235165499 falta comprobar que se puede cambiar el tipo de presupuesto 2024-06-18 15:26:15 +02:00
c476c9a938 Merge branch 'dev/usuarios_clientes' into 'main'
añadido cliente id a users

See merge request jjimenez/safekat!278
2024-06-18 11:19:24 +00:00
1fa4e1cd9c añadido cliente id a users 2024-06-18 13:18:25 +02:00
52633ef695 Merge branch 'dev/albaranes_pdf_2' into 'main'
Implementada la logica para la creacion de albaranes en PDF

See merge request jjimenez/safekat!277
2024-06-16 20:54:18 +00:00
2147452125 Implementada la logica para la creacion de albaranes en PDF 2024-06-16 22:53:52 +02:00
57194b5dd3 Merge branch 'feat/confirmar_presupuesto_admin' into 'main'
ya se puede confirmar

See merge request jjimenez/safekat!276
2024-06-16 16:04:33 +00:00
8335c458ed ya se puede confirmar 2024-06-16 18:02:50 +02:00
aed64581c9 Merge branch 'dev/pdf_albaranes' into 'main'
Dev/pdf albaranes

See merge request jjimenez/safekat!275
2024-06-16 07:19:00 +00:00
e6e46c84e7 Añadida impresion dummy pdf 2024-06-16 09:18:33 +02:00
4686e5040e Arreglado archivo de rutas 2024-06-16 08:35:30 +02:00
953b07497d Merge branch 'main' into 'dev/pdf_albaranes'
Main

See merge request jjimenez/safekat!274
2024-06-16 06:30:06 +00:00
17e9f8e52f Arreglar conflictos locales del Routes.php 2024-06-16 08:29:13 +02:00
31565ff6dd Merge branch 'dev/pedidos_v1' into 'main'
Dev/pedidos v1

See merge request jjimenez/safekat!273
2024-06-16 00:10:32 +00:00
2f1f6f9631 terminado 2024-06-16 02:10:01 +02:00
3171c32283 faltan las fechas 2024-06-16 01:47:34 +02:00
4076fff844 haciendo los eventos 2024-06-15 19:42:36 +02:00
87e6b029e2 falta mostrar precios albaran 2024-06-15 11:14:02 +02:00
3e0443927c trabajando 2024-06-14 15:04:41 +02:00
ef7cbf853b Merge branch 'main' into 'dev/pedidos_v1'
Main

See merge request jjimenez/safekat!272
2024-06-14 07:11:10 +00:00
c9d8875392 trabajando en pedidos 3 2024-06-13 23:53:20 +02:00
d7de7b0778 Primera version del pdf de albaran 2024-06-13 22:45:49 +02:00
40279095a3 Merge branch 'dev/exponer_tablas' into 'main'
Dev/exponer tablas

See merge request jjimenez/safekat!271
2024-06-13 19:05:48 +00:00
324d4774f3 Arreglado bug de validaciones 2024-06-13 21:05:15 +02:00
405afd0cf1 Terminada exposicion de tablas ubicacion y series 2024-06-13 21:00:33 +02:00
b1734e169b trabajando en el form 2024-06-13 19:23:50 +02:00
02ba5d75d1 Añadidos ubicaciones y series de facturas 2024-06-13 18:58:54 +02:00
e491172b28 cambiado el obtener la lista a pedidos_linea 2024-06-11 11:11:02 +02:00
3f876a0b81 Merge branch 'dev/pedidos_v1' of https://git.imnavajas.es/jjimenez/safekat into dev/pedidos_v1 2024-06-11 11:04:33 +02:00
8aa7751060 trabajando en el form de cliente 2024-06-11 11:02:36 +02:00
22deda2aea Merge branch 'main' into 'dev/pedidos_v1'
Main

See merge request jjimenez/safekat!270
2024-06-11 06:54:06 +00:00
2143660cf6 añadidos entidades y modelos. Hecha lista de todos 2024-06-11 08:53:20 +02:00
e5004e762a Merge branch 'dev/vista_cliente' into 'main'
Configurada vista de clientes

See merge request jjimenez/safekat!269
2024-06-07 15:22:57 +00:00
720346e8e3 Configurada vista de clientes 2024-06-07 17:22:25 +02:00
bc85572610 Merge branch 'main' into 'dev/pedidos_v1'
Main

See merge request jjimenez/safekat!268
2024-06-07 14:49:05 +00:00
8815319577 Merge branch 'bug/filtros_cabecera_presu' into 'main'
ya se filtra bien

See merge request jjimenez/safekat!267
2024-06-07 14:47:54 +00:00
38abbe22a7 ya se filtra bien 2024-06-07 16:47:11 +02:00
aac17468c3 Merge branch 'mod/presu_cliente' into 'main'
Mod/presu cliente

See merge request jjimenez/safekat!266
2024-06-07 13:36:18 +00:00
94cf67a47f Arreglado bug del lomo cubierta 2024-06-07 13:10:32 +02:00
120e46f994 Falta lomo 2024-06-06 19:55:51 +02:00
af6780b36c Merge branch 'bug/siguiente_presu_cliente' into 'main'
Bug/siguiente presu cliente

See merge request jjimenez/safekat!265
2024-06-06 10:22:56 +00:00
d2f5b77f16 Corregido bug 2024-06-06 12:22:32 +02:00
db3ada3830 modificando las cosas 2024-06-06 12:00:44 +02:00
552ef89cd7 Merge branch 'main' into 'dev/pedidos_v1'
Main

See merge request jjimenez/safekat!264
2024-06-05 14:13:23 +00:00
5ee6a2c97e Merge branch 'dev/anadir_ficheros_presu' into 'main'
Dev/anadir ficheros presu

See merge request jjimenez/safekat!263
2024-06-05 09:47:51 +00:00
dd65b1fd88 Merge branch 'main' into 'dev/anadir_ficheros_presu'
Main

See merge request jjimenez/safekat!262
2024-06-05 09:47:04 +00:00
96a1faf97a Delete xdebug.log 2024-06-05 09:46:39 +00:00
673a903c75 Delete xdebug.log 2024-06-05 09:43:43 +00:00
c588936f00 modificado gitignore 2024-06-05 11:38:55 +02:00
1453140005 terminado dropzone 2024-06-05 11:35:29 +02:00
7e68ec5948 Añadido clase intranet para exponer archivos detras del root_path 2024-06-04 23:10:10 +02:00
7e878c00b2 falta cargar thumbail y preview 2024-06-04 20:05:12 +02:00
51d4f988cc queda preview y cargar ficheros del server 2024-06-04 15:16:32 +02:00
78126f6549 falta backend meter en bbdd y borrar antiguos 2024-06-03 17:34:38 +02:00
8833999e8d trabajando en el dropzone 2 2024-06-03 15:33:51 +02:00
b4bddaea6a Actualizacion automatica: 2024-06-03 13:40:32 2024-06-03 13:40:34 +02:00
9ee559fd2f Merge branch 'dev/clientes_lista_soporte' into 'main'
añadida busqueda correcta de persona de soporte en clientes

See merge request jjimenez/safekat!260
2024-06-03 10:15:32 +00:00
3151d95ec2 añadida busqueda correcta de persona de soporte en clientes 2024-06-03 12:14:52 +02:00
234006783c trabajando en dropzone 2024-06-03 12:01:40 +02:00
1146929beb Merge branch 'bug/cliente_error' into 'main'
resuelto problema de la tabla de precios y añadida lista a los comerciales

See merge request jjimenez/safekat!259
2024-06-02 17:56:21 +00:00
1d969e5c9f resuelto problema de la tabla de precios y añadida lista a los comerciales 2024-06-02 19:55:38 +02:00
ce753ef926 Merge branch 'bug/new_user' into 'main'
ya se pueden añadir usuarios

See merge request jjimenez/safekat!258
2024-06-02 17:12:16 +00:00
42b213922c ya se pueden añadir usuarios 2024-06-02 19:11:30 +02:00
3119005688 Merge branch 'bug/tamanio_personalizado' into 'main'
arreglado bug de tamanio personalizado y presupuesto solo a color

See merge request jjimenez/safekat!257
2024-05-23 14:33:25 +00:00
84e1bc8d27 arreglado bug de tamanio personalizado y presupuesto solo a color 2024-05-23 16:32:25 +02:00
0b5741de7c Merge branch 'func/copiar_tarifas_encuadernacion' into 'main'
creada funcion en controlador de Test para clonar tarifas de encuadernacion existentes

See merge request jjimenez/safekat!256
2024-05-23 13:42:25 +00:00
56c828f387 creada funcion en controlador de Test para clonar tarifas de encuadernacion existentes 2024-05-23 15:41:10 +02:00
ef2649c3fd Merge branch 'bug/guardas_cliente' into 'main'
arraglados algunos bugs

See merge request jjimenez/safekat!255
2024-05-22 15:15:47 +00:00
9e0ff7501e arraglados algunos bugs 2024-05-22 17:14:49 +02:00
9a98ffd6e6 Merge branch 'bug/add-presu-cliente' into 'main'
Bug/add presu cliente

See merge request jjimenez/safekat!254
2024-05-22 14:30:59 +00:00
667a2ab679 reparados bugs 2024-05-22 16:30:05 +02:00
e4f6295597 reparando bugs 2024-05-22 16:22:55 +02:00
1063c95fc0 Merge branch 'dev/editar_presu_cliente' into 'main'
Dev/editar presu cliente

See merge request jjimenez/safekat!253
2024-05-22 13:07:15 +00:00
b036e2ce32 adaptado el preview a presupuestos confirmados 2024-05-22 15:06:19 +02:00
a3962da518 Merge branch 'main' into 'dev/editar_presu_cliente'
Main

See merge request jjimenez/safekat!252
2024-05-22 11:26:57 +00:00
e2c8cb0f7c arreglando resumen 2024-05-22 13:26:36 +02:00
3d80216780 terminado editar cliente 2024-05-22 13:22:14 +02:00
d205fb7c6b Merge branch 'dev/preview' into 'main'
Dev/preview

See merge request jjimenez/safekat!251
2024-05-22 09:39:12 +00:00
7ad551238d Terminado previews listos para verificar por cliente 2024-05-22 11:28:56 +02:00
889ad57adc Actualizacion automatica: 2024-05-22 09:24:56 2024-05-22 09:24:57 +02:00
44c5595173 terminado a falta del resumen 2024-05-21 20:43:47 +02:00
77c284c9b4 finalizando el edit 2024-05-21 17:33:10 +02:00
2364edb684 Actualizacion automatica: 2024-05-21 15:49:10 2024-05-21 15:49:11 +02:00
3cb756a42f Añadiendo preview thumbnail y detalles 2024-05-20 22:45:11 +02:00
8b1114dc7f hay que corregir el checkeo de lineas con las paginas 2024-05-20 21:20:09 +02:00
75df199c5d trabajando en edit 2024-05-20 16:18:54 +02:00
5d80eacb3f Merge branch 'dev/default_permisos' into 'main'
Merge branch 'main' into 'dev/default_permisos'

See merge request jjimenez/safekat!249
2024-05-19 18:37:40 +00:00
6d31cbe33e Merge branch 'main' into 'dev/default_permisos'
Main

See merge request jjimenez/safekat!248
2024-05-19 18:36:18 +00:00
0ac3414a95 Merge branch 'dev/añadir_palets_cajas' into 'main'
Dev/añadir palets cajas

See merge request jjimenez/safekat!247
2024-05-19 18:34:52 +00:00
e3e21d2b1e trabajando en editar y rellenar el presupuesto 2024-05-19 20:33:20 +02:00
79d89b9718 trabajando en el editar 2024-05-18 21:13:58 +02:00
1741d6cd60 terminado añadir presupuesto a falta de volver en el botón 2024-05-18 12:07:30 +02:00
6c748a8a2d haciendo pruebas 2024-05-18 10:19:25 +02:00
efa327fb48 Merge branch 'bug/presupuesto_cliente' into 'dev/añadir_palets_cajas'
Bug/presupuesto cliente

See merge request jjimenez/safekat!246
2024-05-17 09:27:48 +00:00
b110fd063c falta guardar tiradas 2024-05-16 14:52:18 +02:00
fdb1fe77db trabajando en guardar presupuesto 2024-05-14 17:39:28 +02:00
0c78f0af7a añadida entrega a pie de calle y lomo_cubierta 2024-05-13 14:00:43 +02:00
4a12aad3dc Merge branch 'bug/presupuesto_cliente' into 'dev/añadir_palets_cajas'
Integrando preview de cliente

See merge request jjimenez/safekat!243
2024-05-13 08:22:28 +00:00
745474a37f cambio en dim máximo cubierta y expuesto lomo 2024-05-13 10:22:03 +02:00
2958 changed files with 162499 additions and 563779 deletions

42
.editorconfig Normal file
View File

@ -0,0 +1,42 @@
# Indica que este es el archivo de configuración raíz
root = true
# Configuración global para todos los archivos
[*]
charset = utf-8 # Codificación UTF-8
end_of_line = lf # Saltos de línea tipo Unix (LF)
trim_trailing_whitespace = true # Eliminar espacios en blanco finales
insert_final_newline = true # Asegura una nueva línea al final del archivo
# Configuración para archivos PHP
[*.php]
indent_style = space # Usar espacios en lugar de tabulaciones
indent_size = 4 # Tamaño de indentación de 4 espacios
# Configuración para archivos JavaScript
[*.js]
indent_style = space # Usar espacios en lugar de tabulaciones
indent_size = 2 # Tamaño de indentación de 2 espacios
quote_type = single # Usar comillas simples por defecto
trim_trailing_whitespace = true # Eliminar espacios en blanco finales
# Configuración para archivos de estilos CSS
[*.css]
indent_style = space # Usar espacios en lugar de tabulaciones
indent_size = 2 # Tamaño de indentación de 2 espacios
# Configuración para archivos JSON
[*.json]
indent_style = space # Usar espacios en lugar de tabulaciones
indent_size = 2 # Tamaño de indentación de 2 espacios
# Configuración para archivos de vista (HTML y Blade)
[*.{html,blade.php}]
indent_style = space # Usar espacios en lugar de tabulaciones
indent_size = 4 # Tamaño de indentación de 4 espacios
trim_trailing_whitespace = true # Eliminar espacios en blanco finales
# Configuración para archivos Markdown
[*.md]
trim_trailing_whitespace = false # No eliminar espacios en blanco finales
insert_final_newline = false # No agregar una nueva línea al final del archivo

5
.gitignore vendored
View File

@ -1,4 +1,5 @@
ci4/.env
.vscode/
./xdebug.log
launch.json
*xdebug*.log*
ci4/app/Config/RBAC/*

44
.idea/deployment.xml generated
View File

@ -1,44 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" autoUpload="Always" serverName="SK-IMN" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
<option name="confirmBeforeUploading" value="false" />
<serverData>
<paths name="ERP-DEMO">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="SK-DEV">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="SK-IMN">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="SK-JJO">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="SK-MAIN">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
<option name="myAutoUpload" value="ALWAYS" />
</component>
</project>

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

8
.idea/modules.xml generated
View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/safekat.iml" filepath="$PROJECT_DIR$/.idea/safekat.iml" />
</modules>
</component>
</project>

74
.idea/php.xml generated
View File

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/ci4/vendor/psr/log" />
<path value="$PROJECT_DIR$/ci4/vendor/psr/container" />
<path value="$PROJECT_DIR$/ci4/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/ci4/vendor/phenx/php-svg-lib" />
<path value="$PROJECT_DIR$/ci4/vendor/phenx/php-font-lib" />
<path value="$PROJECT_DIR$/ci4/vendor/dompdf/dompdf" />
<path value="$PROJECT_DIR$/ci4/vendor/laminas/laminas-escaper" />
<path value="$PROJECT_DIR$/ci4/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/ci4/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/ci4/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/ci4/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/ci4/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/ci4/vendor/phpunit/php-invoker" />
<path value="$PROJECT_DIR$/ci4/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/ci4/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/ci4/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/ci4/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/ci4/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/ci4/vendor/composer" />
<path value="$PROJECT_DIR$/ci4/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/ci4/vendor/fakerphp/faker" />
<path value="$PROJECT_DIR$/ci4/vendor/mikey179/vfsstream" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/type" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/code-unit" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/cli-parser" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/complexity" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/lines-of-code" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/ci4/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/ci4/vendor/sabberworm/php-css-parser" />
<path value="$PROJECT_DIR$/ci4/vendor/masterminds/html5" />
<path value="$PROJECT_DIR$/ci4/vendor/codeigniter4/shield" />
<path value="$PROJECT_DIR$/ci4/vendor/codeigniter4/settings" />
<path value="$PROJECT_DIR$/ci4/vendor/codeigniter4/framework" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.2">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/ci4/vendor/autoload.php" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

10
.idea/phpunit.xml generated
View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPUnit">
<option name="directories">
<list>
<option value="$PROJECT_DIR$/ci4/tests" />
</list>
</option>
</component>
</project>

14
.idea/safekat.iml generated
View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/ci4/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/ci4/app/Config" isTestSource="false" packagePrefix="Config\" />
<sourceFolder url="file://$MODULE_DIR$/ci4/app/ThirdParty/DatatablesEditor/" isTestSource="false" packagePrefix="DataTables\" />
<sourceFolder url="file://$MODULE_DIR$/ci4/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/ci4/tests/_support" isTestSource="true" packagePrefix="Tests\Support\" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated
View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

51
.idea/webServers.xml generated
View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="b340ea2c-6cfa-4862-a020-5d4f6e482cc1" name="SK-MAIN" url="http://sk-main.imnavajas.es">
<fileTransfer host="sk-main.imnavajas.es" port="21">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
<webServer id="c01b8916-f9bb-46f4-a585-5f4f4064aa87" name="SK-IMN" url="http://sk-imn.imnavajas.es">
<fileTransfer host="sk-imn.imnavajas.es" port="21">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
<webServer id="36de594c-5db8-413e-b1a1-cd035ebed2f1" name="SK-JJO" url="http://sk-jjo.imnavajas.es">
<fileTransfer host="sk-jjo.imnavajas.es" port="21">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
<webServer id="85f139d9-24ee-421b-b3fa-c8b68aa8f4ef" name="SK-DEV" url="http://sk-dev.imnavajas.es">
<fileTransfer host="sk-dev.imnavajas.es" port="21">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
<webServer id="94314164-bdb5-40a0-a28a-8d8dc3915eed" name="ERP-DEMO" url="http://erp.safekat.es">
<fileTransfer host="erp.safekat.es" port="21">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
</option>
<groups>
<group>
<name>DEV/UI</name>
<servers>
<name value="SK-MAIN" />
<name value="SK-IMN" />
</servers>
</group>
</groups>
</component>
</project>

188
.idea/workspace.xml generated
View File

@ -1,188 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="7c8f7059-cd40-417c-936e-48dbc0507d86" name="Changes" comment="Add static Vuexy files">
<<<<<<< HEAD
<change afterPath="$PROJECT_DIR$/ci4/app/Controllers/Compras/Compras.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ci4/app/Controllers/Compras/Productos.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ci4/app/Controllers/Importacion/Importar.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/menu_impresion.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/.env" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/.env" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Catalogo/Catalogo.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Catalogo/Catalogo.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Envioslogistica/Logistica.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Envioslogistica/Logistica.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Facturacion/Factura.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Facturacion/Factura.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Pedidos/Pedido.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Pedidos/Pedido.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Produccion/Ordentrabajo.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Produccion/Ordentrabajo.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Proveedores/Proveedor.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Compras/Proveedor.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Filters/LoginAuthFilter.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Filters/LoginAuthFilter.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Language/en/App.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Language/en/App.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Language/es/App.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Language/es/App.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/settings/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/settings/index.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/all.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/all.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php" afterDir="false" />
=======
<change beforePath="$PROJECT_DIR$/.idea/webServers.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/webServers.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Language/en/Users.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Language/en/Users.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Language/es/Users.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Language/es/Users.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/paises/viewPaisForm.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/paises/viewPaisForm.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/paises/viewPaisList.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/paises/viewPaisList.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/papel/viewPapelGenericoForm.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/papel/viewPapelGenericoForm.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/papel/viewPapelImpresionForm.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/configuracion/papel/viewPapelImpresionForm.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/user/_userFormItems.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/user/_userFormItems.php" afterDir="false" />
>>>>>>> 38e9feb4c8537689e5d266a1dbe3371003d2457f
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ComposerSettings" doNotAsk="true" synchronizationState="SYNCHRONIZE">
<pharConfigPath>$PROJECT_DIR$/ci4/composer.json</pharConfigPath>
<execution />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2OsCE3jXyiqpYISC6WI6TMJusA2" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"last_opened_file_path": "C:/temp-sk/safekat/ci4/app/Views/themes/backend/vuexy/main",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "preferences.pluginManager",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\temp-sk\safekat\ci4\app\Views\themes\backend\vuexy\main" />
<recent name="C:\temp-sk\safekat\ci4\app\Views\themes\backend\vuexy\form\settings" />
<recent name="C:\temp-sk\safekat\ci4\app\Views\themes\backend\vuexy\form\profile" />
<recent name="D:\Safekat\safekat\ci4\app\Views\themes\_commonPartialsBs" />
<recent name="C:\temp-sk\safekat\httpdocs\themes\vuexy\vendor\libs\toastr" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\temp-sk\safekat\ci4\app\Controllers\Usuarios" />
<recent name="C:\temp-sk\safekat\ci4" />
<recent name="C:\temp-sk\safekat\httpdocs\themes\vuexy" />
</key>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7c8f7059-cd40-417c-936e-48dbc0507d86" name="Changes" comment="" />
<created>1682339793915</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1682339793915</updated>
<workItem from="1682339796150" duration="1274000" />
<workItem from="1682412462416" duration="9540000" />
<workItem from="1682492106609" duration="7922000" />
<workItem from="1683530628259" duration="12043000" />
<workItem from="1683618855414" duration="183000" />
<workItem from="1683619057531" duration="16014000" />
<workItem from="1683715799575" duration="151000" />
<workItem from="1683716769681" duration="8512000" />
<workItem from="1683796910193" duration="12918000" />
<workItem from="1684147458134" duration="7379000" />
<workItem from="1684221025785" duration="2261000" />
<workItem from="1684226343116" duration="4598000" />
<workItem from="1684236911941" duration="2213000" />
<workItem from="1684239429024" duration="2049000" />
<workItem from="1684313352573" duration="9284000" />
<workItem from="1684350581362" duration="2244000" />
<workItem from="1684415370137" duration="889000" />
<workItem from="1684761592479" duration="626000" />
<workItem from="1684829967827" duration="8241000" />
<workItem from="1684869825991" duration="3082000" />
<workItem from="1684910640450" duration="14817000" />
<workItem from="1685018778974" duration="1905000" />
<workItem from="1685038598644" duration="6958000" />
<workItem from="1685102978387" duration="3272000" />
<workItem from="1685266094611" duration="3469000" />
<<<<<<< HEAD
<workItem from="1685365444846" duration="191000" />
<workItem from="1685689980219" duration="12098000" />
=======
<workItem from="1685564762632" duration="2787000" />
>>>>>>> 38e9feb4c8537689e5d266a1dbe3371003d2457f
</task>
<task id="LOCAL-00001" summary="Starting Vuexy Theme creation">
<created>1682339938559</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1682339938559</updated>
</task>
<task id="LOCAL-00002" summary="Add static Vuexy files">
<created>1682420504675</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1682420504675</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="FILTERS">
<map>
<entry key="branch">
<value>
<list>
<option value="origin/dev/vuexy" />
</list>
</value>
</entry>
</map>
</option>
</State>
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value="Starting Vuexy Theme creation" />
<MESSAGE value="Add static Vuexy files" />
<option name="LAST_COMMIT_MESSAGE" value="Add static Vuexy files" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="php">
<url>file://$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/all.php</url>
<line>371</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View File

@ -1,5 +1,4 @@
{
"clockify.tracking.workspaceId": "6464949facab6237e1538c14",
"sqltools.connections": [
{
"mysqlOptions": {

22
.vscode/sftp.json vendored
View File

@ -5,18 +5,34 @@
"remotePath": "/",
"uploadOnSave": true,
"useTempFile": false,
"openSsh": false,
"openSsh": false,
"profiles": {
"jjo": {
"jjo": {
"host": "sk-jjo.imnavajas.es",
"username": "sk-jjo",
"password": "Snwi1660%"
},
"imn": {
"host": "sk-imn.imnavajas.es",
"username": "sk-imn",
"password": "GVBbgdwlvn7_p02?"
},
"dev":{
"host": "sk-dev.imnavajas.es",
"username": "sk-dev",
"password": "KXvYsubai9v*g61~"
},
"sk-prod":{
"host": "erp.safekat.es",
"username": "erp-demo",
"password": "lNkEyukTc1~*3yy9"
},
"sk-dev":{
"host": "erp-dev.safekat.es",
"username": "erp-dev",
"password": "snqyxNZIhg8m3!9~"
}
}

View File

@ -1,133 +0,0 @@
Quitar Oauth
---------------------------------------------
Quitar packete con composer que se usa en la Oauth
composer remove hybridauth/hybridauth
Tablas en la BBDD.
wg_user_oauth
wg_settings_oauth
Se hace migración (hay que añadir el controlador Migrate a whiteListController)
Modelos
UserOauthModel.php
SettingsOauthModel.php
Controllers
Oauth.php
Realizar busqueda de UserOauthModel que está en varios Controllers
Buscar la variable que crea en cada controlador y ver para que la usa
Igual que la acción anterior pero con SettingsOauthModel
Está en el controlador Settings.php. Buscar la variable que crea y borrarla
Eliminar Views\themes\backend\focus2\form\settings\oauth.php
En Views\themes\backend\focus2\main\menu.
Quitar la línea php que invoca a la configuración de Oauth (site_url("settings/oauth"))
En Views\themes\frontend\tivo\main\menu.php
Quitar la línea php que invoca a la configuración de Oauth (site_url("settings/oauth"))
En en controlador Settings.php
Quitar las funciones oauth() y oauth_store()
En los idiomas quitar la key dashboard_chart_auth
En la vista quitar la carta de Solcial autenthification
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title"><?=lang("App.dashboard_chart_auth")?></h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12" id="ct-icon-chart"></div>
</div>
<div class="row">
<div class="col-lg-12"><div class="ct-pie-chart"></div></div>
</div>
</div>
</div>
</div>
Quitar los SMS
--------------------------------------------
Quitar packete con composer que se usa en la Oauth
twilio/sdk
Dentro de Controllers\Integration.php
Eliminar sendSMS (public y private)
Se hace migración de la BBDD
Del controlador Cron.php se elimina
la accion // Cron Notification SMS
la función test()
Del controlador Ajax.php
linea 368, quitar is_send_sms de la lista
linea 399, eliminar "is_send_sms"=>$record['is_send_sms'],
Del controlador Login.php eliminar
//Notification SMS User Welcome
//SMS Account Confirmation
Dentro de //Notification New Register, las dos líneas is_send_sms y send_sms_notification
linea 455 if($settings['send_sms_register']??false){ quitar if completo
Del controlador Notification.php
linea 117 , 148, 150
Del controlador Settings.php
linea 106, 109
De los idiomas, quitar los registros
settings_field_send_sms_register
notification_field_send_sms
Del modelo NotificationModel.php
Quitar los fields is_send_sms y send_sms_notification
Del modelo SettingsModel.php
Quitar los fields send_sms_register y send_sms_welcome
sms_gateway, sms_account_id, ,sms_auth_token, sms_info_add, sms_confirmation
De la vista Views\themes\backend\focus2\form\notification\form quitar
<div class="col-md-3">
<div class="form-group">
<label class="text-dark"><?=lang("App.notification_field_send_sms")?></label>
<div class="custom-control custom-switch">
<input type="checkbox" id="send_sms_notification" name="send_sms_notification" class="custom-control-input" <?= $obj['send_sms_notification']??false ? 'checked' : ''?>>
<label for="send_sms_notification" class="custom-control-label"><?=lang("App.notification_field_send_label")?></label>
</div>
</div>
</div>
De la vista Views\themes\backend\focus2\form\notification\index.php quitar de la linea 129 { data: 'is_send_sms' },
De la vista Views\themes\backend\focus2\form\settings\index.php quitar los siguientes bloques
<div class="col-lg-3">
<div class="form-group">
<label class="text-dark"><?=lang("App.settings_field_send_welcome_message_sms")?></label>
<div class="custom-control custom-switch">
<input type="checkbox" id="send_sms_welcome" name="send_sms_welcome" class="custom-control-input" <?= $obj['send_sms_welcome']??false ? 'checked' : ''?>>
<label for="send_sms_welcome" class="custom-control-label"><?=lang("App.global_activate")?></label>
</div>
</div>
</div>
y
<div class="col-lg-3">
<div class="form-group">
<label class="text-dark"><?=lang("App.settings_field_send_sms_register")?></label>
<div class="custom-control custom-switch">
<input type="checkbox" id="send_sms_register" name="send_sms_register" class="custom-control-input" <?= $obj['send_sms_register']??false ? 'checked' : ''?>>
<label for="send_sms_register" class="custom-control-label"><?=lang("App.global_activate")?></label>
</div>
</div>
</div>
En el controlador Ajax.php quitar if($records[$key]['sms_confirmed'] == 1)
En el controlador Login.php quitar
bloque // Check sms confirmed
if($confirmation['type'] == 'sms')
En el controlador Settings.php quitar
linea 104
case 'sms;
En el controlador User.php quitar linea 217 y 236
Del modelo UserModel.php quitar el campo sms_confirmed
En los idiomas buscar la key sms
En la vista Views\themes\backend\focus2\form\notification\index.php quitar linea 49
En la vista Views\themes\backend\focus2\form\settings\index.php quitar
linea 37
bloque en linea 298
linea 355
bloque en linea 679
linea 1033
En la vista Views\themes\backend\focus2\form\settings\template.php
bloque linea 87 hasta 131
En la vista Views\themes\backend\focus2\form\user\form.php
bloque linea 104 hasta 113
linea 210
Renombrar tablas a auth_ en lugar de wg_
-------------------------------------------------
La tabla wg_migrations hay que modificarla a mano.
En .env quitar el prefijo: database.default.DBPrefix =
En todos los modelos añadir auth_ al principio del nombre de la tabla

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
<?php
namespace App\Commands;
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
use Config\Database;
use App\Models\Catalogo\IdentificadorIsknModel;
class CatalogoLibroAsignarIskn extends BaseCommand
{
protected $group = 'Safekat';
protected $name = 'catalogo:libro-asignar-iskn';
protected $description = 'Asigna ISKN directamente en la base de datos a los libros que no lo tienen.';
public function run(array $params)
{
$db = Database::connect();
$modelISKN = new IdentificadorIsknModel();
// Obtener todos los libros sin ISKN
$libros = $db->table('catalogo_libros')
->select('id')
->where('iskn IS NULL')
->where('deleted_at IS NULL')
->get()
->getResultArray();
if (empty($libros)) {
CLI::write('No hay libros sin ISKN por asignar.', 'green');
return;
}
CLI::write('Asignando ISKN a ' . count($libros) . ' libros...', 'yellow');
$i = 1;
foreach ($libros as $libro) {
$iskn = $modelISKN->newIskn();
if ($iskn !== null) {
$db->table('catalogo_libros')
->where('id', $libro['id'])
->update(['iskn' => $iskn]);
CLI::write("[{$i}] ISKN '{$iskn}' asignado a libro ID {$libro['id']}", 'cyan');
} else {
CLI::error("[{$i}] No se pudo generar ISKN para libro ID {$libro['id']}");
}
$i++;
}
CLI::write('Proceso finalizado.', 'green');
}
}

View File

@ -0,0 +1,204 @@
<?php
namespace App\Commands;
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
class CatalogoLibroImportar extends BaseCommand
{
protected $group = 'Safekat';
protected $name = 'catalogo:libro-importar';
protected $description = 'Importa los registros de catalogo_libro a catalogo_libros para un customer_id dado';
public function run(array $params)
{
$db = \Config\Database::connect();
$totalImportados = 0;
// Al inicio del método run()
$papeles = $db->table('lg_papel_generico')
->select('id, code')
->where('is_deleted', 0)
->get()
->getResultArray();
// Mapa code => id
$papelMap = [];
foreach ($papeles as $p) {
if (!empty($p['code'])) {
$papelMap[trim($p['code'])] = $p['id'];
}
}
// Mapa de acabados => id
$acabadosMap = [
'plastificado_brillo' => 1,
'plastificado_mate' => 5,
];
// Mapa de encuadernaciones => id
$encuadernacionMap = [
'RCHV' => 4, // cosido tapa blanda
'RCHVS' => 20, // cosido tapa blanda solapas
'RDF' => 1, // fresado tapa dura
'RF' => 2, // fresado tapa blanda
'RFS' => 2, // fresado tapa blanda solapas
'TDC' => 3, // cosido tapa dura
];
if (empty($params[0]) || !is_numeric($params[0])) {
CLI::error('Debes proporcionar un customer_id válido como parámetro.');
return;
}
$customerId = (int) $params[0];
CLI::write("Iniciando importación para customer_id = $customerId ...", 'yellow');
$libros = $db->table('catalogo_libro_antiguo_erp')
->where('customer_id', $customerId)
->where('deleted_at', null)
->get()
->getResultArray();
if (empty($libros)) {
CLI::write('No se encontraron registros para importar.', 'red');
return;
}
foreach ($libros as $libro) {
$nuevoLibro = [
'id' => $libro['id'],
'cliente_id' => $libro['customer_id'],
'proveedor_id' => null,
'user_created_id' => 1,
'user_update_id' => 1,
'cubierta_archivo' => $libro['cover_file'],
'cubierta_url' => $libro['cover_url'],
'ancho' => $libro['ancho'],
'alto' => $libro['alto'],
'peso' => $libro['peso'],
'titulo' => $libro['titulo'],
'autor' => $libro['autor'] ?? null,
'autor_entidad' => $libro['autor_entidad'],
'traductor' => $libro['traductor'],
'ilustrador' => $libro['ilustrador'],
'idioma' => $libro['idioma'],
'num_edic' => $libro['num_edic'],
'fecha_disponibilidad' => $libro['fecha_disponibilidad'],
'fecha_public' => $libro['fecha_public'],
'num_fotos' => $libro['num_fotos'],
'num_ilustr' => $libro['num_ilustr'],
'num_ilustr_color' => $libro['num_ilustr_color'],
'num_ilustr_bn' => $libro['num_ilustr_bn'],
'coleccion' => $libro['coleccion'] ?? null,
'isbn' => $libro['isbn'],
'ean' => $this->generarEAN($libro['isbn']),
'editorial' => $libro['editorial'],
'resumen' => $libro['resumen'],
'resumen_breve' => $libro['resumen_breve'],
'sello' => $libro['sello'],
'paginas' => $libro['paginas'],
'tipo_impresion' => $this->mapTipoImpresion($libro['tipo_impresion']),
'comentarios' => $libro['comentarios'],
'negro_paginas' => $libro['negro_paginas'],
'negro_papel_id' => $this->getPapelId($libro['negro_papel'], $papelMap),
'negro_gramaje' => $libro['negro_gramaje'],
'negro_pod_papel_id' => $this->getPapelId($libro['negro_papel'], $papelMap),
'negro_pod_gramaje' => $libro['negro_gramaje'],
'color_paginas' => $libro['color_paginas'],
'color_papel_id' => $this->getPapelId($libro['color_papel'], $papelMap),
'color_gramaje' => $libro['color_gramaje'],
'color_pod_papel_id' => $this->getPapelId($libro['color_papel'], $papelMap),
'color_pod_gramaje' => $libro['color_gramaje'],
'cubierta_paginas' => $libro['portada_paginas'],
'cubierta_papel_id' => $this->getPapelId($libro['portada_papel'], $papelMap),
'cubierta_gramaje' => $libro['portada_gramaje'],
'cubierta_pod_papel_id' => $this->getPapelId($libro['portada_papel'], $papelMap),
'cubierta_pod_gramaje' => $libro['portada_gramaje'],
'cubierta_acabado_id' => $this->getAcabadoId($libro['portada_acabado'], $acabadosMap),
'cubierta_ancho_solapas' => $libro['solapas_ancho'],
'sobrecubierta_paginas' => $libro['cubierta_paginas'],
'sobrecubierta_papel_id' => $this->getPapelId($libro['cubierta_papel'], $papelMap),
'sobrecubierta_gramaje' => $libro['cubierta_gramaje'],
'sobrecubierta_pod_papel_id' => $this->getPapelId($libro['cubierta_papel'], $papelMap),
'sobrecubierta_pod_gramaje' => $libro['cubierta_gramaje'],
'sobrecubierta_acabado_id' => $this->getAcabadoId($libro['cubierta_acabado'], $acabadosMap),
'sobrecubierta_ancho_solapas' => 0,
'encuadernacion_id' => $this->getEncuadernacionId($libro['encuardenacion'], $encuadernacionMap),
'ubicacion' => $libro['ubicacion'],
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
'deleted_at' => $libro['deleted_at'],
'iskn' => null,
];
$exists = $db->table('catalogo_libros')
->where('id', $libro['id'])
->countAllResults();
if ($exists == 0) {
$db->table('catalogo_libros')->insert($nuevoLibro);
$totalImportados++;
}else{
CLI::write("El libro con ISBN " . $libro['isbn'] . " ya existe para el cliente con id " . $customerId . ".", 'yellow');
}
}
CLI::write("Importación finalizada. Se insertaron " . $totalImportados . " registros.", 'green');
}
private function mapTipoImpresion($tipo)
{
switch ($tipo) {
case 'bn':
return 'negro';
case 'color':
return 'color';
case 'colorfoto':
return 'colorhq';
case 'bicolor':
return 'color';
default:
return null;
}
}
private function getPapelId(?string $code, array $map): ?int
{
if ($code === null)
return null;
$code = trim($code);
return $map[$code] ?? null;
}
private function getAcabadoId(?string $nombre, array $map): ?int
{
if ($nombre === null)
return null;
$nombre = trim($nombre);
return $map[$nombre] ?? null;
}
private function getEncuadernacionId(?string $codigo, array $map): ?int
{
if ($codigo === null)
return null;
$codigo = trim($codigo);
return $map[$codigo] ?? null;
}
private function generarEAN(?string $isbn): ?string
{
if ($isbn === null)
return null;
return str_replace('-', '', $isbn);
}
}

View File

@ -0,0 +1,93 @@
<?php
namespace App\Commands;
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
use ZipArchive;
class RestoreBackup extends BaseCommand
{
protected $group = 'Safekat';
protected $name = 'restore:backup';
protected $description = 'Restaura un backup desde un archivo .zip en writable/backups/.';
protected $usage = 'restore:backup [--dry-run]';
protected $options = [
'--dry-run' => 'Simula el proceso de restauración sin ejecutarlo realmente.',
];
public function run(array $params)
{
$isDryRun = CLI::getOption('dry-run');
$backupDir = WRITEPATH . 'backups/';
$backups = glob($backupDir . '*.zip');
if (empty($backups)) {
CLI::error("No se encontraron backups .zip en: $backupDir");
return;
}
CLI::write("Backups disponibles:", 'blue');
foreach ($backups as $i => $file) {
CLI::write("[" . ($i + 1) . "] " . basename($file));
}
$index = CLI::prompt("Selecciona el número del backup a restaurar", null, 'required');
if (!is_numeric($index) || $index < 1 || $index > count($backups)) {
CLI::error("Selección no válida.");
return;
}
$selectedFile = $backups[$index - 1];
CLI::write("🎯 Seleccionado: " . basename($selectedFile), 'cyan');
if ($isDryRun) {
CLI::write("🔍 Modo simulación activado (--dry-run)", 'yellow');
}
$zip = new ZipArchive();
if ($zip->open($selectedFile) !== TRUE) {
CLI::error("No se pudo abrir el archivo ZIP.");
return;
}
$extractPath = WRITEPATH . 'backups/tmp_restore/';
if (!is_dir($extractPath)) {
mkdir($extractPath, 0775, true);
}
$zip->extractTo($extractPath);
$zip->close();
$sqlFiles = glob($extractPath . '*.sql');
if (count($sqlFiles) === 0) {
CLI::error("No se encontró ningún .sql dentro del backup.");
return;
}
$sqlFile = escapeshellarg($sqlFiles[0]);
$db = config('Database')->default;
$cmd = "mysql -h {$db['hostname']} -u {$db['username']} -p'{$db['password']}' {$db['database']} < {$sqlFile}";
if ($isDryRun) {
CLI::write("📋 Comando que se ejecutaría:", 'yellow');
CLI::write($cmd, 'light_gray');
CLI::write("✅ Simulación completa. No se hizo ninguna modificación.", 'green');
} else {
CLI::write("⏳ Restaurando...", 'yellow');
system($cmd, $retval);
if ($retval !== 0) {
CLI::error("❌ Error al restaurar la base de datos (código $retval).");
} else {
CLI::write("✅ Backup restaurado correctamente.", 'green');
}
}
array_map('unlink', glob($extractPath . '*'));
rmdir($extractPath);
}
}

19
ci4/app/Config/Auth.php Normal file → Executable file
View File

@ -13,7 +13,8 @@ declare(strict_types=1);
namespace Config;
use App\Models\UserModel;
use App\Models\Usuarios\UserModel;
use CodeIgniter\Shield\Authentication\Authenticators\JWT;
use CodeIgniter\Shield\Authentication\Passwords\ValidationRules;
use CodeIgniter\Shield\Config\Auth as ShieldAuth;
use CodeIgniter\Shield\Authentication\Actions\ActionInterface;
@ -117,7 +118,7 @@ class Auth extends ShieldAuth
'tokens' => AccessTokens::class,
'session' => Session::class,
'hmac' => HmacSha256::class,
// 'jwt' => JWT::class,
'jwt' => JWT::class,
];
/**
@ -144,7 +145,7 @@ class Auth extends ShieldAuth
'session',
'tokens',
'hmac',
// 'jwt',
'jwt',
];
/**
@ -153,7 +154,7 @@ class Auth extends ShieldAuth
* --------------------------------------------------------------------
* Determines whether users can register for the site.
*/
public bool $allowRegistration = true;
public bool $allowRegistration = false;
/**
* --------------------------------------------------------------------
@ -438,8 +439,14 @@ class Auth extends ShieldAuth
public function loginRedirect(): string
{
$session = session();
$url = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login'];
$url = setting('Auth.redirects')['login'];
if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])){
if($_SERVER['HTTP_X_REQUESTED_WITH'] == "xmlhttprequest"){
$url = setting('Auth.redirects')['login'];
}
}else{
$url = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login'];
}
return $this->getUrl($url);
}

0
ci4/app/Config/AuthGroups.php Normal file → Executable file
View File

96
ci4/app/Config/AuthJWT.php Executable file
View File

@ -0,0 +1,96 @@
<?php
declare(strict_types=1);
/**
* This file is part of CodeIgniter Shield.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Config;
use CodeIgniter\Shield\Config\AuthJWT as ShieldAuthJWT;
/**
* JWT Authenticator Configuration
*/
class AuthJWT extends ShieldAuthJWT
{
/**
* --------------------------------------------------------------------
* Name of Authenticator Header
* --------------------------------------------------------------------
* The name of Header that the Authorization token should be found.
* According to the specs, this should be `Authorization`, but rare
* circumstances might need a different header.
*/
public string $authenticatorHeader = 'Authorization';
/**
* --------------------------------------------------------------------
* The Default Payload Items
* --------------------------------------------------------------------
* All JWTs will have these claims in the payload.
*
* @var array<string, string>
*/
public array $defaultClaims = [
'iss' => 'https://safekat.com',
];
/**
* --------------------------------------------------------------------
* The Keys
* --------------------------------------------------------------------
* The key of the array is the key group name.
* The first key of the group is used for signing.
*
* @var array<string, array<int, array<string, string>>>
* @phpstan-var array<string, list<array<string, string>>>
*/
public array $keys = [
'default' => [
// Symmetric Key
[
'kid' => '', // Key ID. Optional if you have only one key.
'alg' => 'HS256', // algorithm.
// Set secret random string. Needs at least 256 bits for HS256 algorithm.
// E.g., $ php -r 'echo base64_encode(random_bytes(32));'
'secret' => 'ZAfosrIVWDaKEhBhicTKCpW8T5ZxC3GYAxFgCkUQjlU=',
],
// Asymmetric Key
// [
// 'kid' => '', // Key ID. Optional if you have only one key.
// 'alg' => 'RS256', // algorithm.
// 'public' => '', // Public Key
// 'private' => '', // Private Key
// 'passphrase' => '' // Passphrase
// ],
],
];
/**
* --------------------------------------------------------------------
* Time To Live (in seconds)
* --------------------------------------------------------------------
* Specifies the amount of time, in seconds, that a token is valid.
*/
public int $timeToLive = HOUR;
/**
* --------------------------------------------------------------------
* Record Login Attempts
* --------------------------------------------------------------------
* Whether login attempts are recorded in the database.
*
* Valid values are:
* - Auth::RECORD_LOGIN_ATTEMPT_NONE
* - Auth::RECORD_LOGIN_ATTEMPT_FAILURE
* - Auth::RECORD_LOGIN_ATTEMPT_ALL
*/
public int $recordLoginAttempt = Auth::RECORD_LOGIN_ATTEMPT_FAILURE;
}

0
ci4/app/Config/AuthToken.php Normal file → Executable file
View File

View File

@ -46,6 +46,7 @@ class Autoload extends AutoloadConfig
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
'Libraries' => APPPATH . 'Libraries',
'Dompdf' => APPPATH . 'ThirdParty/dompdf/src',
];

0
ci4/app/Config/CURLRequest.php Normal file → Executable file
View File

View File

@ -71,6 +71,32 @@ class Database extends Config
'busyTimeout' => 1000,
];
public array $old_erp = [
'DSN' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => true,
'charset' => 'utf8mb4',
'DBCollat' => 'utf8mb4_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
'numberNative' => false,
'dateFormat' => [
'date' => 'Y-m-d',
'datetime' => 'Y-m-d H:i:s',
'time' => 'H:i:s',
],
];
public function __construct()
{
parent::__construct();

View File

@ -6,14 +6,14 @@ use CodeIgniter\Config\BaseConfig;
class Email extends BaseConfig
{
public string $fromEmail = 'safekat@imnavajas.es';
public string $fromName = 'Safekat ERP';
public string $fromEmail = 'no-reply@safekat.es';
public string $fromName = 'ERP Safekat 2.0';
public string $recipients = '';
/**
* The "user agent"
*/
public string $userAgent = 'Safekat SL';
public string $userAgent = 'ERP Safekat 2.0';
/**
* The mail sending protocol: mail, sendmail, smtp
@ -28,27 +28,27 @@ class Email extends BaseConfig
/**
* SMTP Server Hostname
*/
public string $SMTPHost = 'imnavajas.es';
public string $SMTPHost = 'smtp.ionos.es';
/**
* SMTP Username
*/
public string $SMTPUser = 'safekat@imnavajas.es';
public string $SMTPUser = 'no-reply@safekat.es';
/**
* SMTP Password
*/
public string $SMTPPass = 'Etkd9~448';
public string $SMTPPass = '5LKHH^CR#ecR#l55x7ke';
/**
* SMTP Port
*/
public int $SMTPPort = 25;
public int $SMTPPort = 587;
/**
* SMTP Timeout (in seconds)
*/
public int $SMTPTimeout = 5;
public int $SMTPTimeout = 15;
/**
* Enable persistent SMTP connections

0
ci4/app/Config/Feature.php Normal file → Executable file
View File

View File

@ -8,6 +8,7 @@ use CodeIgniter\Filters\DebugToolbar;
use CodeIgniter\Filters\Honeypot;
use CodeIgniter\Filters\InvalidChars;
use CodeIgniter\Filters\SecureHeaders;
use CodeIgniter\Shield\Authentication\Authenticators\JWT;
class Filters extends BaseConfig
@ -25,6 +26,7 @@ class Filters extends BaseConfig
'honeypot' => Honeypot::class,
'invalidchars' => InvalidChars::class,
'secureheaders' => SecureHeaders::class,
'cors' => \App\Filters\Cors::class
];
/**
@ -43,6 +45,8 @@ class Filters extends BaseConfig
'login*',
'register',
'auth/a/*',
'auth/jwt',
'api/*',
'logout']
],
],
@ -73,5 +77,10 @@ class Filters extends BaseConfig
* Example:
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
*/
public array $filters = [];
public array $filters = [
/*'jwt' => [
'before' => ['api', 'api/*']
],*/
];
}

2
ci4/app/Config/Kint.php Normal file → Executable file
View File

@ -42,7 +42,7 @@ class Kint extends BaseConfig
*/
public string $richTheme = 'aante-light.css';
public bool $richFolder = false;
public int $richSort = AbstractRenderer::SORT_FULL;
public int $richSort = 0; //AbstractRenderer::SORT_FULL;
/**
* @var array<string, class-string<ValuePluginInterface>>|null

View File

@ -0,0 +1,31 @@
<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
class LogoImpresion extends BaseConfig
{
public array $TIPO_IMPRESION_MAPPING = [
"lp_bn" => "icon_bn",
"lp_bnhq" => "icon_bnhq",
"lp_color" => "icon_color",
"lp_colorhq" => "icon_colorhq",
"lp_cubierta" => "icon_cubierta",
"lp_sobrecubierta" => "icon_sobrecubierta",
"lp_rot_bn" => "icon_rotativa_bn",
"lp_rot_color" => "icon_rotativa_color",
"lp_guardas" => "icon_cuardas"
];
public function __construct()
{
parent::__construct();
}
public function get_logo_path(string $tipo): string
{
return "themes/vuexy/img/safekat/presupuestos/" . $this->TIPO_IMPRESION_MAPPING[$tipo] . ".png";
}
}

138
ci4/app/Config/OrdenTrabajo.php Executable file
View File

@ -0,0 +1,138 @@
<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
class OrdenTrabajo extends BaseConfig
{
public array $DATE_USER_MAPPING = [
//IMPRESION
"interior_bn_at" => "interior_bn_user_id",
"interior_color_at" => "interior_color_user_id",
"cubierta_at" => "cubierta_user_id",
"sobrecubierta_at" => "sobrecubierta_user_id",
"guarda_at" => "guarda_user_id",
//ACABADO
"plastificado_at" => "plastificado_user_id",
"plakene_at" => "plakene_user_id",
"retractilado_at" => "retractilado_user_id",
"estampado_at" => "estampado_user_id",
"uvi_at" => "uvi_user_id",
"encuadernacion_at" => "encuadernacion_user_id",
"corte_at" => "corte_user_id",
"preparacion_interiores_at" => "preparacion_interior_user_id",
"entrada_manipulado_at" => "entrada_manipulado_user_id",
"cosido_at" => "cosido_user_id",
"grapado_at" => "grapado_user_id",
"solapa_at" => "solapa_user_id",
"retractilado5_at" => "retractilado5_user_id",
"prototipo_at" => "prototipo_user_id",
"marcapaginas_at" => "marcapaginas_user_id",
"espiral_at" => "espiral_user_id",
//FERRO
"pendiente_ferro_at" => "pendiente_ferro_user_id",
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
"ferro_ok_at" => "ferro_ok_user_id",
//ENVIO
"embalaje_at" => "embalaje_user_id",
"envio_at" => "envio_user_id",
//PREIMPRESION
"pre_formato_at" => "pre_formato_user_id",
"pre_lomo_at" => "pre_lomo_user_id",
"pre_solapa_at" => "pre_solapa_user_id",
"pre_codbarras_at" => "pre_codbarras_user_id",
"pre_imposicion_at" => "pre_imposicion_user_id",
];
public array $DATE_USER_MAPPING_PEDIDO = [
"inaplazable" => "inaplazable_change_user_id",
"fecha_entrega_real" => "fecha_entrega_real_change_user_id",
"fecha_impresion" => "fecha_impresion_change_user_id",
"fecha_encuadernado" => "fecha_encuadernado_change_user_id",
"fecha_entrega_externo" => "fecha_entrega_externo_change_user_id",
];
public array $OT_COLORS = [
"sin_imprimir" => "#FF6363",
"impreso_int" => "#AFDDFF",
"impreso_cub" => "#3A59D1",
"plastificado" => "#FFD63A",
"preparado" => "#FF0B55",
"solapa" => "#4F1C51",
"cosido" => "#FF0B55",
"grapado" => "#FEBA17",
"encuadernado" => "#FEBA17",
"corte" => "#67AE6E"
];
public array $OT_WEEK_COLOR_DAY = [
["bg" => "#FFFFFF", "color" => "black"],
["bg" => "yellow", "color" => "black"],
["bg" => "purple", "color" => "white"],
["bg" => "orange", "color" => "white"],
["bg" => "blue", "color" => "white"],
["bg" => "pink", "color" => "black"],
["bg" => "#FFFFFF", "color" => "black"],
];
public array $OT_ENCUADERNACION_COLOR = [
"RF" => ["bg" => "#FF9900", "color" => "white"],
"RFS" => ["bg" => "#FF9900", "color" => "white"],
"RCHV" => ["bg" => "#FF9900", "color" => "blue"],
"RCHVS" => ["bg" => "#FF9900", "color" => "blue"],
"CC2" => ["bg" => "#104861", "color" => "yellow"],
"CC2S" => ["bg" => "#104861", "color" => "yellow"],
"TDF" => ["bg" => "#E49EDD", "color" => "white"],
"TDC" => ["bg" => "#E49EDD", "color" => "blue"],
"default" => ["bg" => "#FFFF00", "color" => "red"],
];
public array $OT_BACKGROUND_COLOR = [
"ferro_digital" => ["bg" => "#BFBFBF","color" => "black"],
"ferro" => ["bg" => "#BFBFBF","color" => "black"],
"prototipo" => ["bg" => "#BFBFBF","color" => "black"],
"pod" => ["bg" => "#47D359","color" => "black"],
"inaplazable" => ["bg" => "red","color" => "white"],
"default" => ["bg" => "#FFFFFF","color" => "black"]
];
public array $OT_PAPEL_COLOR =
[
"blanco" => ["bg" => "#FFFFFF", "color" => "black"],
"ahuesado" => ["bg" => "#FFF2CC", "color" => "black"],
"marfil" => ["bg" => "#FFD966", "color" => "black"],
"volumen_ahuesado" => ["bg" => "#BF8F00", "color" => "black"],
"estucado_mate" => ["bg" => "#BDD7EE", "color" => "black"],
"cartulina" => ["bg" => "#C6E0B4", "color" => "black"],
"default" => ["bg" => "#FFCCFF", "color" => "black"],
];
public array $OT_PLASTIFICADO_COLOR =
[
"BRILLO" => ["bg" => "#00B0F0", "color" => "white"],
"MATE" => ["bg" => "#FF0000", "color" => "white"],
"SOFT" => ["bg" => "#00B050", "color" => "white"],
"SANDY" => ["bg" => "#782170", "color" => "white"],
"ANTIRAYADO" => ["bg" => "#E97132", "color" => "white"],
"GOFRADO" => ["bg" => "#FFFF00", "color" => "black"],
"default" => ["bg" => "#FFFFFF", "color" => "black"],
];
public array $OT_IMPRESION_INTERIOR_PPAL_COLOR =
[
"ROTATIVA" => ["bg" => "white", "color" => "red"],
"POD" => ["bg" => "white", "color" => "#47D359"],
"GENERAL" => ["bg" => "white", "color" => "#A02B93"],
"default" => ["bg" => "white", "color" => "black"],
];
public array $OT_TAREA_STATUS_COLOR = [
"P" => '#FFB22C',
"F" => '#67AE6E',
"S" => '#EB5B00',
"I" => '#3A59D1',
"E" => '#FF0B55',
"D" => '#FFA725',
];
public function __construct()
{
parent::__construct();
}
}

29
ci4/app/Config/PedidoXML.php Executable file
View File

@ -0,0 +1,29 @@
<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
class PedidoXML extends BaseConfig
{
public string $host;
public int $port;
public string $username;
public string $password;
public string $base_dir; # FTP server directory
public bool $xml_enabled;
public int $id_offset;
public function __construct() {
parent::__construct();
$this->host = env("HIDRIVE_HOST","10.5.0.6");
$this->port = env("HIDRIVE_PORT",21);
$this->username = env("HIDRIVE_USER","admin");
$this->password = env("HIDRIVE_PASS","A77h3b0X4OA2rOYAf4w2");
$this->base_dir = env("HIDRIVE_PATH_ROOT","/home/admin/safekat"); # FTP server directory
$this->xml_enabled = env("FTP_XML_ENABLED",false);
$this->id_offset = env("XML_OFFSET_CUSTOMER_ID",1000000);
}
}

0
ci4/app/Config/Publisher.php Normal file → Executable file
View File

0
ci4/app/Config/RBAC/.gitkeep Executable file
View File

View File

@ -1,209 +0,0 @@
<?php
const SK_PERMISSION_MATRIX = [
"admin" => [
"clientes.create",
"clientes.edit",
"clientes.delete",
"clientes.menu",
"plantilla-tarifa.create",
"plantilla-tarifa.edit",
"plantilla-tarifa.delete",
"plantilla-tarifa.menu",
"presupuesto.create",
"presupuesto.edit",
"presupuesto.delete",
"presupuesto.menu",
"tarifa-preimpresion.create",
"tarifa-preimpresion.edit",
"tarifa-preimpresion.delete",
"tarifa-preimpresion.menu",
"tarifa-manipulado.create",
"tarifa-manipulado.edit",
"tarifa-manipulado.delete",
"tarifa-manipulado.menu",
"tarifa-acabado.create",
"tarifa-acabado.edit",
"tarifa-acabado.delete",
"tarifa-acabado.menu",
"tarifa-encuadernacion.create",
"tarifa-encuadernacion.edit",
"tarifa-encuadernacion.delete",
"tarifa-encuadernacion.menu",
"tarifa-envio.create",
"tarifa-envio.edit",
"tarifa-envio.delete",
"tarifa-envio.menu",
"proveedores.create",
"proveedores.edit",
"proveedores.delete",
"proveedores.menu",
"ajustes.create",
"ajustes.edit",
"ajustes.delete",
"ajustes.menu",
"actividad.create",
"actividad.edit",
"actividad.delete",
"actividad.menu",
"paises.create",
"paises.edit",
"paises.delete",
"paises.menu",
"maquinas.create",
"maquinas.edit",
"maquinas.delete",
"maquinas.menu",
"maquinas-defecto.create",
"maquinas-defecto.edit",
"maquinas-defecto.delete",
"maquinas-defecto.menu",
"papel-generico.create",
"papel-generico.edit",
"papel-generico.delete",
"papel-generico.menu",
"papel-impresion.create",
"papel-impresion.edit",
"papel-impresion.delete",
"papel-impresion.menu",
"usuarios.create",
"usuarios.edit",
"usuarios.delete",
"usuarios.menu",
"roles-permisos.create",
"roles-permisos.edit",
"roles-permisos.delete",
"roles-permisos.menu",
],
"cliente-admin" => [
"clientes.create",
"clientes.edit",
"clientes.delete",
"clientes.menu",
"presupuesto.create",
"presupuesto.edit",
"presupuesto.delete",
"presupuesto.menu",
],
"cliente-editor" => [
"clientes.create",
"clientes.edit",
"clientes.delete",
"clientes.menu",
"plantilla-tarifa.create",
"plantilla-tarifa.edit",
"plantilla-tarifa.delete",
"plantilla-tarifa.menu",
"presupuesto.create",
"presupuesto.edit",
"presupuesto.delete",
"presupuesto.menu",
"tarifa-preimpresion.create",
"tarifa-preimpresion.edit",
"tarifa-preimpresion.delete",
"tarifa-preimpresion.menu",
"tarifa-manipulado.create",
"tarifa-manipulado.edit",
"tarifa-manipulado.delete",
"tarifa-manipulado.menu",
"tarifa-acabado.create",
"tarifa-acabado.edit",
"tarifa-acabado.delete",
"tarifa-acabado.menu",
"tarifa-encuadernacion.create",
"tarifa-encuadernacion.edit",
"tarifa-encuadernacion.delete",
"tarifa-encuadernacion.menu",
"tarifa-envio.create",
"tarifa-envio.edit",
"tarifa-envio.delete",
"tarifa-envio.menu",
"proveedores.create",
"proveedores.edit",
"proveedores.delete",
"proveedores.menu",
"ajustes.create",
"ajustes.edit",
"ajustes.delete",
"ajustes.menu",
"actividad.create",
"actividad.edit",
"actividad.delete",
"actividad.menu",
],
"comercial" => [
"token.token",
"token.menu",
],
"produccion" => [
"token.token",
"token.menu",
],
"maquina" => [
"token.token",
"token.menu",
],
"maquetador" => [
"token.token",
"token.menu",
],
"director" => [
"token.token",
"token.menu",
],
"contabilidad" => [
"token.token",
"token.menu",
],
"editor" => [
"token.token",
"token.menu",
"Profile.index",
"Profile.menu",
],
"beta" => [
"clientes.create",
"clientes.edit",
"clientes.delete",
"clientes.menu",
"plantilla-tarifa.create",
"plantilla-tarifa.edit",
"plantilla-tarifa.delete",
"plantilla-tarifa.menu",
"presupuesto.create",
"presupuesto.edit",
"presupuesto.delete",
"presupuesto.menu",
"tarifa-preimpresion.create",
"tarifa-preimpresion.edit",
"tarifa-preimpresion.delete",
"tarifa-preimpresion.menu",
"tarifa-manipulado.create",
"tarifa-manipulado.edit",
"tarifa-manipulado.delete",
"tarifa-manipulado.menu",
"tarifa-acabado.create",
"tarifa-acabado.edit",
"tarifa-acabado.delete",
"tarifa-acabado.menu",
"tarifa-encuadernacion.create",
"tarifa-encuadernacion.edit",
"tarifa-encuadernacion.delete",
"tarifa-encuadernacion.menu",
"tarifa-envio.create",
"tarifa-envio.edit",
"tarifa-envio.delete",
"tarifa-envio.menu",
"proveedores.create",
"proveedores.edit",
"proveedores.delete",
"proveedores.menu",
"ajustes.create",
"ajustes.edit",
"ajustes.delete",
"ajustes.menu",
"actividad.create",
"actividad.edit",
"actividad.delete",
"actividad.menu",
],
];

View File

@ -1,28 +0,0 @@
<?php
const SK_PERMISSION_MATRIX = [
"superadmin"=> [
"admin.*",
"users.*",
"beta.*"
],
"admin"=> [
"admin.access",
"users.create",
"users.edit",
"users.delete",
"beta.access"
],
"developer"=> [
"admin.access",
"admin.settings",
"users.create",
"users.edit",
"beta.access"
],
"user"=> [
"users.list"
],
"beta"=> [
"beta.access"
]
];

View File

@ -1,76 +0,0 @@
<?php
const SK_PERMISSIONS = [
'clientes.create' => 'Can create',
'clientes.edit' => 'Can edit',
'clientes.delete' => 'Can delete',
'clientes.menu' => 'Menu shall be visualize',
'plantilla-tarifa.create' => 'Can create',
'plantilla-tarifa.edit' => 'Can edit',
'plantilla-tarifa.delete' => 'Can delete',
'plantilla-tarifa.menu' => 'Menu shall be visualize',
'presupuesto.create' => 'Can create',
'presupuesto.edit' => 'Can edit',
'presupuesto.delete' => 'Can delete',
'presupuesto.menu' => 'Menu shall be visualize',
'tarifa-preimpresion.create' => 'Can create',
'tarifa-preimpresion.edit' => 'Can edit',
'tarifa-preimpresion.delete' => 'Can delete',
'tarifa-preimpresion.menu' => 'Menu shall be visualize',
'tarifa-manipulado.create' => 'Can create',
'tarifa-manipulado.edit' => 'Can edit',
'tarifa-manipulado.delete' => 'Can delete',
'tarifa-manipulado.menu' => 'Menu shall be visualize',
'tarifa-acabado.create' => 'Can create',
'tarifa-acabado.edit' => 'Can edit',
'tarifa-acabado.delete' => 'Can delete',
'tarifa-acabado.menu' => 'Menu shall be visualize',
'tarifa-encuadernacion.create' => 'Can create',
'tarifa-encuadernacion.edit' => 'Can edit',
'tarifa-encuadernacion.delete' => 'Can delete',
'tarifa-encuadernacion.menu' => 'Menu shall be visualize',
'tarifa-envio.create' => 'Can create',
'tarifa-envio.edit' => 'Can edit',
'tarifa-envio.delete' => 'Can delete',
'tarifa-envio.menu' => 'Menu shall be visualize',
'proveedores.create' => 'Can create',
'proveedores.edit' => 'Can edit',
'proveedores.delete' => 'Can delete',
'proveedores.menu' => 'Menu shall be visualize',
'ajustes.create' => 'Can create',
'ajustes.edit' => 'Can edit',
'ajustes.delete' => 'Can delete',
'ajustes.menu' => 'Menu shall be visualize',
'actividad.create' => 'Can create',
'actividad.edit' => 'Can edit',
'actividad.delete' => 'Can delete',
'actividad.menu' => 'Menu shall be visualize',
'paises.create' => 'Can create',
'paises.edit' => 'Can edit',
'paises.delete' => 'Can delete',
'paises.menu' => 'Menu shall be visualize',
'maquinas.create' => 'Can create',
'maquinas.edit' => 'Can edit',
'maquinas.delete' => 'Can delete',
'maquinas.menu' => 'Menu shall be visualize',
'maquinas-defecto.create' => 'Can create',
'maquinas-defecto.edit' => 'Can edit',
'maquinas-defecto.delete' => 'Can delete',
'maquinas-defecto.menu' => 'Menu shall be visualize',
'papel-generico.create' => 'Can create',
'papel-generico.edit' => 'Can edit',
'papel-generico.delete' => 'Can delete',
'papel-generico.menu' => 'Menu shall be visualize',
'papel-impresion.create' => 'Can create',
'papel-impresion.edit' => 'Can edit',
'papel-impresion.delete' => 'Can delete',
'papel-impresion.menu' => 'Menu shall be visualize',
'usuarios.create' => 'Can create',
'usuarios.edit' => 'Can edit',
'usuarios.delete' => 'Can delete',
'usuarios.menu' => 'Menu shall be visualize',
'roles-permisos.create' => 'Can create',
'roles-permisos.edit' => 'Can edit',
'roles-permisos.delete' => 'Can delete',
'roles-permisos.menu' => 'Menu shall be visualize',
];

View File

@ -1,11 +0,0 @@
<?php
const SK_PERMISSIONS = [
'admin.access' => 'Can access the sites admin area',
'admin.settings' => 'Can access the main site settings',
'users.manage-admins' => 'Can manage other admins',
'users.list' => 'Can list user stuff',
'users.create' => 'Can create new non-admin users',
'users.edit' => 'Can edit existing non-admin users',
'users.delete' => 'Can delete existing non-admin users',
'beta.access' => 'Can access beta-level features',
];

View File

@ -1,22 +0,0 @@
{
"superadmin": {
"title": "Super Admin",
"description": "Complete control of the site."
},
"admin": {
"title": "Admin",
"description": "Day to day administrators of the site."
},
"developer": {
"title": "Developer",
"description": "Site programmers."
},
"user": {
"title": "User",
"description": "General users of the site. Often customers."
},
"beta": {
"title": "Beta User",
"description": "Has access to beta-level features."
}
}

View File

@ -1,48 +0,0 @@
<?php
const SK_ROLES = [
'admin' => [
'title' => 'Administrador',
'description' => '',
],
'cliente-admin' => [
'title' => 'Cliente administrador',
'description' => 'Rol de cliente con permisos de administración',
],
'cliente-editor' => [
'title' => 'Cliente editor',
'description' => 'Rol de cliente con permisos de edición',
],
'comercial' => [
'title' => 'Comercial',
'description' => '',
],
'produccion' => [
'title' => 'Producción',
'description' => '',
],
'maquina' => [
'title' => 'Máquina',
'description' => '',
],
'maquetador' => [
'title' => 'Maquetador',
'description' => '',
],
'director' => [
'title' => 'Director',
'description' => '',
],
'contabilidad' => [
'title' => 'Contabilidad',
'description' => '',
],
'editor' => [
'title' => 'Editor',
'description' => '',
],
'beta' => [
'title' => 'Beta',
'description' => '',
],
];

View File

@ -1,23 +0,0 @@
<?php
const SK_ROLES = [
'superadmin' => [
'title' => 'Super Admin',
'description' => 'Complete control of the site.',
],
'admin' => [
'title' => 'Admin',
'description' => 'Day to day administrators of the site.',
],
'developer' => [
'title' => 'Developer',
'description' => 'Site programmers.',
],
'user' => [
'title' => 'User',
'description' => 'General users of the site. Often customers.',
],
'beta' => [
'title' => 'Beta User',
'description' => 'Has access to beta-level features.',
],
];

View File

@ -9,22 +9,15 @@ use CodeIgniter\Router\RouteCollection;
//service('auth')->routes($routes, ['except' => ['login', 'register']]);
service('auth')->routes($routes);
//WEB ROUTER ------------------------------------------------------
//------------------------------------------------------------------
$routes->get('/', 'Home::index', ['as' => 'home']);
$routes->get('lang/{locale}', 'Language::index');
$routes->get('viewmode/(:alpha)', 'Viewmode::index/$1');
$routes->group('activity', ['namespace' => 'App\Controllers\Sistema'], function ($routes) {
$routes->get('', 'Actividad::index', ['as' => 'activityList']);
$routes->post('datatable', 'Actividad::datatable', ['as' => 'activityDT']);
});
$routes->group('settings', ['namespace' => 'App\Controllers\Sistema'], function ($routes) {
$routes->get('', 'Ajustes::settings', ['as' => 'ajustesList']);
$routes->post('', 'Ajustes::settings', ['as' => 'ajustesEdit']);
});
/* URL FOR TESTS */
$routes->get('test', 'Test::index');
/*
@ -33,31 +26,16 @@ $routes->group('settings', ['namespace' => 'App\Controllers\Sistema'], function
* --------------------------------------------------------------------
*/
/* Rutas para configuraciones */
$routes->group('tarifas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
/* Cliente */
$routes->group('acabados', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
$routes->get('', 'TarifaAcabados::index', ['as' => 'tarifaAcabadoList']);
$routes->match(['get', 'post'], 'add', 'TarifaAcabados::add', ['as' => 'tarifaAcabadoAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'TarifaAcabados::edit/$1', ['as' => 'tarifaAcabadoEdit']);
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);
$routes->group('lineas', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
$routes->post('datatable', 'TarifaAcabadosLineas::datatable', ['as' => 'tarifaAcabadoLineasDT']);
$routes->post('datatable_editor', 'TarifaAcabadosLineas::datatable_editor', ['as' => 'tarifaAcabadoLineasDTE']);
$routes->get('delete/(:num)', 'TarifaAcabadosLineas::delete/$1', ['as' => 'tarifaAcabadoLineasDelete']);
});
});
});
// Carga archivos de rutas por dominio
foreach (glob(APPPATH . 'Config/Routes/*Routes.php') as $routeFile) {
require $routeFile;
}
$routes->group('users', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Users::index', ['as' => 'userList']);
$routes->get('index', 'Users::index', ['as' => 'userIndex']);
$routes->get('maquinista/change/user', 'Users::index_maquinista_change_user', ['as' => 'maquinistaUserChangeList']);
$routes->get('maquinista/change/session/(:num)', 'Users::change_user_session/$1', ['as' => 'maquinistaChangeUserSession']);
$routes->get('list', 'Users::index', ['as' => 'userList2']);
$routes->get('add', 'Users::add', ['as' => 'newUser']);
$routes->post('add', 'Users::add', ['as' => 'createUser']);
@ -66,17 +44,12 @@ $routes->group('users', ['namespace' => 'App\Controllers\Configuracion'], functi
$routes->get('delete/(:num)', 'Users::delete/$1', ['as' => 'deleteUser']);
$routes->post('allmenuitems', 'Users::allItemsSelect', ['as' => 'select2ItemsOfUsers']);
$routes->post('menuitems', 'Users::menuItems', ['as' => 'menuItemsOfUsers']);
$routes->post('datatable', 'Users::datatable', ['as' => 'datatableOfUsers']);
$routes->get('getMenuComerciales', 'Users::getMenuComerciales', ['as' => 'menuItemsComerciales']);
});
$routes->group('group', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Group::index', ['as' => 'userGroupList']);
$routes->get('index', 'Group::index', ['as' => 'groupIndex']);
$routes->post('edit/(:num)', 'Group::edit/$1', ['as' => 'updateGroup']);
$routes->get('edit/(:num)', 'Group::edit/$1', ['as' => 'editGroup']);
$routes->get('delete/(:num)', 'Group::delete/$1', ['as' => 'deleteGroup']);
$routes->get('add', 'Group::add', ['as' => 'newGroup']);
$routes->post('add', 'Group::add', ['as' => 'createGroup']);
});
$routes->resource('users', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Users', 'except' => 'show,new,create,update']);
$routes->group('tarifapreimpresion', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
$routes->get('', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionList']);
@ -89,6 +62,7 @@ $routes->group('tarifapreimpresion', ['namespace' => 'App\Controllers\Tarifas'],
$routes->get('delete/(:num)', 'Tarifapreimpresion::delete/$1', ['as' => 'deleteTarifapreimpresion']);
$routes->post('allmenuitems', 'Tarifapreimpresion::allItemsSelect', ['as' => 'select2ItemsOfTarifaspreimpresion']);
$routes->post('menuitems', 'Tarifapreimpresion::menuItems', ['as' => 'menuItemsOfTarifaspreimpresion']);
$routes->get('gettarifas', 'Tarifapreimpresion::getSelect2');
});
@ -103,6 +77,7 @@ $routes->group('tarifaextra', ['namespace' => 'App\Controllers\Tarifas'], functi
$routes->get('delete/(:num)', 'Tarifaextra::delete/$1', ['as' => 'deleteTarifaextra']);
$routes->post('allmenuitems', 'Tarifaextra::allItemsSelect', ['as' => 'select2ItemsOfTarifasextra']);
$routes->post('menuitems', 'Tarifaextra::menuItems', ['as' => 'menuItemsOfTarifasextra']);
$routes->get('gettarifas', 'Tarifaextra::getSelect2');
});
@ -117,10 +92,25 @@ $routes->group('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas'],
$routes->post('datatable', 'Tarifasmanipulado::datatable', ['as' => 'dataTableOfTarifasManipulado']);
$routes->post('allmenuitems', 'Tarifasmanipulado::allItemsSelect', ['as' => 'select2ItemsOfTarifasManipulado']);
$routes->post('menuitems', 'Tarifasmanipulado::menuItems', ['as' => 'menuItemsOfTarifasManipulado']);
$routes->get('select', 'Tarifasmanipulado::show_select', ["as" => "showSelectTarifaManipulado"]);
$routes->get('gettarifas', 'Tarifasmanipulado::getSelect2');
});
$routes->resource('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasmanipulado', 'except' => 'show,new,create,update']);
$routes->group('serviciosacabado', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
$routes->get('', 'ServiciosAcabado::index', ['as' => 'serviciosAcabadoList']);
$routes->get('add', 'ServiciosAcabado::add', ['as' => 'newServicioAcabado']);
$routes->post('add', 'ServiciosAcabado::add', ['as' => 'createServicioAcabado']);
$routes->get('edit/(:num)', 'ServiciosAcabado::edit/$1', ['as' => 'editServicioAcabado']);
$routes->post('edit/(:num)', 'ServiciosAcabado::edit/$1', ['as' => 'updateServicioAcabado']);
$routes->get('datatable', 'ServiciosAcabado::datatable');
$routes->get('getselectedtarifas', 'ServiciosAcabado::getTarifasSeleccionadas');
$routes->get('gettarifas', 'ServiciosAcabado::getTarifas');
});
$routes->resource('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas\Acabados', 'controller' => 'ServiciosAcabado', 'except' => 'show,new,create,update']);
$routes->group('tarifamanipuladolineas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
$routes->get('', 'Tarifamanipuladolineas::index', ['as' => 'tarifaManipuladoLineaList']);
$routes->get('add', 'Tarifamanipuladolineas::add', ['as' => 'newTarifaManipuladoLinea']);
@ -152,42 +142,24 @@ $routes->group('tipologiaslibros', ['namespace' => 'App\Controllers\Configuracio
$routes->group('imposiciones', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Imposiciones::index', ['as' => 'imposicionList']);
$routes->get('add', 'Imposiciones::add', ['as' => 'newImposicion']);
$routes->post('add', 'Imposiciones::add', ['as' => 'createImposicion']);
$routes->get('add/esquema', 'Imposiciones::add_esquema', ['as' => 'newImposicionEsquema']);
$routes->get('find/(:num)', 'Imposiciones::find_imposicion/$1', ['as' => 'findImposicion']);
$routes->get('esquema/find/(:num)', 'Imposiciones::find_imposicion_esquema/$1', ['as' => 'findImposicionEsquema']);
$routes->post('create', 'Imposiciones::create', ['as' => 'ajaxCreateImposicion']);
$routes->put('(:num)/update', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']);
$routes->post('(:num)/edit', 'Imposiciones::edit/$1', ['as' => 'updateImposicion']);
$routes->post('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
$routes->post('esquema/create', 'Imposiciones::create_imposicion_esquema', ['as' => 'ajaxCreateImposicionEsquema']);
$routes->post('(:num)', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']);
$routes->post('esquema/(:num)', 'Imposiciones::update_imposicion_esquema/$1', ['as' => 'ajaxUpdateImposicionEsquema']);
$routes->delete('(:num)', 'Imposiciones::delete/$1', ['as' => 'deleteImposicion']);
$routes->delete('esquema/(:num)', 'Imposiciones::delete_imposicion_esquema/$1', ['as' => 'deleteImposicionEsquema']);
$routes->get('edit/(:num)', 'Imposiciones::edit/$1', ['as' => 'updateImposicionForm']);
$routes->get('esquema/edit/(:num)', 'Imposiciones::edit_imposicion_esquema/$1', ['as' => 'updateImposicionEsquemaForm']);
$routes->get('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
$routes->get('esquema/datatable', 'Imposiciones::datatable_imposicion_esquema', ['as' => 'dataTableOfEsquemaImposiciones']);
$routes->post('allmenuitems', 'Imposiciones::allItemsSelect', ['as' => 'select2ItemsOfImposiciones']);
$routes->post('menuitems', 'Imposiciones::menuItems', ['as' => 'menuItemsOfImposiciones']);
$routes->get('select', 'Imposiciones::selectImposicion', ['as' => 'selectImposicion']);
$routes->get('esquema/select', 'Imposiciones::selectImposicionEsquema', ['as' => 'selectImposicionEsquema']);
});
$routes->resource('imposiciones', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Imposiciones', 'except' => 'show,new,create,update']);
$routes->group('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Papelesgenericos::index', ['as' => 'papelGenericoList']);
$routes->delete('', 'Papelesgenericos::index', ['as' => 'papelGenericoList2']);
$routes->get('add', 'Papelesgenericos::add', ['as' => 'newPapelGenerico']);
$routes->post('add', 'Papelesgenericos::add', ['as' => 'createPapelGenerico']);
$routes->post('create', 'Papelesgenericos::create', ['as' => 'ajaxCreatePapelGenerico']);
$routes->put('(:num)/update', 'Papelesgenericos::update/$1', ['as' => 'ajaxUpdatePapelGenerico']);
$routes->post('edit/(:num)', 'Papelesgenericos::edit/$1', ['as' => 'updatePapelGenerico']);
$routes->post('datatable', 'Papelesgenericos::datatable', ['as' => 'dataTableOfPapelesGenericos']);
$routes->post('allmenuitems', 'Papelesgenericos::allItemsSelect', ['as' => 'select2ItemsOfPapelesGenericos']);
$routes->post('menuitems', 'Papelesgenericos::menuItems', ['as' => 'menuItemsOfPapelesGenericos']);
});
$routes->resource('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesgenericos', 'except' => 'show,new,create,update']);
$routes->group('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Papelesimpresion::index', ['as' => 'papelImpresionList']);
$routes->get('add', 'Papelesimpresion::add', ['as' => 'newPapelImpresion']);
$routes->post('add', 'Papelesimpresion::add', ['as' => 'createPapelImpresion']);
$routes->post('create', 'Papelesimpresion::create', ['as' => 'ajaxCreatePapelImpresion']);
$routes->put('(:num)/update', 'Papelesimpresion::update/$1', ['as' => 'ajaxUpdatePapelImpresion']);
$routes->post('edit/(:num)', 'Papelesimpresion::edit/$1', ['as' => 'updatePapelImpresion']);
$routes->post('datatable', 'Papelesimpresion::datatable', ['as' => 'dataTableOfPapelesImpresion']);
$routes->post('allmenuitems', 'Papelesimpresion::allItemsSelect', ['as' => 'select2ItemsOfPapelesImpresion']);
$routes->post('menuitems', 'Papelesimpresion::menuItems', ['as' => 'menuItemsOfPapelesImpresion']);
});
$routes->resource('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesimpresion', 'except' => 'show,new,create,update']);
$routes->group('papelimpresiontipologias', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('add', 'Papelimpresiontipologias::add', ['as' => 'newPapelImpresionTipologia']);
@ -206,20 +178,6 @@ $routes->group('papelesimpresionmargenes', ['namespace' => 'App\Controllers\Conf
});
$routes->resource('papelesimpresionmargenes', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelimpresionmargenes', 'except' => 'show,new,create,update']);
$routes->group('maquinas', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Maquinas::index', ['as' => 'maquinaList']);
$routes->get('add', 'Maquinas::add', ['as' => 'newMaquina']);
$routes->post('add', 'Maquinas::add', ['as' => 'createMaquina']);
$routes->post('create', 'Maquinas::create', ['as' => 'ajaxCreateMaquina']);
$routes->put('update/(:num)', 'Maquinas::update/$1', ['as' => 'ajaxUpdateMaquina']);
$routes->post('edit/(:num)', 'Maquinas::edit/$1', ['as' => 'updateMaquina']);
$routes->post('datatable', 'Maquinas::datatable', ['as' => 'dataTableOfMaquinas']);
$routes->post('allmenuitems', 'Maquinas::allItemsSelect', ['as' => 'select2ItemsOfMaquinas']);
$routes->post('menuitems', 'Maquinas::menuItems', ['as' => 'menuItemsOfMaquinas']);
});
$routes->resource('maquinas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinas', 'except' => 'show,new,create,update']);
$routes->group('maquinastarifasimpresion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Maquinastarifasimpresion::index', ['as' => 'maquinasTarifaImpresionList']);
$routes->get('add', 'Maquinastarifasimpresion::add', ['as' => 'newMaquinasTarifaImpresion']);
@ -253,24 +211,11 @@ $routes->group('maquinaspapelesimpresion', ['namespace' => 'App\Controllers\Conf
$routes->resource('maquinastarifasimpresion', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinastarifasimpresion', 'except' => 'show,new,create,update']);
$routes->group('maquinasdefecto', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Maquinasdefecto::index', ['as' => 'maquinaPorDefectoList']);
$routes->get('add', 'Maquinasdefecto::add', ['as' => 'newMaquinaPorDefecto']);
$routes->post('add', 'Maquinasdefecto::add', ['as' => 'createMaquinaPorDefecto']);
$routes->post('create', 'Maquinasdefecto::create', ['as' => 'ajaxCreateMaquinaPorDefecto']);
$routes->put('(:num)/update', 'Maquinasdefecto::update/$1', ['as' => 'ajaxUpdateMaquinaPorDefecto']);
$routes->post('edit/(:num)', 'Maquinasdefecto::edit/$1', ['as' => 'updateMaquinaPorDefecto']);
$routes->post('datatable', 'Maquinasdefecto::datatable', ['as' => 'dataTableOfMaquinasPorDefecto']);
$routes->post('allmenuitems', 'Maquinasdefecto::allItemsSelect', ['as' => 'select2ItemsOfMaquinasPorDefecto']);
$routes->post('menuitems', 'Maquinasdefecto::menuItems', ['as' => 'menuItemsOfMaquinasPorDefecto']);
});
$routes->resource('maquinasdefecto', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinasdefecto', 'except' => 'show,new,create,update']);
$routes->group('profile', ['namespace' => 'App\Controllers'], function ($routes) {
$routes->get('', 'Profile::index', ['as' => 'profileList']);
$routes->get('index', 'Profile::index', ['as' => 'profileIndex']);
$routes->get('list', 'Profile::index', ['as' => 'profileList2']);
$routes->match(['get', 'post'], 'store', 'Profile::store', ['as' => 'profileStore']);
});
@ -284,22 +229,20 @@ $routes->group('comunidades-autonomas', ['namespace' => 'App\Controllers\Configu
$routes->post('datatable', 'Comunidadesautonomas::datatable', ['as' => 'dataTableOfComunidadesAutonomas']);
$routes->post('allmenuitems', 'Comunidadesautonomas::allItemsSelect', ['as' => 'select2ItemsOfComunidadesAutonomas']);
$routes->post('menuitems', 'Comunidadesautonomas::menuItems', ['as' => 'menuItemsOfComunidadesAutonomas']);
$routes->get('menuitems2', 'Comunidadesautonomas::menuItems2', ['as' => 'menuItemsOfComunidadesAutonomas2']);
});
$routes->resource('comunidades-autonomas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Comunidadesautonomas', 'except' => 'show,new,create,update']);
$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Paises::index', ['as' => 'paisList']);
$routes->get('add', 'Paises::add', ['as' => 'newPais']);
$routes->post('add', 'Paises::add', ['as' => 'createPais']);
$routes->post('create', 'Paises::create', ['as' => 'ajaxCreatePais']);
$routes->put('(:num)/update', 'Paises::update/$1', ['as' => 'ajaxUpdatePais']);
$routes->post('(:num)/edit', 'Paises::edit/$1', ['as' => 'updatePais']);
$routes->post('datatable', 'Paises::datatable', ['as' => 'dataTableOfPaises']);
$routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
$routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
$routes->group('formas-pago', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'FormasPago::index', ['as' => 'formasPagoList']);
$routes->match(['get', 'post'], 'add', 'FormasPago::add', ['as' => 'formasPagoAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'FormasPago::edit/$1', ['as' => 'formasPagoEdit']);
$routes->get('delete/(:num)', 'FormasPago::delete/$1', ['as' => 'formasPagoDelete']);
$routes->post('datatable', 'FormasPago::datatable', ['as' => 'formasPagoDT']);
$routes->get('menuitems', 'FormasPago::menuItems', ['as' => 'menuItemsOfFormasDePagos']);
});
$routes->resource('paises', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Paises', 'except' => 'show,new,create,update']);
$routes->resource('formas-pago', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'FormasPago', 'except' => 'show,new,create,update']);
$routes->group('provincias', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
@ -312,6 +255,7 @@ $routes->group('provincias', ['namespace' => 'App\Controllers\Configuracion'], f
$routes->post('datatable', 'Provincias::datatable', ['as' => 'dataTableOfProvincias']);
$routes->post('allmenuitems', 'Provincias::allItemsSelect', ['as' => 'select2ItemsOfProvincias']);
$routes->post('menuitems', 'Provincias::menuItems', ['as' => 'menuItemsOfProvincias']);
$routes->get('menuitems2', 'Provincias::menuItems2', ['as' => 'menuItemsOfProvincias2']);
});
$routes->resource('provincias', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Provincias', 'except' => 'show,new,create,update']);
@ -322,42 +266,25 @@ $routes->group('clientes', ['namespace' => 'App\Controllers\Clientes'], function
/* Cliente */
$routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->get('', 'Cliente::index', ['as' => 'clienteList']);
$routes->get('edit/(:num)', 'Cliente::edit/$1', ['as' => 'editarCliente']);
$routes->match(['get', 'post'], 'add', 'Cliente::add', ['as' => 'clienteAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'Cliente::edit/$1', ['as' => 'clienteEdit']);
$routes->get('delete/(:num)', 'Cliente::delete/$1', ['as' => 'clienteDelete']);
$routes->post('datatable', 'Cliente::datatable', ['as' => 'clienteDT']);
$routes->post('menuitems', 'Cliente::menuItems', ['as' => 'menuItemsOfClientes']);
$routes->get('getSelect2', 'Cliente::getSelect2', ['as' => 'getListaSelect2']);
});
/* Precios */
/*$routes->group('precios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->post('datatable', 'ClientePrecios::datatable', ['as' => 'clientePreciosDT']);
$routes->post('datatable_editor', 'ClientePrecios::datatable_editor', ['as' => 'clientePreciosDTE']);
});*/
});
/*$routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->get('', 'Cliente::index', ['as' => 'clienteList']);
$routes->get('add', 'Cliente::add', ['as' => 'newCliente']);
$routes->post('add', 'Cliente::add', ['as' => 'createCliente']);
$routes->post('create', 'Cliente::create', ['as' => 'ajaxCreateCliente']);
$routes->put('(:num)/update', 'Cliente::update/$1', ['as' => 'ajaxUpdateCliente']);
$routes->post('edit/(:num)', 'Cliente::edit/$1', ['as' => 'updateCliente']);
$routes->get('delete/(:num)', 'Cliente::delete/$1', ['as' => 'deleteCliente']);
$routes->post('datatable', 'Cliente::datatable', ['as' => 'dataTableOfClientes']);
$routes->post('allmenuitems', 'Cliente::allItemsSelect', ['as' => 'select2ItemsOfClientes']);
});
$routes->resource('cliente', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Cliente', 'except' => 'show,new,create,update']);*/
$routes->group('clienteprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->post('datatable', 'Clienteprecios::datatable', ['as' => 'dataTableOfClienteprecios']);
$routes->post('datatable_editor', 'Clienteprecios::datatable_editor', ['as' => 'editorOfClienteprecios']);
$routes->post('datatable', 'ClientePrecios::datatable', ['as' => 'dataTableOfClienteprecios']);
$routes->post('datatable_editor', 'ClientePrecios::datatable_editor', ['as' => 'editorOfClienteprecios']);
$routes->post('changeplantilla', 'ClientePrecios::updatePlantilla', ['as' => 'changePlantillaOfClienteprecios']);
$routes->get('getplantilla', 'ClientePrecios::getCurrentPlantilla', ['as' => 'getPlantillaOfClienteprecios']);
$routes->post('update', 'ClientePrecios::updatePlantilla', ['as' => 'updateClienteprecios']);
});
$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteprecios', 'except' => 'show,new,create,update']);
$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'ClientePrecios', 'except' => 'show,new,create,update']);
$routes->group('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
@ -365,36 +292,40 @@ $routes->group('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clien
$routes->get('add', 'Clienteplantillaprecios::add', ['as' => 'newClienteplantillaprecios']);
$routes->post('add', 'Clienteplantillaprecios::add', ['as' => 'createClienteplantillaprecios']);
$routes->post('edit/(:num)', 'Clienteplantillaprecios::edit/$1', ['as' => 'updateClienteplantillaprecios']);
$routes->get('edit/(:num)', 'Clienteplantillaprecios::edit/$1', ['as' => 'updateClienteplantillaprecios']);
$routes->get('delete/(:num)', 'Clienteplantillaprecios::delete/$1', ['as' => 'deleteClienteplantillaprecios']);
$routes->post('datatable', 'Clienteplantillaprecios::datatable', ['as' => 'dataTableOfClientesplantillaprecios']);
$routes->post('menuitems', 'Clienteplantillaprecios::menuItems', ['as' => 'menuItemsOfClienteplantillaprecios']);
$routes->get('menuitems', 'Clienteplantillaprecios::menuItems', ['as' => 'menuItemsOfClienteplantillaprecios']);
$routes->post('update/(:num)', 'Clienteplantillaprecios::update/$1', ['as' => 'updateClienteplantillaprecios']);
});
$routes->resource('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteplantillaprecios', 'except' => 'show,new,create,update']);
$routes->resource('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteplantillaprecios', 'except' => 'show,new,create']);
$routes->group('clienteplantillaprecioslineas', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->post('datatable', 'Clienteplantillaprecioslineas::datatable', ['as' => 'dataTableOfClientesplantillaprecioslineas']);
$routes->post('datatable_editor', 'Clienteplantillaprecioslineas::datatable_editor', ['as' => 'editorOfClienteplantillaprecioslineas']);
$routes->post('getrows', 'Clienteplantillaprecioslineas::getStoredRows', ['as' => 'getStoredRowsOfClienteplantillaprecioslineas']);
});
$routes->resource('clienteplantillaprecioslineas', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'clienteplantillaprecioslineas', 'except' => 'show,new,create,update']);
$routes->group('clienteusuarios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->post('datatable', 'Clienteusuarios::datatable', ['as' => 'dataTableOfClienteUsuarios']);
$routes->post('adduser', 'Clienteusuarios::addUserToClient');
$routes->get('delete/(:num)', 'Clienteusuarios::removeClienteFromUser/$1');
$routes->get('getusers', 'Clienteusuarios::getAvailableUsers');
});
$routes->group('formas-pagos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Formaspagos::index', ['as' => 'formaDePagoList']);
$routes->get('add', 'Formaspagos::add', ['as' => 'newFormaDePago']);
$routes->post('add', 'Formaspagos::add', ['as' => 'createFormaDePago']);
$routes->post('create', 'Formaspagos::create', ['as' => 'ajaxCreateFormaDePago']);
$routes->put('(:num)/update', 'Formaspagos::update/$1', ['as' => 'ajaxUpdateFormaDePago']);
$routes->post('(:num)/edit', 'Formaspagos::edit/$1', ['as' => 'updateFormaDePago']);
$routes->post('datatable', 'Formaspagos::datatable', ['as' => 'dataTableOfFormasDePagos']);
$routes->post('allmenuitems', 'Formaspagos::allItemsSelect', ['as' => 'select2ItemsOfFormasDePagos']);
$routes->post('menuitems', 'Formaspagos::menuItems', ['as' => 'menuItemsOfFormasDePagos']);
$routes->group('misdirecciones', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
$routes->get('', 'Clientedirecciones::index', ['as' => 'clientedireccionesIndex']);
$routes->get('get/(:num)', 'Clientedirecciones::get/$1', ['as' => 'get']);
$routes->get('getId', 'Clientedirecciones::getDireccionIdFromData');
$routes->get('getDireccionPresupuesto/(:num)', 'Clientedirecciones::getDireccionPresupuesto/$1', ['as' => 'getDireccionPresupuesto']);
$routes->post('add', 'Clientedirecciones::add', ['as' => 'newClientedirecciones']);
$routes->get('getSelect2', 'Clientedirecciones::getSelect2', ['as' => 'listaClientedirecciones']);
});
$routes->resource('formas-pagos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Formaspagos', 'except' => 'show,new,create,update']);
$routes->group('tarifasencuadernacion', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
$routes->get('', 'Tarifasencuadernacion::index', ['as' => 'tarifaEncuadernacionList']);
@ -407,6 +338,7 @@ $routes->group('tarifasencuadernacion', ['namespace' => 'App\Controllers\Tarifas
$routes->post('datatable', 'Tarifasencuadernacion::datatable', ['as' => 'dataTableOfTarifasEncuadernacion']);
$routes->post('allmenuitems', 'Tarifasencuadernacion::allItemsSelect', ['as' => 'select2ItemsOfTarifasEncuadernacion']);
$routes->post('menuitems', 'Tarifasencuadernacion::menuItems', ['as' => 'menuItemsOfTarifasEncuadernacion']);
$routes->get('gettarifas', 'Tarifasencuadernacion::getSelect2');
});
$routes->resource('tarifasencuadernacion', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasencuadernacion', 'except' => 'show,new,create,update']);
@ -475,22 +407,7 @@ $routes->group('tarifasenvioszonas', ['namespace' => 'App\Controllers\Tarifas'],
$routes->resource('tarifasenvioszonas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasenvioszonas', 'except' => 'show,new,create,update']);
$routes->group('proveedores', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
$routes->get('', 'Proveedores::index', ['as' => 'proveedorList']);
$routes->get('add', 'Proveedores::add', ['as' => 'newProveedor']);
$routes->post('add', 'Proveedores::add', ['as' => 'createProveedor']);
$routes->post('create', 'Proveedores::create', ['as' => 'ajaxCreateProveedor']);
$routes->put('(:num)/update', 'Proveedores::update/$1', ['as' => 'ajaxUpdateProveedor']);
$routes->post('edit/(:num)', 'Proveedores::edit/$1', ['as' => 'updateProveedor']);
$routes->post('datatable', 'Proveedores::datatable', ['as' => 'dataTableOfProveedores']);
$routes->post('allmenuitems', 'Proveedores::allItemsSelect', ['as' => 'select2ItemsOfProveedores']);
$routes->post('menuitems', 'Proveedores::menuItems', ['as' => 'menuItemsOfProveedores']);
});
$routes->resource('proveedores', ['namespace' => 'App\Controllers\Compras', 'controller' => 'Proveedores', 'except' => 'show,new,create,update']);
$routes->group('proveedorestipos', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
$routes->post('menuitems', 'ProveedoresTipos::menuItems', ['as' => 'menuItemsOfProveedoresTipos']);
});
$routes->resource('proveedorestipos', ['namespace' => 'App\Controllers\Compras', 'controller' => 'ProveedoresTipos', 'except' => 'show,new,create,update']);
@ -519,60 +436,45 @@ $routes->group('clientedirecciones', ['namespace' => 'App\Controllers\Clientes']
$routes->resource('clientedirecciones', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clientedirecciones', 'except' => 'show,new,create,update']);
$routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->get('list/(:num)', 'Cosidotapablanda::list/$1', ['as' => 'cosidotapablandaList']); // HOMOGENIZAR CON ARGS DINAMICOS!!!
$routes->get('add/(:num)', 'Cosidotapablanda::add/$1', ['as' => 'newCosidotapablanda']);
$routes->post('add/(:num)', 'Cosidotapablanda::add/$1', ['as' => 'createCosidotapablanda']);
$routes->post('create', 'Cosidotapablanda::create', ['as' => 'ajaxCreateCosidotapablanda']);
$routes->put('(:num)/update', 'Cosidotapablanda::update/$1', ['as' => 'ajaxUpdateCosidotapablanda']);
$routes->post('edit/(:num)', 'Cosidotapablanda::edit/$1', ['as' => 'updateCosidotapablanda']);
$routes->post('datatable', 'Cosidotapablanda::datatable', ['as' => 'dataTableOfCosidotapablanda']);
$routes->post('datatable_2', 'Cosidotapablanda::datatable_2', ['as' => 'updateDataOfCosidotapablanda']);
$routes->post('allmenuitems', 'Cosidotapablanda::allItemsSelect', ['as' => 'select2ItemsOfCosidotapablanda']);
$routes->post('menuitems', 'Cosidotapablanda::menuItems', ['as' => 'menuItemsOfCosidotapablanda']);
});
$routes->resource('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Cosidotapablanda', 'except' => 'show,new,create,update']);
$routes->group('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->get('list/(:num)', 'Presupuestocliente::list/$1', ['as' => 'listarPresupuestoCliente']); // HOMOGENIZAR CON ARGS DINAMICOS!!!
$routes->get('add', 'Presupuestocliente::add', ['as' => 'nuevoPresupuestoCliente']);
$routes->post('add', 'Presupuestocliente::add', ['as' => 'crearPresupuestoCliente']);
$routes->post('edit/(:num)', 'Presupuestocliente::edit/$1', ['as' => 'editarPresupuestoCliente']);
$routes->post('datatable', 'Cosidotapablanda::datatable', ['as' => 'tablaPresupuestosCliente']);
$routes->post('getgramaje', 'Presupuestocliente::getGramaje', ['as' => 'obtenerGramaje']);
$routes->post('presupuesto', 'Presupuestocliente::presupuesto', ['as' => 'presupuestoCliente']);
$routes->post('getDireccionesCliente', 'Presupuestocliente::getDireccionesCliente', ['as' => 'getDirecciones']);
$routes->post('getDatosDireccion', 'Presupuestocliente::getDatosDireccion', ['as' => 'getDatosDireccion']);
$routes->post('getNuevaDireccion', 'Presupuestocliente::getNuevaDireccion', ['as' => 'nuevaDireccion']);
});
$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
$routes->group('serviciosacabados', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->post('datatable', 'Presupuestoacabados::datatable', ['as' => 'dataTableOfPresupuestoAcabados']);
$routes->get('getacabados', 'Presupuestoacabados::getAcabados');
$routes->post('getvalues', 'Presupuestoacabados::getRowValues');
$routes->post('menuitems', 'Presupuestoacabados::menuItems', ['as' => 'menuItemsOfPresupuestoAcabados']);
$routes->post('edit/(:num)', 'Presupuestoacabados::edit/$1', ['as' => 'updatePresupuestoacabados']);
$routes->get('cargar', 'Presupuestoacabados::cargar');
$routes->post('update/(:num)', 'Presupuestoacabados::update/$1');
});
$routes->group('serviciosencuadernaciones', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->post('datatable', 'Presupuestoencuadernaciones::datatable', ['as' => 'dataTableOfPresupuestoEncuadernaciones']);
$routes->post('getvalues', 'Presupuestoencuadernaciones::getRowValues');
$routes->post('menuitems', 'Presupuestoencuadernaciones::menuItems', ['as' => 'menuItemsOfPresupuestoEncuadernaciones']);
$routes->get('delete/(:num)', 'Presupuestoencuadernaciones::delete/$1', ['as' => 'deletePresupuestoencuadernaciones']);
$routes->post('edit/(:num)', 'Presupuestoencuadernaciones::edit/$1', ['as' => 'updatePresupuestoencuadernaciones']);
$routes->post('update/(:num)', 'Presupuestoencuadernaciones::update/$1');
});
$routes->group('serviciosmanipulados', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->post('getvalues', 'Presupuestomanipulados::getRowValues');
$routes->post('datatable', 'Presupuestomanipulados::datatable', ['as' => 'dataTableOfPresupuestoManipulados']);
$routes->post('edit/(:num)', 'Presupuestomanipulados::edit/$1', ['as' => 'updatePresupuestomanipulados']);
$routes->post('update/(:num)', 'Presupuestomanipulados::update/$1');
$routes->get('serviciosolapas', 'Presupuestomanipulados::getServicioSolapas');
});
$routes->group('serviciospreimpresiones', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->post('getvalues', 'Presupuestopreimpresiones::getRowValues');
$routes->post('datatable', 'Presupuestopreimpresiones::datatable', ['as' => 'dataTableOfPresupuestoPreimpresiones']);
$routes->post('edit/(:num)', 'Presupuestopreimpresiones::edit/$1', ['as' => 'updatePresupuestopreimpresiones']);
$routes->get('cargar', 'Presupuestopreimpresiones::getSelect2');
});
$routes->group('serviciosextra', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->post('datatable', 'Presupuestoserviciosextra::datatable', ['as' => 'dataTableOfPresupuestoServiciosExtra']);
$routes->post('edit/(:num)', 'Presupuestoserviciosextra::edit/$1', ['as' => 'updatePresupuestoServiciosExtra']);
$routes->post('getvalues', 'Presupuestoserviciosextra::getRowValues');
});
$routes->group('presupuestodirecciones', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
@ -583,8 +485,74 @@ $routes->group('presupuestodirecciones', ['namespace' => 'App\Controllers\Presup
$routes->group('presupuestotiradasalternativas', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->post('datatable', 'Presupuestotiradasalternativas::datatable', ['as' => 'dataTableOfPresupuestoTiradasAlternativas']);
$routes->post('datatable_2', 'Presupuestotiradasalternativas::datatable_2', ['as' => 'getTiradaData']);
});
});
$routes->group('pedidos', ['namespace' => 'App\Controllers\Pedidos'], function ($routes) {
$routes->get('list', 'Pedido::todos', ['as' => 'listaPedidos']);
$routes->get('activos', 'Pedido::activos', ['as' => 'listaPedidosActivos']);
$routes->get('finalizados', 'Pedido::finalizados', ['as' => 'listaPedidosFinalizados']);
$routes->get('cancelados', 'Pedido::cancelados', ['as' => 'listaPedidosCancelados']);
$routes->post('datatable', 'Pedido::datatable', ['as' => 'dataTableOfPedidos']);
$routes->get('add', 'Pedido::add', ['as' => 'nuevoPedido']);
$routes->post('add', 'Pedido::add', ['as' => 'crearPedido']);
$routes->get('edit/(:any)', 'Pedido::edit/$1', ['as' => 'editarPedido']);
$routes->post('getlineas', 'Pedido::getLineas', ['as' => 'tablaLineasPedido']);
$routes->post('cambiarestado', 'Pedido::cambiarEstado', ['as' => 'cambiarEstadoPedido']);
$routes->post('update/(:any)', 'Pedido::update/$1', ['as' => 'actualizarPedido']);
$routes->post('insertfactura', 'Pedido::addFactura');
$routes->get('xml/(:num)', 'Pedido::get_xml_pedido/$1', ['as' => 'getXMLPedido']);
$routes->post('produccion/(:num)', 'Pedido::to_produccion/$1', ['as' => 'toProduccion']);
$routes->get('pedidosCliente', 'Pedido::tablaClienteForm');
$routes->get('getSumCliente/(:num)', 'Pedido::obtenerTotalPedidosCliente/$1');
$routes->get('validacion', 'Pedido::validacion', ['as' => 'validacionView']);
});
$routes->resource('pedidos', ['namespace' => 'App\Controllers\Pedidos', 'controller' => 'Pedido', 'except' => 'show,new,create,update']);
$routes->group('albaranes', ['namespace' => 'App\Controllers\Albaranes'], function ($routes) {
$routes->post('generarAlbaran', 'Albaran::generateAlbaran', ['as' => 'generarAlbaran']);
$routes->get('albaranesEnvio', 'Albaran::getAlbaranes');
$routes->get('datatablesAlbaranLinea', 'Albaran::datatablesLineasAlbaran');
$routes->post('updateAlbaran', 'Albaran::updateAlbaran');
$routes->post('borrarAlbaranLinea', 'Albaran::borrarLinea');
$routes->post('borrarAlbaran', 'Albaran::borrarAlbaran');
$routes->post('updateAlbaranLinea', 'Albaran::updateAlbaranLinea');
$routes->post('addIvaAlbaran', 'Albaran::addLineasIva');
$routes->post('nuevaLineaAlbaran', 'Albaran::addBlankLineaAlbaran');
$routes->get('datatable', 'Albaran::datatable', ['as' => 'dataTableOfAlbaranes']);
$routes->get('getAlbaran', 'Albaran::getAlbaran');
$routes->get('edit/(:num)', 'Albaran::editAlbaran/$1', ['as' => 'editarAlbaran']);
});
$routes->resource('albaranes', ['namespace' => 'App\Controllers\Pedidos', 'controller' => 'Albaran', 'except' => 'show,new,create,update']);
$routes->group('facturas', ['namespace' => 'App\Controllers\Facturacion'], function ($routes) {
$routes->get('list', 'Facturas::list', ['as' => 'facturasList']);
$routes->get('datatable', 'Facturas::datatable', ['as' => 'dataTableOfFacturas']);
$routes->get('add', 'Facturas::add', ['as' => 'newFactura']);
$routes->post('add', 'Facturas::add', ['as' => 'createFactura']);
$routes->get('edit/(:any)', 'Facturas::edit/$1', ['as' => 'editarFactura']);
$routes->get('validar/(:any)', 'Facturas::validar/$1', ['as' => 'validarFactura']);
$routes->post('update/(:any)', 'Facturas::update/$1', ['as' => 'actualizarFactura']);
$routes->post('duplicate/(:any)', 'Facturas::duplicate/$1', ['as' => 'duplicarFactura']);
$routes->post('datatable/(:any)', 'FacturasLineas::datatable/$1', ['as' => 'dataTableOfLineasFacturas']);
$routes->post('menuPedidosPendientes/(:num)', 'Facturas::menuPedidosPendientes/$1', ['as' => 'menuPedidosPendientesImpresion']);
$routes->post('addLineaPedidoImpresion/(:num)', 'Facturas::addLineaPedidoImpresion/$1', ['as' => 'addLineaPedidoImpresion2Factura']);
$routes->post('addExcedentes/(:any)', 'Facturas::addExcedentes/$1', ['as' => 'addLineaExcedentes']);
$routes->get('deleteLinea/(:any)', 'FacturasLineas::deleteLinea/$1', ['as' => 'deleteLineaFactura']);
$routes->get('delete/(:any)', 'Facturas::delete/$1', ['as' => 'borrarFactura']);
$routes->post('deleteFacturaLineaPedido', 'Facturas::deleteLineaPedidoImpresion', ['as' => 'deleteLineaPedidoImpresion']);
$routes->post('editorLineas', 'FacturasLineas::datatable_editor', ['as' => 'editorOfLineasFacturas']);
$routes->post('updateTotales/(:any)', 'Facturas::updateTotales/$1', ['as' => 'updateFacturaTotales']);
$routes->post('updateCabecera/(:any)', 'Facturas::updateCabecera/$1', ['as' => 'updateCabecera']);
$routes->post('datatablePagos/(:any)', 'FacturasPagos::datatable/$1', ['as' => 'dataTableOfPagosFacturas']);
$routes->post('conformarFactura', 'FacturasPagos::addPagoRectificativa');
$routes->post('editorPagos', 'FacturasPagos::datatable_editor', ['as' => 'editorOfPagosFacturas']);
$routes->post('deleteFacturaLineaPago', 'Facturas::deleteLineaPago', ['as' => 'deleteLineaPago']);
$routes->post('datatablePedidos', 'Facturas::datatablePedidos', ['as' => 'dataTableOfFacturasPedido']);
$routes->get('getdatoscliente/(:any)', 'Facturas::getDatosFacturacionClienteForm/$1');
});
$routes->group(
@ -597,16 +565,350 @@ $routes->group(
);
$routes->group(
'buscadorpresupuestos',
'print-albaran',
['namespace' => 'App\Controllers\Pdf'],
function ($routes) {
$routes->get('index/(:num)', 'PrintAlbaranes::index/$1', ['as' => 'viewAlbaranPDF']);
$routes->get('generar/(:num)', 'PrintAlbaranes::generar/$1', ['as' => 'albaranToPdf']);
$routes->get('generar-anonimo/(:num)', 'PrintAlbaranes::generarAnonimo/$1', ['as' => 'albaranAnonimoToPdf']);
}
);
$routes->group(
'print-factura',
['namespace' => 'App\Controllers\Pdf'],
function ($routes) {
$routes->get('index/(:num)', 'PrintFacturas::index/$1', ['as' => 'viewFacturaPDF']);
$routes->get('generar/(:num)', 'PrintFacturas::generar/$1', ['as' => 'facturaToPdf']);
}
);
$routes->group(
'export-giros',
['namespace' => 'App\Controllers\Excel'],
function ($routes) {
$routes->get('generar/(:num)', 'PrintGiros::generateExcel/$1', ['as' => 'girosToExcel']);
}
);
$routes->group(
'export-lineas',
['namespace' => 'App\Controllers\Excel'],
function ($routes) {
$routes->get('generar/(:num)', 'PrintLineas::generateExcel/$1', ['as' => 'lineasToExcel']);
}
);
$routes->group(
'presupuestos',
['namespace' => 'App\Controllers\Presupuestos'],
function ($routes) {
$routes->get('', 'Buscador::list', ['as' => 'buscadorPresupuestosList']);
$routes->get('buscador', 'Buscador::index', ['as' => 'buscadorPresupuestosList']);
$routes->post('datatable', 'Buscador::datatable', ['as' => 'dataTableOfBuscador']);
}
);
$routes->resource('buscadorpresupuestos', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Buscador', 'except' => 'show,new,create,update']);
$routes->group(
'papel-formato',
['namespace' => 'App\Controllers\Configuracion'],
function ($routes) {
$routes->post('menuitems', 'Papelformato::menuitems', ['as' => 'menuitems']);
$routes->get('getSelect2', 'Papelformato::getSelect2', ['as' => 'getSelect2']);
}
);
$routes->resource('papel-formato', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelformato', 'except' => 'show,new,create,update']);
/* Rutas para mensajeria */
$routes->group('mensajes', ['namespace' => 'App\Controllers\Mensajeria'], function ($routes) {
/* Interna */
$routes->group('internos', ['namespace' => 'App\Controllers\Mensajeria'], function ($routes) {
$routes->get('', 'MensajesDirectos::index', ['as' => 'mensajeriaView']);
$routes->get('chat/(:num)', 'MensajesDirectos::getChatInfo/$1', ['as' => 'getChatInfo']);
/*$routes->match(['get', 'post'], 'add', 'TarifaAcabados::add', ['as' => 'tarifaAcabadoAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'TarifaAcabados::edit/$1', ['as' => 'tarifaAcabadoEdit']);
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);*/
});
});
$routes->group('messages', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
$routes->get('datatable', 'ChatController::datatable_messages', ['as' => 'getDatatableMessages']);
$routes->get('datatable/presupuesto', 'ChatController::datatable_presupuesto_messages', ['as' => 'getDatatablePresupuestoMessages']);
$routes->get('datatable/pedido', 'ChatController::datatable_pedido_messages', ['as' => 'getDatatablePedidoMessages']);
$routes->get('datatable/factura', 'ChatController::datatable_factura_messages', ['as' => 'getDatatableFacturaMessages']);
$routes->get('datatable/ots', 'ChatController::datatable_ot_messages', ['as' => 'getDatatableOtMessages']);
$routes->get('datatable/direct', 'ChatController::datatable_direct_messages', ['as' => 'getDatatableDirectMessages']);
$routes->post('direct', 'ChatController::store_new_direct_message', ['as' => 'storeNewDirectMessage']);
$routes->post('direct/client', 'ChatController::store_new_direct_message_client', ['as' => 'storeNewDirectMessageClient']);
});
$routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
$routes->get('direct/(:num)', 'ChatController::get_chat_direct_view/$1', ['as' => 'getChatDirectView']);
$routes->get('presupuesto/(:num)', 'ChatController::get_chat_presupuesto_view/$1', ['as' => 'getChatPresupuestoView']);
$routes->get('pedido/(:num)', 'ChatController::get_chat_pedido_view/$1', ['as' => 'getChatPedidoView']);
$routes->get('factura/(:num)', 'ChatController::get_chat_factura_view/$1', ['as' => 'getChatFacturaView']);
$routes->get('ot/(:num)', 'ChatController::get_chat_ot_view/$1', ['as' => 'getChatOtView']);
$routes->get('direct/conversation/(:num)', 'ChatController::get_chat_direct/$1', ['as' => 'getChatDirect']);
$routes->get('direct/users/select/(:num)', 'ChatController::get_chat_direct_select_users/$1', ['as' => 'getChatDirectSelectUsers']);
$routes->get('direct/client/users/select/presupuesto/(:num)', 'ChatController::get_presupuesto_client_users/$1/$2', ['as' => 'getPresupuestoClientUsers']);
$routes->get('direct/client/users/select/pedido/(:num)', 'ChatController::get_pedido_client_users/$1/$2', ['as' => 'getPedidoClientUsers']);
$routes->get('direct/client/users/select/factura/(:num)', 'ChatController::get_factura_client_users/$1/$2', ['as' => 'getFacturaClientUsers']);
$routes->get('direct/client/users/select/ot/(:num)', 'ChatController::get_orden_trabajo_client_users/$1/$2', ['as' => 'getOrdenTrabajoClientUsers']);
$routes->get('direct/users/(:num)', 'ChatController::get_chat_direct_users', ['as' => 'getChatDirectUsers']);
$routes->post('direct/users/(:num)', 'ChatController::store_chat_direct_users/$1', ['as' => 'storeChatDirectUsers']);
$routes->get('direct/messages/(:num)', 'ChatController::get_chat_direct_messages/$1', ['as' => 'getChatDirectMessages']);
$routes->post('direct/messages/(:num)', 'ChatController::store_chat_direct_message/$1', ['as' => 'storeChatDirectMessages']);
$routes->post('direct/messages/unread/(:num)', 'ChatController::update_chat_direct_message_unread/$1', ['as' => 'updateChatDirectMessageUnread']);
$routes->post('department', 'ChatController::store_chat_department', ['as' => 'storeChatDepartment']);
$routes->delete('department/(:num)', 'ChatController::delete_chat_department/$1', ['as' => 'deleteChatDepartment']);
$routes->post('department/update/(:num)', 'ChatController::update_chat_department/$1', ['as' => 'updateChatDepartment']);
$routes->get('departments/(:alpha)/(:num)', 'ChatController::get_chat_departments/$1/$2', ['as' => 'getChatDepartments']);
$routes->get('departments/select', 'ChatController::get_chat_department_select', ['as' => 'getChatDepartmentSelect']);
$routes->get('department/presupuesto/(:num)/(:num)', 'ChatController::get_chat_presupuesto/$1/$2', ['as' => 'getChatPresupuesto']);
$routes->get('department/pedido/(:num)/(:num)', 'ChatController::get_chat_pedido/$1/$2', ['as' => 'getChatPedido']);
$routes->get('department/factura/(:num)/(:num)', 'ChatController::get_chat_factura/$1/$2', ['as' => 'getChatFactura']);
$routes->get('department/ot/(:num)/(:num)', 'ChatController::get_chat_orden_trabajo/$1/$2', ['as' => 'getChatOrdenTrabajo']);
$routes->get('department/users/presupuesto/(:num)/(:num)', 'ChatController::get_chat_department_presupuesto_users/$1/$2', ['as' => 'getPresupuestoChatDepartmentUsers']);
$routes->get('department/users/ot/(:num)/(:num)', 'ChatController::get_chat_department_orden_trabajo_users/$1/$2', ['as' => 'getOrdenTrabajoChatDepartmentUsers']);
$routes->get('department/datatable', 'ChatController::chat_department_datatable', ['as' => 'chatDepartmentDatatable']);
$routes->get('department/edit/(:num)', 'ChatController::chat_department_edit/$1', ['as' => 'chatDepartmentEditView']);
$routes->get('department/users/datatable/(:num)', 'ChatController::chat_department_user_datatable/$1', ['as' => 'chatDepartmentUsersDatatable']);
$routes->get('department/users/pedido/(:num)/(:num)', 'ChatController::get_chat_department_pedido_users/$1/$2', ['as' => 'getPedidoChatDepartmentUsers']);
$routes->get('department/users/factura/(:num)/(:num)', 'ChatController::get_chat_department_factura_users/$1/$2', ['as' => 'getFacturaChatDepartmentUsers']);
$routes->get('department/users/select/add/(:num)', 'ChatController::select_users_not_in_chat_department/$1', ['as' => 'selectUsersNotInChatDepartment']);
$routes->post('department/user', 'ChatController::subscribe_to_chat_deparment/$1', ['as' => 'subscribeToChatDepartment']);
$routes->post('department/subscribe/admin/user', 'ChatController::subscribe_admin_to_department', ['as' => 'subscribeAdminToChatDepartment']);
$routes->delete('department/user/(:num)', 'ChatController::delete_user_from_department/$1', ['as' => 'deleteUserFromDepartment']);
$routes->delete('department/admin/user/(:num)/(:num)', 'ChatController::delete_user_admin_from_department/$1/$2', ['as' => 'deleteUserAdminFromDepartment']);
$routes->get('(:num)', 'ChatController::get_chat/$1', ['as' => 'getChat']);
$routes->post('message/error/presupuesto', 'ChatController::store_chat_error_message', ['as' => 'storeChatErrorMessage']);
$routes->post('message/(:alpha)', 'ChatController::store_message/$1', ['as' => 'storeChatMessage']);
$routes->post('message/internal', 'ChatController::store_chat_message_single', ['as' => 'storeChatMessageSingle']);
$routes->get('contacts', 'ChatController::get_chat_internal_contacts', ['as' => 'getChatInternalContacts']);
$routes->get('contacts/(:num)', 'ChatController::get_chat_internal_contact/$1', ['as' => 'getChatInternalContact']);
$routes->get('contact/(:num)/messages', 'ChatController::get_chat_internal_messages/$1', ['as' => 'getChatInternalMessages']);
$routes->get('notifications', 'ChatController::get_chat_cliente/$1', ['as' => 'getChatCliente']);
$routes->get('users/internal', 'ChatController::get_chat_users_internal', ['as' => 'getChatUsersInternal']);
$routes->get('users/all', 'ChatController::get_chat_users_all', ['as' => 'getChatUsersAll']);
$routes->post('hebra/(:alpha)', 'ChatController::store_hebra/$1', ['as' => 'storeHebra']);
$routes->post('hebra/(:num)', 'ChatController::update_hebra/$1', ['as' => 'updateHebra']);
$routes->get('hebra/(:alpha)/(:num)', "ChatController::get_hebra/$1/$2", ["as" => "getHebra"]);
$routes->get('users/message/notifications-unviewed/(:num)', 'ChatController::get_notifications_not_viewed_from_message/$1');
});
$routes->group('messages', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
$routes->get('datatable', 'ChatController::datatable_messages', ['as' => 'getDatatableMessages']);
$routes->get('datatable/presupuesto', 'ChatController::datatable_presupuesto_messages', ['as' => 'getDatatablePresupuestoMessages']);
$routes->get('datatable/pedido', 'ChatController::datatable_pedido_messages', ['as' => 'getDatatablePedidoMessages']);
$routes->get('datatable/factura', 'ChatController::datatable_factura_messages', ['as' => 'getDatatableFacturaMessages']);
$routes->post('direct', 'ChatController::store_new_direct_message', ['as' => 'storeNewDirectMessage']);
$routes->post('direct/client', 'ChatController::store_new_direct_message_client', ['as' => 'storeNewDirectMessageClient']);
});
$routes->group('soporte', ['namespace' => 'App\Controllers\Soporte'], function ($routes) {
$routes->get('', 'Ticketcontroller::index', ['as' => 'TicketIndex']);
$routes->get('add', 'Ticketcontroller::add', ['as' => 'NewTicket']);
$routes->post('add', 'Ticketcontroller::add', ['as' => 'createTicket']);
$routes->get('edit/(:num)', 'Ticketcontroller::edit/$1', ['as' => 'editTicket']);
$routes->post('edit/(:num)', 'Ticketcontroller::edit/$1', ['as' => 'updateTicket']);
$routes->post('ticketlist', 'Ticketcontroller::datatable');
$routes->get('image/(:segment)', 'Ticketcontroller::image/$1');
});
$routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
$routes->group('ordentrabajo', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
/** VIEWS */
$routes->get('', 'Ordentrabajo::index', ['as' => 'viewOrdenTrabajoIndex']);
$routes->get('edit/(:num)', 'Ordentrabajo::edit/$1', ['as' => 'viewOrdenTrabajoEdit']);
/** GET */
$routes->get('summary/(:num)', 'Ordentrabajo::get_orden_trabajo_summary/$1', ['as' => 'getOrdenTrabajoSumary']);
$routes->get("tarea/progress/(:num)", "Ordentrabajo::get_orden_trabajo_progress_date/$1");
$routes->get('tarea/(:num)', 'Ordentrabajo::find_tarea/$1');
$routes->get('tarea/dates/(:num)', 'Ordentrabajo::get_orden_trabajo_tareas_dates/$1');
$routes->get('tareas/maquina/(:num)/(:num)','Ordentrabajo::get_tareas_ot_maquina/$1/$2');
/** DATATABLES */
$routes->get('datatable', 'Ordentrabajo::datatable');
$routes->get('datatable_pendientes', 'Ordentrabajo::datatable_pendientes');
$routes->get('datatable_ferro_pendiente', 'Ordentrabajo::datatable_ferro_pendiente');
$routes->get('datatable_ferro_ok', 'Ordentrabajo::datatable_ferro_ok');
$routes->get('datatable_news', 'Ordentrabajo::datatable_news');
$routes->get('datatable_prod', 'Ordentrabajo::datatable_prod');
$routes->get('datatable_waiting', 'Ordentrabajo::datatable_waiting');
$routes->get('datatable_revision_com', 'Ordentrabajo::datatable_revision_com');
$routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']);
$routes->get('maquinas/ots/datatable/(:num)','Ordentrabajo::datatable_maquina_ordenes_trabajo/$1');
$routes->get('maquinas/ots/(:num)','Ordentrabajo::get_maquina_ots/$1');
/**======================
* UPDATES
*========================**/
$routes->post("update/tarea", 'Ordentrabajo::update_orden_trabajo_tarea');
$routes->post("update/date", 'Ordentrabajo::update_orden_trabajo_date');
$routes->post("reset/date", 'Ordentrabajo::reset_orden_trabajo_date');
$routes->post("update/pedido/date", 'Ordentrabajo::update_orden_trabajo_pedido_date');
$routes->post("reset/pedido/date", 'Ordentrabajo::reset_orden_trabajo_pedido_date');
$routes->post("update/pod/pedido/date/(:num)", 'Ordentrabajo::update_pod_pedido_dates/$1');
$routes->post("update/pedido", 'Ordentrabajo::update_orden_trabajo_pedido');
$routes->post("update/user", 'Ordentrabajo::update_orden_trabajo_user');
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
$routes->get("color/(:num)", 'Ordentrabajo::get_orden_trabajo_color_status/$1');
$routes->post("update/tarea/progress", "Ordentrabajo::store_orden_trabajo_progress_date");
$routes->post("update/tarea/pliegos", "Ordentrabajo::update_orden_trabajo_pliegos");
$routes->post("update/tarea/proveedor", "Ordentrabajo::update_presupuesto_tarea_proveedor");
$routes->post("fa/tareas/update", 'Ordentrabajo::update_orden_trabajo_fa_tareas');
$routes->post("fa/tareas/reset",'Ordentrabajo::delete_orden_trabajo_fa_tareas');
$routes->post('maquinas/ots','Ordentrabajo::store_maquina_ordenes_trabajo');
$routes->post('maquinas/ots/estado','Ordentrabajo::update_maquina_ordenes_trabajo_estado');
/**DELETES */
$routes->delete("portada/(:num)", 'Ordentrabajo::delete_orden_trabajo_portada/$1');
$routes->delete("tarea/progress/(:num)", "Ordentrabajo::delete_orden_trabajo_progress_date/$1");
$routes->delete('reset/tareas/(:num)', 'Ordentrabajo::reset_tareas/$1');
$routes->delete('tareas/(:num)', 'Ordentrabajo::delete_tarea/$1');
$routes->delete('maquinas/ots/(:num)', 'Ordentrabajo::delete_maquina_orden_trabajo_tarea/$1');
$routes->delete('maquinas/ots/all/(:num)', 'Ordentrabajo::delete_maquina_orden_trabajo_all/$1');
/**======================
* FILES
*========================**/
$routes->post('get_files', 'Ordentrabajo::get_files');
$routes->post('upload_files', 'Ordentrabajo::upload_files');
$routes->get('barcode/(:num)', 'Ordentrabajo::imprimir_codigo_safekat/$1', ['as' => "getOrdenTrabajoBarCode"]);
/**======================
* PDF
*========================**/
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
$routes->get('pdf/content/(:num)', 'Ordentrabajo::get_ot_pdf_content/$1');
$routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1');
$routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1');
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
/** PLANNING */
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
$routes->get('select/maquina/rotativa', 'Ordentrabajo::select_maquina_planning_rot');
$routes->get('select/papel/rotativa', 'Ordentrabajo::select_papel_planning_rot');
$routes->get('select/maquina/plana', 'Ordentrabajo::select_maquina_planning_plana');
$routes->get('select/maquina/padre/plana', 'Ordentrabajo::select_maquina_padre_planning_plana');
$routes->get('select/papel/plana', 'Ordentrabajo::select_papel_planning_plana');
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
$routes->get('papel/plana/datatable', 'Ordentrabajo::papel_pliego_datatable');
$routes->get('maquina/plana/datatable', 'Ordentrabajo::maquina_plana_datatable');
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
$routes->post('tarea/toggle/corte/(:num)', 'Ordentrabajo::tarea_toggle_corte/$1');
});
$routes->group('maquinista', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
/**
* VIEWS
*/
$routes->get('maquinas/view', 'Ordentrabajo::maquinista_maquinas_view', ['as' => 'viewProduccionMaquinistaMaquinas']);
$routes->get('maquinas/view/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_list/$1', ['as' => 'viewProduccionMaquinaTareasList']);
$routes->get('maquinas/view/auto/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_fichaje_automatico/$1', ['as' => 'viewMaquinistaFichajeAutomatico']);
$routes->get('maquinas/view/scan/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_scan/$1', ['as' => 'viewMaquinistaTareaScan']);
$routes->get('maquinas/view/tarea/(:num)', 'Ordentrabajo::maquinista_maquina_tarea_view/$1', ['as' => 'viewProduccionMaquinistaTareaView']);
$routes->get('maquinas/view/maquina/ot/tareas/(:num)', 'Ordentrabajo::maquinista_maquina_ot_tareas_view/$1', ['as' => 'viewProduccionMaquinistaOtTareasView']);
$routes->get('colas/view', 'Ordentrabajo::maquinista_colas_view', ['as' => 'viewProduccionMaquinistaColas']);
/** DATATABLE */
$routes->get('maquinas/tareas/datatable/(:alpha)/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_datatable/$1/$2', ['as' => 'viewMaquinistaMaquinaTareaDatatable']);
$routes->get('maquinas/tareas/aplazadas/datatable/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_aplazada_datatable/$1', ['as' => 'viewMaquinistaMaquinaTareaAplazadaDatatable']);
/** POST */
$routes->post('maquinas/tareas/printLabels', 'Ordentrabajo::printPackagingLabels');
});
});
});
$routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], function ($routes) {
$routes->get('print/label/test', 'LogisticaController::print_test_label');
$routes->get('panel', 'LogisticaController::panel', ['as' => 'LogisticaPanel']);
$routes->get('envios', 'LogisticaController::gestionEnvios', ['as' => 'gestionEnvios']);
$routes->get('enviosFerros', 'LogisticaController::gestionEnviosFerros', ['as' => 'gestionEnviosFerros']);
$routes->get('etiquetasLogistica', 'LogisticaController::etiquetasLogistica', ['as' => 'etiquetasLogistica']);
$routes->get('datatableEnvios', 'LogisticaController::datatable_envios');
$routes->get('datatableLineasEnvios/(:num)', 'LogisticaController::datatable_enviosEdit/$1');
$routes->get('envio/(:num)', 'LogisticaController::editEnvio/$1');
$routes->get('selectAddLinea', 'LogisticaController::selectAddEnvioLinea');
$routes->get('addLineaEnvio', 'LogisticaController::addEnvioLinea');
$routes->post('updateCajaLinea', 'LogisticaController::setCajaLinea');
$routes->post('deleteLineasEnvio', 'LogisticaController::deleteLineas');
$routes->post('updateLineaEnvio', 'LogisticaController::updateLineaEnvio');
$routes->post('updateComentariosEnvio', 'LogisticaController::saveComments');
$routes->post('updateCajasEnvio', 'LogisticaController::updateCajasEnvio');
$routes->post('updateCodigoSeguimiento', 'LogisticaController::updateCodigoSeguimiento');
$routes->post('updateProveedorEnvio', 'LogisticaController::updateProveedorEnvio');
$routes->post('finalizarEnvio', 'LogisticaController::finalizarEnvio');
$routes->post('generateEnvio', 'LogisticaController::generarEnvio');
$routes->post('generateEnvioFerro', 'LogisticaController::generarEnvioFerro');
$routes->get('selectForNewEnvio', 'LogisticaController::findForNewEnvio');
$routes->get('selectDireccionForEnvio', 'LogisticaController::selectDireccionForEnvio');
$routes->post('imprimirEtiquetas', 'LogisticaController::imprimirEtiquetas');
$routes->post('ficharEmbalaje', 'LogisticaController::ficharEmbalaje');
$routes->get('datatableProximosEnvios/(:num)', 'LogisticaController::datatable_proximosEnvios/$1');
$routes->get('listAlbaranes', 'LogisticaController::listAlbaranes', ['as' => 'albaranesList']);
});
$routes->group('etiquetasTitulos', ['namespace' => 'App\Controllers\Logistica'], function ($routes) {
$routes->get('otList', 'EtiquetasTitulosController::findOTs');
$routes->get('addList', 'EtiquetasTitulosController::findAddresses');
$routes->post('newEtiquetaTitulos', 'EtiquetasTitulosController::addEtiqueta');
$routes->get('datatable', 'EtiquetasTitulosController::datatable');
$routes->post('delete', 'EtiquetasTitulosController::deleteEtiqueta');
$routes->get('edit/(:num)', 'EtiquetasTitulosController::edit/$1');
$routes->get('datatableLineas/(:num)', 'EtiquetasTitulosController::datatableLineasEtiquetas/$1');
$routes->get('findOts', 'EtiquetasTitulosController::findOtsWithAddress');
$routes->post('addLineas', 'EtiquetasTitulosController::addLineasEtiqueta');
$routes->post('deleteLineas', 'EtiquetasTitulosController::deleteLineasEtiqueta');
$routes->post('updateLineas', 'EtiquetasTitulosController::updateLineasEtiqueta');
$routes->post('updateComentarios', 'EtiquetasTitulosController::updateComentarios');
$routes->post('updateOrdenCajas', 'EtiquetasTitulosController::updateOrdenCajas');
$routes->post('renumber', 'EtiquetasTitulosController::renumberCajas');
$routes->post('imprimirEtiquetas', 'EtiquetasTitulosController::imprimirEtiquetas');
});
/*
* --------------------------------------------------------------------
* Translation
* --------------------------------------------------------------------
*/
$routes->group('translate', ['namespace' => 'App\Controllers'], function ($routes) {
$routes->post('getTranslation', 'Language::getTranslation', ['as' => 'getKeys']);
$routes->get('lang/(:segment)', 'Language::file/$1');
});
$routes->resource('translate', ['namespace' => 'App\Controllers', 'controller' => 'Language', 'except' => '']);
/*
* --------------------------------------------------------------------
* Additional Routing

View File

@ -0,0 +1,27 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/*
* --------------------------------------------------------------------
* APIs Route Definitions
* --------------------------------------------------------------------
*/
$routes->post('auth/jwt', '\App\Controllers\Sistema\AuthAPIController::jwtLogin');
$routes->group(
'api',
[
'namespace' => 'App\Controllers\API',
'filter' => 'jwt'
],
static function ($routes) {
$routes->post("calcular", 'ImprimelibrosApi::calcular');
$routes->post("guardar", 'ImprimelibrosApi::guardar');
// ...
}
);

View File

@ -0,0 +1,30 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/* Rutas para tarifas */
$routes->group('catalogo', ['namespace' => 'App\Controllers\Catalogo'], function ($routes) {
/* Libros */
$routes->group('libros', ['namespace' => 'App\Controllers\Catalogo'], function ($routes) {
/**======================
* CRUD
*========================**/
$routes->get('', 'CatalogoLibros::index', ['as' => 'catalogoLibrosList']);
$routes->get('gettarifas', 'CatalogoLibros::getSelect2');
$routes->match(['get', 'post'], 'add', 'CatalogoLibros::add', ['as' => 'catalogoLibrosAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'CatalogoLibros::edit/$1', ['as' => 'catalogoLibrosEdit']);
$routes->get('delete/(:num)', 'CatalogoLibros::delete/$1', ['as' => 'catalogoLibrosDelete']);
$routes->get('datatable', 'CatalogoLibros::datatable', ['as' => 'catalogoLibrosDT']);
/**======================
* AJAX
*========================**/
$routes->get('clientlist', 'CatalogoLibros::getClientList', ['as' => 'catalogoLibrosClientList']);
$routes->get('pedidosAntiguos', 'CatalogoLibros::datatablePedidosAntiguos', ['as' => 'catalogoLibrosPedidosAntiguosDT']);
});
});

View File

@ -0,0 +1,28 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/* Compras */
$routes->group('compras', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
$routes->group('proveedores', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
$routes->get('', 'Proveedores::index', ['as' => 'proveedorList']);
$routes->get('add', 'Proveedores::add', ['as' => 'newProveedor']);
$routes->post('add', 'Proveedores::add', ['as' => 'createProveedor']);
$routes->post('create', 'Proveedores::create', ['as' => 'ajaxCreateProveedor']);
$routes->put('(:num)/update', 'Proveedores::update/$1', ['as' => 'ajaxUpdateProveedor']);
$routes->get('edit/(:num)', 'Proveedores::edit/$1', ['as' => 'editProveedor']);
$routes->post('edit/(:num)', 'Proveedores::edit/$1', ['as' => 'updateProveedor']);
$routes->post('datatable', 'Proveedores::datatable', ['as' => 'dataTableOfProveedores']);
$routes->get('delete/(:num)', 'Proveedores::delete/$1', ['as' => 'deleteProveedores']);
$routes->post('allmenuitems', 'Proveedores::allItemsSelect', ['as' => 'select2ItemsOfProveedores']);
$routes->post('menuitems', 'Proveedores::menuItems', ['as' => 'menuItemsOfProveedores']);
$routes->get('getProveedores', 'Proveedores::getForSelect');
});
});
$routes->group('proveedorestipos', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
$routes->post('menuitems', 'ProveedoresTipos::menuItems', ['as' => 'menuItemsOfProveedoresTipos']);
});

View File

@ -0,0 +1,162 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/* Rutas para configuraciones */
$routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
/* Paises */
$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Paises::index', ['as' => 'paisList']);
$routes->get('add', 'Paises::add', ['as' => 'newPais']);
$routes->post('add', 'Paises::add', ['as' => 'createPais']);
$routes->get('delete/(:num)', 'Paises::delete/$1');
$routes->post('create', 'Paises::create', ['as' => 'ajaxCreatePais']);
$routes->put('update/(:num)', 'Paises::update/$1', ['as' => 'ajaxUpdatePais']);
$routes->match(['get', 'post'], 'edit/(:num)', 'Paises::edit/$1', ['as' => 'updatePais']);
$routes->get('datatable', 'Paises::datatable', ['as' => 'dataTableOfPaises']);
$routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
$routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
$routes->get('menuitems2', 'Paises::menuItems2', ['as' => 'menuItemsOfPaises2']);
});
/* Papeles genericos */
$routes->group('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Papelesgenericos::index', ['as' => 'papelGenericoList']);
$routes->delete('', 'Papelesgenericos::index', ['as' => 'papelGenericoList2']);
$routes->get('add', 'Papelesgenericos::add', ['as' => 'newPapelGenerico']);
$routes->post('add', 'Papelesgenericos::add', ['as' => 'createPapelGenerico']);
$routes->post('create', 'Papelesgenericos::create', ['as' => 'ajaxCreatePapelGenerico']);
$routes->put('(:num)/update', 'Papelesgenericos::update/$1', ['as' => 'ajaxUpdatePapelGenerico']);
$routes->match(['get', 'post'], 'edit/(:num)', 'Papelesgenericos::edit/$1', ['as' => 'updatePapelGenerico']);
$routes->post('datatable', 'Papelesgenericos::datatable', ['as' => 'dataTableOfPapelesGenericos']);
$routes->post('allmenuitems', 'Papelesgenericos::allItemsSelect', ['as' => 'select2ItemsOfPapelesGenericos']);
$routes->post('menuitems', 'Papelesgenericos::menuItems', ['as' => 'menuItemsOfPapelesGenericos']);
$routes->get('getpapelcliente', 'Papelesgenericos::getPapelCliente', ['as' => 'getPapelCliente']);
$routes->get('selectpapelespecial', 'Papelesgenericos::selectPapelEspecial', ['as' => 'selectPapelEspecial']);
});
/* Papeles impresion */
$routes->group('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Papelesimpresion::index', ['as' => 'papelImpresionList']);
$routes->get('add', 'Papelesimpresion::add', ['as' => 'newPapelImpresion']);
$routes->post('add', 'Papelesimpresion::add', ['as' => 'createPapelImpresion']);
$routes->post('create', 'Papelesimpresion::create', ['as' => 'ajaxCreatePapelImpresion']);
$routes->put('(:num)/update', 'Papelesimpresion::update/$1', ['as' => 'ajaxUpdatePapelImpresion']);
$routes->match(['get', 'post'], 'edit/(:num)', 'Papelesimpresion::edit/$1', ['as' => 'updatePapelImpresion']);
$routes->post('datatable', 'Papelesimpresion::datatable', ['as' => 'dataTableOfPapelesImpresion']);
$routes->post('allmenuitems', 'Papelesimpresion::allItemsSelect', ['as' => 'select2ItemsOfPapelesImpresion']);
$routes->post('menuitems', 'Papelesimpresion::menuItems', ['as' => 'menuItemsOfPapelesImpresion']);
$routes->post('duplicate/(:num)', 'Papelesimpresion::duplicate/$1', ['as' => 'duplicatePapelImpresion']);
$routes->get('select', 'Papelesimpresion::papel_impresion_select', ['as' => 'papelImpresionSelect']);
$routes->get('show/(:num)', 'Papelesimpresion::papel_impresion_find/$1', ['as' => 'showPapelImpresion']);
});
/* Maquinas */
$routes->group('maquinas', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Maquinas::index', ['as' => 'maquinaList']);
$routes->get('add', 'Maquinas::add', ['as' => 'newMaquina']);
$routes->get('edit/(:num)', 'Maquinas::edit/$1');
$routes->get('delete/(:num)', 'Maquinas::delete/$1');
$routes->post('add', 'Maquinas::add', ['as' => 'createMaquina']);
$routes->post('create', 'Maquinas::create', ['as' => 'ajaxCreateMaquina']);
$routes->put('update/(:num)', 'Maquinas::update/$1', ['as' => 'ajaxUpdateMaquina']);
$routes->match(['get', 'post'], 'edit/(:num)', 'Maquinas::edit/$1', ['as' => 'updateMaquina']);
$routes->post('datatable', 'Maquinas::datatable', ['as' => 'dataTableOfMaquinas']);
$routes->post('allmenuitems', 'Maquinas::allItemsSelect', ['as' => 'select2ItemsOfMaquinas']);
$routes->post('menuitems', 'Maquinas::menuItems', ['as' => 'menuItemsOfMaquinas']);
$routes->post('duplicate/(:num)', 'Maquinas::duplicate/$1', ['as' => 'duplicateMaquina']);
$routes->get('(:num)', 'Maquinas::find_maquina/$1', ['as' => 'findMaquina']);
$routes->get('select', 'Maquinas::select', ['as' => 'selectMaquinas']);
});
/* Maquinas por defecto */
$routes->group('maquinasdefecto', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Maquinasdefecto::index', ['as' => 'maquinaPorDefectoList']);
$routes->get('add', 'Maquinasdefecto::add', ['as' => 'newMaquinaPorDefecto']);
$routes->post('add', 'Maquinasdefecto::add', ['as' => 'createMaquinaPorDefecto']);
$routes->post('create', 'Maquinasdefecto::create', ['as' => 'ajaxCreateMaquinaPorDefecto']);
$routes->put('(:num)/update', 'Maquinasdefecto::update/$1', ['as' => 'ajaxUpdateMaquinaPorDefecto']);
$routes->match(['get', 'post'], 'edit/(:num)', 'Maquinasdefecto::edit/$1', ['as' => 'updateMaquinaPorDefecto']);
$routes->post('datatable', 'Maquinasdefecto::datatable', ['as' => 'dataTableOfMaquinasPorDefecto']);
$routes->post('allmenuitems', 'Maquinasdefecto::allItemsSelect', ['as' => 'select2ItemsOfMaquinasPorDefecto']);
$routes->post('menuitems', 'Maquinasdefecto::menuItems', ['as' => 'menuItemsOfMaquinasPorDefecto']);
});
/* Ubicaciones */
$routes->group('ubicaciones', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Ubicaciones::index', ['as' => 'ubicacionesList']);
$routes->match(['get', 'post'], 'add', 'Ubicaciones::add', ['as' => 'ubicacionesAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'Ubicaciones::edit/$1', ['as' => 'ubicacionesEdit']);
$routes->get('delete/(:num)', 'Ubicaciones::delete/$1', ['as' => 'ubicacionesDelete']);
$routes->post('datatable', 'Ubicaciones::datatable', ['as' => 'ubicacionesDT']);
});
/* Permisos y roles */
$routes->group('group', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'Group::index', ['as' => 'userGroupList']);
$routes->get('index', 'Group::index', ['as' => 'groupIndex']);
$routes->post('edit/(:num)', 'Group::edit/$1', ['as' => 'updateGroup']);
$routes->get('edit/(:num)', 'Group::edit/$1', ['as' => 'editGroup']);
$routes->get('delete/(:num)', 'Group::delete/$1', ['as' => 'deleteGroup']);
$routes->get('add', 'Group::add', ['as' => 'newGroup']);
$routes->post('add', 'Group::add', ['as' => 'createGroup']);
});
/* Series Factura */
$routes->group('series-facturas', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'SeriesFacturas::index', ['as' => 'seriesFacturasList']);
$routes->match(['get', 'post'], 'add', 'SeriesFacturas::add', ['as' => 'seriesFacturasAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'SeriesFacturas::edit/$1', ['as' => 'seriesFacturasEdit']);
$routes->get('delete/(:num)', 'SeriesFacturas::delete/$1', ['as' => 'seriesFacturasDelete']);
$routes->post('datatable', 'SeriesFacturas::datatable', ['as' => 'seriesFacturasDT']);
$routes->post('menuitemsFacturas', 'SeriesFacturas::menuItemsFacturas', ['as' => 'menuItemsOfSeriesFacturas']);
});
/* Variables del sistema */
$routes->group("variables", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'ConfigVariables::index', ['as' => 'variablesIndex']);
$routes->get('find/(:num)', 'ConfigVariables::get/$1', ['as' => 'variablesFind']);
$routes->post('edit/(:num)', 'ConfigVariables::updateVariable/$1', ['as' => 'updateVariable']);
$routes->delete('delete/(:num)', 'ConfigVariables::delete/$1', ['as' => 'deleteVariable']);
$routes->get('datatable', 'ConfigVariables::datatable', ['as' => 'datatableVariables']);
});
/* Errores en presupuestos */
$routes->group("errores-presupuesto", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'ConfigErrores::index', ['as' => 'erroresPresupuestoIndex']);
$routes->get('edit/(:num)', 'ConfigErrores::viewForm/$1', ['as' => 'erroresPresupuestoViewForm']);
$routes->get('get/(:num)', 'ConfigErrores::get_error_presupuesto/$1', ['as' => 'erroresPresupuestoGetErrorPresupuesto']);
$routes->get('datatable', 'ConfigErrores::datatable', ['as' => 'erroresPresupuestoDatatable']);
$routes->post('edit/(:num)', 'ConfigErrores::update_error_presupuesto/$1', ['as' => 'erroresPresupuestoUpdate']);
});
$routes->group("maquina-tareas", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'MaquinaTarea::index', ['as' => 'maquinaTareaList']);
$routes->get('(:num)', 'MaquinaTarea::show/$1', ['as' => 'maquinaTareaShow']);
$routes->delete('(:num)', 'MaquinaTarea::delete/$1', ['as' => 'maquinaTareaDelete']);
$routes->post('', 'MaquinaTarea::store/$1', ['as' => 'maquinaTareaStore']);
$routes->post('update/(:num)', 'MaquinaTarea::update_servicio_cliente/$1', ['as' => 'maquinaTareaUpdate']);
$routes->get('edit/(:num)', 'MaquinaTarea::viewForm/$1', ['as' => 'maquinaTareaViewForm']);
$routes->get('datatable', 'MaquinaTarea::datatable', ['as' => 'maquinaTareaDatatable']);
});
$routes->group("messages", ["namespace" => 'App\Controllers\Chat'], function ($routes) {
$routes->get('', 'ChatController::config_view', ['as' => 'configMessagesIndex']);
});
/* Festivos */
$routes->group("festivos", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
$routes->get('', 'FestivoController::index', ['as' => 'festivosList']);
$routes->post('', 'FestivoController::store_festivo_date', ['as' => 'storeFestivoDate']);
$routes->delete('(:num)', 'FestivoController::delete_festivo_date/$1', ['as' => 'deleteFestivoDate']);
$routes->get('all', 'FestivoController::find_all', ['as' => 'getFindAllFestivos']);
});
});

View File

@ -0,0 +1,39 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/* Rutas para tarifas */
$routes->group('importador', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
/* Desde Catalogo */
$routes->group('catalogo', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
/**======================
* Tool
*========================**/
$routes->get('', 'ImportadorCatalogo::index', ['as' => 'importadorCatalogoTool']);
/**======================
* AJAX
*========================**/
$routes->post('validar-fila', 'ImportadorCatalogo::validarFila');
$routes->post('importar-fila', 'ImportadorCatalogo::importarFila');
});
/* Desde Cliente Bubok */
$routes->group('bubok', ['namespace' => 'App\Controllers\Importadores'], function ($routes) {
/**======================
* Tool
*========================**/
$routes->get('', 'ImportadorBubok::index', ['as' => 'importadorBubokTool']);
/**======================
* AJAX
*========================**/
$routes->post('validar-fila', 'ImportadorBubok::validarFila');
$routes->post('importar-fila', 'ImportadorBubok::importarFila');
});
});

View File

@ -0,0 +1,72 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
$routes->group('presupuestoadmin', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->get('list/(:num)', 'Presupuestoadmin::list/$1', ['as' => 'presupuestoAdminList']); // HOMOGENIZAR CON ARGS DINAMICOS!!!
$routes->get('add/(:num)', 'Presupuestoadmin::add/$1', ['as' => 'newPresupuestoAdmin']);
$routes->get('edit/(:any)', 'Presupuestoadmin::edit/$1', ['as' => 'editarPresupuestoAdmin']);
$routes->post('add/(:num)', 'Presupuestoadmin::add/$1', ['as' => 'createPresupuestoAdmin']);
$routes->post('create', 'Presupuestoadmin::create', ['as' => 'ajaxCreatePresupuestoAdmin']);
$routes->put('(:num)/update', 'Presupuestoadmin::update/$1', ['as' => 'ajaxUpdatePresupuestoAdmin']);
$routes->post('edit/(:num)', 'Presupuestoadmin::edit/$1', ['as' => 'updatePresupuestoAdmin']);
$routes->post('datatable', 'Presupuestoadmin::datatable', ['as' => 'dataTableOfPresupuestoAdmin']);
$routes->post('datatable_2', 'Presupuestoadmin::datatable_2', ['as' => 'updateDataOfPresupuestoAdmin']);
$routes->post('allmenuitems', 'Presupuestoadmin::allItemsSelect', ['as' => 'select2ItemsOfPresupuestoAdmin']);
$routes->post('menuitems', 'Presupuestoadmin::menuItems', ['as' => 'menuItemsOfPresupuestoAdmin']);
$routes->get('checklomointerior', 'Presupuestoadmin::checkLomo');
$routes->get('cargar/(:any)', 'Presupuestoadmin::cargar/$1');
$routes->post('comparadorinterior', 'Presupuestoadmin::obtenerComparadorInterior');
$routes->post('comparadorexteriores', 'Presupuestoadmin::obtenerComparadorExteriores');
$routes->post('comparadorguardas', 'Presupuestoadmin::obtenerComparadorGuardas');
$routes->get('papelgenerico', 'Presupuestoadmin::getPapelGenerico');
$routes->get('papelgramaje', 'Presupuestoadmin::getGramaje');
$routes->get('papelimpresion', 'Presupuestoadmin::getPapelImpresion');
$routes->get('maquinas', 'Presupuestoadmin::getMaquinas');
$routes->post('getlinea', 'Presupuestoadmin::getLineaPresupuesto');
$routes->post('clone', 'Presupuestoadmin::datatable_2');
$routes->get('presupuestosCliente', 'Presupuestoadmin::tablaClienteForm');
$routes->get('getSumCliente/(:num)', 'Presupuestoadmin::obtenerTotalPresupuestosCliente/$1');
$routes->get('hasFiles', 'Presupuestoadmin::hasFiles');
$routes->post('reprint', 'Presupuestoadmin::reprintPresupuesto');
$routes->post('download_zip', 'Presupuestocliente::download_zip', ['as' => 'descargarAdminArchivos']);
});
//$routes->resource('presupuestoadmin', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestoadmin', 'except' => 'show,new,create,update']);
$routes->group('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->get('list', 'Presupuestocliente::list', ['as' => 'listaPresupuestos']);
$routes->post('datatable', 'Presupuestocliente::datatable', ['as' => 'datatableOfPresupuestos']);
$routes->get('add', 'Presupuestocliente::add', ['as' => 'nuevoPresupuestoCliente']);
$routes->post('add', 'Presupuestocliente::add', ['as' => 'crearPresupuestoCliente']);
$routes->post('edit/(:num)', 'Presupuestocliente::edit/$1', ['as' => 'editarPresupuestoCliente']);
$routes->get('edit/(:any)', 'Presupuestocliente::edit/$1', ['as' => 'editarPresupuestoCliente2']);
$routes->post('getgramaje', 'Presupuestocliente::getGramaje', ['as' => 'obtenerGramaje']);
$routes->post('presupuesto', 'Presupuestocliente::presupuesto', ['as' => 'presupuestoCliente']);
$routes->post('getDireccionesCliente', 'Presupuestocliente::getDireccionesCliente', ['as' => 'getDirecciones']);
$routes->post('getNuevaDireccion', 'Presupuestocliente::getNuevaDireccion', ['as' => 'nuevaDireccion']);
$routes->post('guardar', 'Presupuestocliente::guardar', ['as' => 'guardar']);
$routes->get('cargar/(:num)', 'Presupuestocliente::cargar/$1', ['as' => 'cargarPresupuesto']);
$routes->post('duplicarPresupuesto', 'Presupuestocliente::duplicarPresupuesto', ['as' => 'duplicarPresupuesto']);
$routes->post('calcular', 'Presupuestocliente::calcular', ['as' => 'calcularPresupuesto']);
$routes->post('calcularsolapas', 'Presupuestocliente::calcularMaxSolapas', ['as' => 'calcularSolapas']);
$routes->post('checklomo', 'Presupuestocliente::check_lomo_interior');
$routes->post('download_zip', 'Presupuestocliente::download_zip', ['as' => 'descargarClienteArchivos']);
});
//$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
$routes->group('importador', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->get('', 'Importadorpresupuestos::index', ['as' => 'importadorPresupuestos']);
$routes->get('clientlist', 'Importadorpresupuestos::getClientList', ['as' => 'clientList']);
$routes->get('presupuestoslist', 'Importadorpresupuestos::getPresupuestosList', ['as' => 'presupuestosList']);
$routes->get('getencuadernacion', 'Importadorpresupuestos::getEncuadernacionList');
$routes->get('getpresupuestodata', 'Importadorpresupuestos::getPresupuesto', ['as' => 'getPresupuesto']);
$routes->post('importar', 'Importadorpresupuestos::importarPresupuesto');
});

View File

@ -0,0 +1,13 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/* Rutas para tarifas */
$routes->group('scripts', ['namespace' => 'App\Controllers\Scripts'], function ($routes) {
//$routes->get('completar-identidades', 'UsersIntegrity::completarIdentidades');
});

View File

@ -0,0 +1,35 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/* Rutas para tarifas */
$routes->group('sistema', ['namespace' => 'App\Controllers\Sistema'], function ($routes) {
/* Actividad */
$routes->group('actividad', ['namespace' => 'App\Controllers\Sistema'], function ($routes) {
/**======================
* CRUD
*========================**/
$routes->get('', 'Actividad::index', ['as' => 'activityList']);
$routes->post('datatable', 'Actividad::datatable', ['as' => 'activityDT']);
});
/* Backups */
$routes->group('backups', function ($routes) {
/**======================
* Tool
*========================**/
$routes->get('', 'Backups::index', ['as' => 'backupsList']);
$routes->get('create', 'Backups::create', ['as' => 'backupsCreate']);
$routes->get('create-dev', 'Backups::createDevelopment', ['as' => 'backupsCreateDev']);
$routes->get('backups/download/(:segment)', 'Backups::download/$1', ['as' => 'backupsDownload']);
$routes->get('delete-local/(:num)', 'Backups::deleteLocal/$1', ['as' => 'backupsDeleteLocal']);
$routes->get('delete-local-dev/(:segment)', 'Backups::deleteLocalDevelopment/$1', ['as' => 'backupsDeleteLocalDev']);
$routes->get('restore/(:segment)/local', 'Backups::restoreLocal/$1', ['as' => 'backupsRestoreLocal']);
$routes->get('restore/(:segment)/remote', 'Backups::restoreRemote/$1', ['as' => 'backupsRestoreRemote']);
});
});

View File

@ -0,0 +1,55 @@
<?php
use CodeIgniter\Router\RouteCollection;
/** @var RouteCollection $routes */
/* Rutas para tarifas */
$routes->group('tarifas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
/* Maquinas */
$routes->group('maquinas', ['namespace' => 'App\Controllers\Tarifas\Maquinas'], function ($routes) {
$routes->post('acabado', 'TarifaMaquinas::add_tarifa_acabado_maquina_with_tarea');
$routes->post('manipulado', 'TarifaMaquinas::add_tarifa_manipulado_maquina_with_tarea');
$routes->post('preimpresion', 'TarifaMaquinas::add_tarifa_preimpresion_maquina_with_tarea');
$routes->post('encuadernacion', 'TarifaMaquinas::add_tarifa_encuadernacion_maquina_with_tarea');
$routes->post('extra', 'TarifaMaquinas::add_tarifa_extra_maquina_with_tarea');
$routes->delete('acabado/(:num)', 'TarifaMaquinas::delete_tarifa_acabado_maquina_with_tarea/$1');
$routes->delete('manipulado/(:num)', 'TarifaMaquinas::delete_tarifa_manipulado_maquina_with_tarea/$1');
$routes->delete('preimpresion/(:num)', 'TarifaMaquinas::delete_tarifa_preimpresion_maquina_with_tarea/$1');
$routes->delete('encuadernacion/(:num)', 'TarifaMaquinas::delete_tarifa_encuadernacion_maquina_with_tarea/$1');
$routes->delete('extra/(:num)', 'TarifaMaquinas::delete_tarifa_extra_maquina_with_tarea/$1');
$routes->get('acabado/select', 'TarifaMaquinas::get_select_maquina_acabado');
$routes->get('manipulado/select', 'TarifaMaquinas::get_select_maquina_manipulado');
$routes->get('impresion/select', 'TarifaMaquinas::get_select_maquina_impresion');
$routes->get('encuadernacion/select', 'TarifaMaquinas::get_select_maquina_manipulado');
$routes->get('tareas/select', 'TarifaMaquinas::get_select_maquina_tareas');
$routes->get('acabado/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_acabado_maquina/$1');
$routes->get('manipulado/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_manipulado_maquina/$1');
$routes->get('preimpresion/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_preimpresion_maquina/$1');
$routes->get('encuadernacion/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_encuadernacion_maquina/$1');
$routes->get('extra/datatable/(:num)', 'TarifaMaquinas::get_datatable_tarifa_extra_maquina/$1');
});
/* Acabados */
$routes->group('acabados', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
$routes->get('', 'TarifaAcabados::index', ['as' => 'tarifaAcabadoList']);
$routes->get('gettarifas', 'TarifaAcabados::getSelect2');
$routes->match(['get', 'post'], 'add', 'TarifaAcabados::add', ['as' => 'tarifaAcabadoAdd']);
$routes->match(['get', 'post'], 'edit/(:num)', 'TarifaAcabados::edit/$1', ['as' => 'tarifaAcabadoEdit']);
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);
$routes->get('select', 'TarifaAcabados::show_select', ["as" => "showSelectTarifaAcabado"]);
$routes->group('lineas', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
$routes->post('datatable', 'TarifaAcabadosLineas::datatable', ['as' => 'tarifaAcabadoLineasDT']);
$routes->post('datatable_editor', 'TarifaAcabadosLineas::datatable_editor', ['as' => 'tarifaAcabadoLineasDTE']);
$routes->get('delete/(:num)', 'TarifaAcabadosLineas::delete/$1', ['as' => 'tarifaAcabadoLineasDelete']);
});
});
});

3
ci4/app/Config/Routing.php Normal file → Executable file
View File

@ -27,6 +27,7 @@ class Routing extends BaseRouting
*/
public array $routeFiles = [
APPPATH . 'Config/Routes.php',
APPPATH . 'Config/Wiki/WikiRoutes.php',
];
/**
@ -95,7 +96,7 @@ class Routing extends BaseRouting
*
* Default: false
*/
public bool $prioritize = false;
public bool $prioritize = true;
/**
* Map of URI segments and namespaces. For Auto Routing (Improved).

0
ci4/app/Config/Safekat.php Normal file → Executable file
View File

View File

@ -2,7 +2,16 @@
namespace Config;
use App\Services\ChatService;
use App\Services\FTPService;
use App\Services\ImpresoraEtiquetaService;
use App\Services\MaquinaService;
use App\Services\MessageService;
use App\Services\PapelImpresionService;
use CodeIgniter\Config\BaseService;
use App\Services\ProductionService;
use App\Services\TarifaMaquinaService;
use CodeIgniter\Email\Email;
/**
* Services Configuration file.
@ -29,4 +38,40 @@ class Services extends BaseService
* return new \CodeIgniter\Example();
* }
*/
public static function production(){
return new ProductionService();
}
public static function tarifa_maquina(){
return new TarifaMaquinaService();
}
public static function papel_impresion()
{
return new PapelImpresionService();
}
public static function maquina()
{
return new MaquinaService();
}
public static function messages()
{
return new MessageService();
}
public static function chat()
{
return new ChatService();
}
public static function impresora_etiqueta()
{
return new ImpresoraEtiquetaService();
}
public static function emailService($getShared = true)
{
if ($getShared) {
return static::getSharedInstance('emailService');
}
return new \App\Services\EmailService();
}
}

0
ci4/app/Config/Session.php Normal file → Executable file
View File

0
ci4/app/Config/Toolbar.php Normal file → Executable file
View File

View File

@ -34,7 +34,7 @@ class Validation extends BaseConfig
* @var array<string, string>
*/
public array $templates = [
'list' => 'CodeIgniter\Validation\Views\list',
'list' => 'CodeIgniter\Validation\Views\list',
'single' => 'CodeIgniter\Validation\Views\single',
'bootstrap_style' => 'themes/_commonPartialsBs/_form_validation_errors',
];
@ -42,4 +42,195 @@ class Validation extends BaseConfig
// --------------------------------------------------------------------
// Rules
// --------------------------------------------------------------------
/**
* Maquina duplicate validation
*
* @var array
*/
public array $maquina_duplicate = [
"name" => "required|string"
];
/**
* PapelImpresion duplicate validation
*
* @var array
*/
public array $papel_impresion_duplicate = [
"name" => "required|string"
];
/**========================================================================
* TARIFA MAQUINA ACABADO
*========================================================================**/
public array $tarifa_maquina_acabado =
[
"tarifa_acabado_id" => [
"rules" => "required|integer",
"label" => "tarifa acabado",
],
"maquina_id" => [
"rules" => "required|integer",
"label" => "maquina",
],
"maquina_tarea_id" => [
"rules" => "required|integer",
"label" => "tarea",
],
];
public array $tarifa_maquina_manipulado =
[
"tarifa_manipulado_id" => [
"rules" => "required|integer",
"label" => "tarifa acabado",
],
"maquina_id" => [
"rules" => "required|integer",
"label" => "maquina",
],
"maquina_tarea_id" => [
"rules" => "required|integer",
"label" => "tarea",
],
];
public array $tarifa_maquina_preimpresion =
[
"tarifa_preimpresion_id" => [
"rules" => "required|integer",
"label" => "tarifa acabado",
],
"maquina_id" => [
"rules" => "required|integer",
"label" => "maquina",
],
"maquina_tarea_id" => [
"rules" => "required|integer",
"label" => "tarea",
],
];
public array $tarifa_maquina_encuadernacion =
[
"tarifa_encuadernacion_id" => [
"rules" => "required|integer",
"label" => "tarifa acabado",
],
"maquina_id" => [
"rules" => "required|integer",
"label" => "maquina",
],
"maquina_tarea_id" => [
"rules" => "required|integer",
"label" => "tarea",
],
];
public array $tarifa_maquina_extra =
[
"tarifa_extra_id" => [
"rules" => "required|integer",
"label" => "tarifa acabado",
],
"maquina_id" => [
"rules" => "required|integer",
"label" => "maquina",
],
"maquina_tarea_id" => [
"rules" => "required|integer",
"label" => "tarea",
],
];
public array $orden_trabajo_tarea = [
"orden_trabajo_tarea_id" => [
"rules" => "required|integer",
"label" => "tarea"
],
// "tiempo_real" => [
// "rules" => "required|float",
// "label" => "tiempo real"
// ]
];
public array $orden_trabajo_date = [
"orden_trabajo_id" => [
"rules" => "required|integer",
"label" => "tarea"
],
];
public array $orden_trabajo_tarea_progress_date = [
"ot_tarea_id" => [
"rules" => "required|integer",
"label" => "tarea"
],
"estado" => [
"rules" => "required|in_list[P,I,S,D,F,E]",
"label" => "estado"
]
];
public array $orden_trabajo = [
"orden_trabajo_id" => [
"rules" => "required|integer",
"label" => "Orden trabajo"
],
];
public array $orden_trabajo_fichaje_auto = [
"orden_trabajo_id" => [
"rules" => "required|integer",
"label" => "Orden trabajo"
],
"maquina_id" => [
"rules" => "required|integer",
"label" => "Máquina"
],
"estado" => [
"rules" => "required|in_list[P,I,S,D,F,E]",
"label" => "estado"
],
"tareas" => [
"rules" => "required",
"label" => "Tareas"
],
"click_init" => [
"rules" => "required|integer",
"label" => "Click init"
],
"click_end" => [
"rules" => "required|integer",
"label" => "Click end"
],
];
public array $maquina_ordenes_trabajo = [
"ordenes_trabajo" => [
"rules" => "required",
"label" => "Orden trabajo"
],
"maquina_id" => [
"rules" => "required|integer",
"label" => "Máquina"
],
];
public array $chat_department =
[
"display" => [
"rules" => "required|string",
"label" => "tarifa acabado",
],
"description" => [
"rules" => "permit_empty",
"label" => "maquina",
],
];
public array $proveedor_tarea =
[
"proveedor_id" => [
"rules" => "required|integer",
"label" => "Proveedor",
],
"orden_trabajo_tarea_id" => [
"rules" => "required|integer",
"label" => "Tarea",
],
];
}

View File

@ -0,0 +1,20 @@
<?php
use CodeIgniter\Router\RouteCollection;
$routes->group('wiki', ['namespace' => 'App\Controllers\Wiki'], function ($routes) {
$routes->get('','WikiController::index',["as" => "wikiIndex"]);
$routes->get('view/(:segment)','WikiController::show_page/$1',["as" => "showWikiPage"]);
$routes->get('section/(:num)','WikiController::get_section/$1',["as" => "getWikiSection"]);
$routes->post('section','WikiController::store_section',["as" => "storeWikiSection"]);
$routes->delete('section/(:num)','WikiController::delete_section/$1',["as" => "deleteWikiSection"]);
$routes->post('update/section','WikiController::update_section',["as" => "updateWikiSection"]);
$routes->post('save/(:num)','WikiController::store_save_page/$1',["as" => "storeWikiSavePage"]);
$routes->post('publish/(:num)','WikiController::store_publish_page/$1',["as" => "storeWikiPublishPage"]);
$routes->post('file/upload/(:num)','WikiController::wiki_file_upload/$1',["as" => "storeWikiFileUpload"]);
$routes->get('file/(:num)','WikiController::get_wiki_file/$1',["as" => "getWikiFile"]);
$routes->post('section/update/order','WikiController::wiki_section_update_order',["as" => "updateWikiSectionOrder"]);
});

View File

@ -0,0 +1,110 @@
<?php
namespace App\Controllers\API;
use App\Controllers\Presupuestos\Presupuestocliente;
use CodeIgniter\RESTful\ResourceController;
use CodeIgniter\API\ResponseTrait;
class ImprimelibrosApi extends ResourceController
{
use ResponseTrait;
public function calcular()
{
helper(['form']);
$jsonData = json_decode($this->request->getBody(), true);
if (json_last_error() !== JSON_ERROR_NONE) {
return $this->respond(
[
'status' => 400,
'error' => 'Invalid JSON format'
],
400
);
}
// Access the entire POST data
$post_data = $jsonData;
//return $this->respond(var_dump($post_data));
// Instancia de presupuesto cliente
$presupuestocliente = new Presupuestocliente();
$response = $presupuestocliente->calcular($post_data);
if (isset($response['tiradas'])) {
$response = [
'status' => 200,
'error' => null,
'data' => [
'tiradas' => $response['tiradas'],
'precios' => $response['precio_u']
]
];
} else {
$response = [
'status' => 400,
'error' => $response
];
}
return $this->respond($response);
}
public function guardar()
{
helper(['form']);
// Access the entire POST data
$post_data = $this->request->getJSON(true);
//return $this->respond(var_dump($post_data));
// Instancia de presupuesto cliente
$presupuestocliente = new Presupuestocliente();
try {
$response = $presupuestocliente->guardar($post_data);
// DEBUG LINE
//return $this->respond($response);
if (!isset($response['sk_id'])) {
return $this->respond([
'status' => 400,
'error' => 'Missing sk_id',
'message' => 'El identificador sk_id es requerido pero no se recibió.'
], 400);
}
$response = [
'status' => 200,
'error' => null,
'data' => [
'sk_id' => $response['sk_id'],
'sk_url' => $response['sk_url'] ?? null
]
];
return $this->respond($response);
} catch (\Exception $e) {
return $this->respond([
'status' => 500,
'error' => 'Server error',
'message' => 'Error inesperado durante el procesado'
]);
}
}
}

View File

@ -1,507 +0,0 @@
<?php
namespace App\Controllers;
use App\Models\CronTabModel;
use App\Models\NotificationModel;
use App\Models\Usuarios\UserModel;
use App\Models\Usuarios\GroupModel;
use App\Models\Usuarios\GroupsUsersModel;
use App\Models\ActivityModel;
use CodeIgniter\RESTful\ResourceController;
class Ajax extends ResourceController
{
private $user_model;
private $group_model;
private $group_user_model;
private $activity_model;
private $crontab_model;
private $notification_model;
private $id_user;
private $token_user;
function __construct()
{
$this->user_model = new UserModel();
$this->group_model = new GroupModel();
$this->group_user_model = new GroupsUsersModel();
$this->activity_model = new ActivityModel();
$this->crontab_model = new CronTabModel();
$this->notification_model = new NotificationModel();
$this->id_user = session()->get('id_user');
$this->token_user = session()->get('token');
$language = \Config\Services::language();
$language->setLocale(session()->lang);
}
public function index()
{
return redirect()->to('/home');
}
public function getUsers(){
$postData = service('request')->getVar();
if($postData != null && isset($postData->data)){
$dtpostData = $postData->data;
//Read value
$draw = $dtpostData->draw;
$start = $dtpostData->start;
$rowperpage = $dtpostData->length; // Rows display per page
$columnIndex = $dtpostData->order[0]->column; // Column index
$columnName = $dtpostData->columns[$columnIndex]->data; // Column name
$columnSortOrder = $dtpostData->order[0]->dir; // asc or desc
$searchValue = $dtpostData->search->value; // Search value
//Total number of records without filtering
$totalRecords = $this->user_model->select('id_user')
//->join('auth_groups','auth_groups.token = auth_user.group')
->countAllResults();
//Total number of records with filtering
$totalRecordwithFilter = $this->user_model->select('id_user')
//->join('auth_groups','auth_groups.token = auth_user.group')
->orLike('first_name', $searchValue)
->orLike('email', $searchValue)
->countAllResults();
//Fetch records
//$records = $this->user_model->select('auth_user.*,auth_groups.title')
$records = $this->user_model->select('auth_user.*')
//->join('auth_groups','auth_groups.token = auth_user.group')
->orLike('first_name', $searchValue)
->orLike('email', $searchValue)
->orderBy($columnName,$columnSortOrder)
->findAll($rowperpage, $start);
//Format records
foreach ($records as $key => $value){
if($records[$key]['email_confirmed'] == 1){
$records[$key]['email'] = $records[$key]['email'].' '.'<span class="text-success"><i class="fas fa-check-circle"></i></span>';
}
$editLink = site_url('usuarios/user/edit/').$records[$key]['token'];
$records[$key]['options'] = ''.
'<div class="btn-group mr-1 mb-1" xmlns="http://www.w3.org/1999/html">
<button type="button" class="btn btn-primary btn-block dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
'.lang("App.user_grid_options").'
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="'.$editLink.'"><i class="fas fa-edit"></i> '.lang("App.user_btn_edit").'</a>
<button type="button" class="dropdown-item" onclick="delete_user(\''.$records[$key]['token'].'\');"><i class="fas fa-trash"></i> '.lang("App.user_btn_delete").'</button>
</div>
</div>
';
}
//Data records
$data = array();
foreach($records as $record ){
$groups_token = $this->group_user_model->select('token_group')
->where('token_user',$record['token'])
->findAll();
$groups_names = [];
foreach($groups_token as $g_t){
$title = $this->group_model->select('title')
->where('token',$g_t)
->first()['title'];
array_push($groups_names, $title);
}
$data[] = array(
"first_name"=>$record['first_name'],
"email"=>$record['email'],
"group"=>$groups_names,//JJO$record['title'],
"mobile"=>$record['mobile'],
"last_access"=>$record['last_access'],
"last_ip"=>$record['last_ip'],
"created_at"=>$record['created_at'],
"options"=>$record['options']
);
}
//Response
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordwithFilter,
"aaData" => $data,
"token" => csrf_hash() // New token hash
);
return $this->response->setJSON($response);
}else{
return $this->response->setJSON(["error"=>true]);
}
}
public function getGroups(){
$postData = service('request')->getVar();
if($postData != null && isset($postData->data)){
$dtpostData = $postData->data;
//Read value
$draw = $dtpostData->draw;
$start = $dtpostData->start;
$rowperpage = $dtpostData->length; // Rows display per page
$columnIndex = $dtpostData->order[0]->column; // Column index
$columnName = $dtpostData->columns[$columnIndex]->data; // Column name
$columnSortOrder = $dtpostData->order[0]->dir; // asc or desc
$searchValue = $dtpostData->search->value; // Search value
//Total number of records without filtering
$totalRecords = $this->group_model->select('id_group')
->countAllResults();
//Total number of records with filtering
$totalRecordwithFilter = $this->group_model->select('id_group')
->orLike('title', $searchValue)
->countAllResults();
//Fetch records
$records = $this->group_model->select('*')
->orLike('title', $searchValue)
->orderBy($columnName,$columnSortOrder)
->findAll($rowperpage, $start);
//Format records
foreach ($records as $key => $value){
$editLink = site_url('usuarios/group/edit/').$records[$key]['token'];
$records[$key]['options'] = ''.
'<div class="btn-group mr-1 mb-1" xmlns="http://www.w3.org/1999/html">
<button type="button" class="btn btn-primary btn-block dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
'.lang("App.group_grid_options").'
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="'.$editLink.'"><i class="fas fa-edit"></i> '.lang("App.group_btn_edit").'</a>
<button type="button" class="dropdown-item" onclick="delete_group(\''.$records[$key]['token'].'\');"><i class="fas fa-trash"></i> '.lang("App.group_btn_delete").'</button>
</div>
</div>
';
}
//Data records
$data = array();
foreach($records as $record ){
$data[] = array(
"title"=>$record['title'],
"dashboard"=>$record['dashboard'],
"created_at"=>$record['created_at'],
"updated_at"=>$record['updated_at'],
"options"=>$record['options']
);
}
//Response
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordwithFilter,
"aaData" => $data,
"token" => csrf_hash() // New token hash
);
return $this->response->setJSON($response);
}else{
return $this->response->setJSON(["error"=>true]);
}
}
public function getActivities($all=""){
$postData = service('request')->getVar();
if($postData != null && isset($postData->data)){
$dtpostData = $postData->data;
//Read value
$draw = $dtpostData->draw;
$start = $dtpostData->start;
$rowperpage = $dtpostData->length; // Rows display per page
$columnIndex = $dtpostData->order[0]->column; // Column index
$columnName = $dtpostData->columns[$columnIndex]->data; // Column name
$columnSortOrder = $dtpostData->order[0]->dir; // asc or desc
$searchValue = $dtpostData->search->value; // Search value
$session = session();
//Total number of records without filtering
if($session->get('dashboard')=='admin' && !empty($all)){
$totalRecords = $this->activity_model->select('id_activity')
->join('auth_user','auth_user.token = auth_activity.user')
->countAllResults();
}else{
$totalRecords = $this->activity_model->select('id_activity')
->join('auth_user','auth_user.token = auth_activity.user')
->where('auth_activity.user',$session->get('token'))
->countAllResults();
}
//Total number of records with filtering
if($session->get('dashboard')=='admin' && !empty($all)){
$totalRecordwithFilter = $this->activity_model->select('id_activity')
->join('auth_user','auth_user.token = auth_activity.user')
->orLike('first_name', $searchValue)
->countAllResults();
}else{
$totalRecordwithFilter = $this->activity_model->select('id_activity')
->join('auth_user','auth_user.token = auth_activity.user')
->orLike('first_name', $searchValue)
->where('auth_activity.user',$session->get('token'))
->countAllResults();
}
//Fetch records
if($session->get('dashboard')=='admin' && !empty($all)){
$records = $this->activity_model->select('auth_activity.*,concat(first_name, " (",email, ")") AS name')
->join('auth_user','auth_user.token = auth_activity.user')
->orLike('first_name', $searchValue)
->orderBy($columnName,$columnSortOrder)
->findAll($rowperpage, $start);
}else{
$records = $this->activity_model->select('auth_activity.*,concat(first_name, " (",email, ")") AS name')
->join('auth_user','auth_user.token = auth_activity.user')
->orLike('first_name', $searchValue)
->where('auth_activity.user',$session->get('token'))
->orderBy($columnName,$columnSortOrder)
->findAll($rowperpage, $start);
}
//Data records
$data = array();
foreach($records as $record ){
$data[] = array(
"name"=>$record['name'],
"level"=>$record['level'],
"event"=>$record['event'],
"ip"=>$record['ip'],
"os"=>$record['os'],
"browser"=>$record['browser'],
"created_at"=>$record['created_at']
);
}
//Response
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordwithFilter,
"aaData" => $data,
"token" => csrf_hash() // New token hash
);
return $this->response->setJSON($response);
}else{
return $this->response->setJSON(["error"=>true]);
}
}
public function getCronHistory(){
$postData = service('request')->getVar();
if($postData != null && isset($postData->data)){
$dtpostData = $postData->data;
//Read value
$draw = $dtpostData->draw;
$start = $dtpostData->start;
$rowperpage = $dtpostData->length; // Rows display per page
$columnIndex = $dtpostData->order[0]->column; // Column index
$columnName = $dtpostData->columns[$columnIndex]->data; // Column name
$columnSortOrder = $dtpostData->order[0]->dir; // asc or desc
$searchValue = $dtpostData->search->value; // Search value
//Total number of records without filtering
$totalRecords = $this->crontab_model->select('id_crontab')
->countAllResults();
//Total number of records with filtering
$totalRecordwithFilter = $this->crontab_model->select('id_crontab')
->orLike('routine', $searchValue)
->orLike('error', $searchValue)
->countAllResults();
//Fetch records
$records = $this->crontab_model->select('*')
->orLike('routine', $searchValue)
->orLike('error', $searchValue)
->orderBy($columnName,$columnSortOrder)
->findAll($rowperpage, $start);
//Data records
$data = array();
foreach($records as $record ){
$data[] = array(
"routine"=>$record['routine'],
"error"=>$record['error'],
"created_at"=>$record['created_at']
);
}
//Response
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordwithFilter,
"aaData" => $data,
"token" => csrf_hash() // New token hash
);
return $this->response->setJSON($response);
}else{
return $this->response->setJSON(["error"=>true]);
}
}
public function getNotification(){
$postData = service('request')->getVar();
if($postData != null && isset($postData->data)){
$dtpostData = $postData->data;
//Read value
$draw = $dtpostData->draw;
$start = $dtpostData->start;
$rowperpage = $dtpostData->length; // Rows display per page
$columnIndex = $dtpostData->order[0]->column; // Column index
$columnName = $dtpostData->columns[$columnIndex]->data; // Column name
$columnSortOrder = $dtpostData->order[0]->dir; // asc or desc
$searchValue = $dtpostData->search->value; // Search value
//Total number of records without filtering
$totalRecords = $this->notification_model->select('id_notification')
->join('user AS sender','notification.user_sender = sender.token','left')
->join('user AS recipient','notification.user_recipient = recipient.token','left')
->countAllResults();
//Total number of records with filtering
$totalRecordwithFilter = $this->notification_model->select('id_notification')
->join('user AS sender','notification.user_sender = sender.token','left')
->join('user AS recipient','notification.user_recipient = recipient.token','left')
->orLike('title', $searchValue)
->orLike('sender.first_name', $searchValue)
->orLike('recipient.first_name', $searchValue)
->countAllResults();
//Fetch records
$records = $this->notification_model->select('notification.token, sender.first_name AS sender, recipient.first_name AS recipient, notification.title, is_send_email, is_read, notification.created_at')
->join('user AS sender','notification.user_sender = sender.token','left')
->join('user AS recipient','notification.user_recipient = recipient.token','left')
->orLike('title', $searchValue)
->orLike('sender.first_name', $searchValue)
->orLike('recipient.first_name', $searchValue)
->orderBy($columnName,$columnSortOrder)
->findAll($rowperpage, $start);
//Format records
foreach ($records as $key => $value){
$records[$key]['options'] = ''.
'<div class="btn-group mr-1 mb-1" xmlns="http://www.w3.org/1999/html">
<button type="button" class="btn btn-primary btn-block dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
'.lang("App.notification_grid_options").'
</button>
<div class="dropdown-menu">
<button type="button" class="dropdown-item" onclick="delete_this(\''.$records[$key]['token'].'\');"><i class="fas fa-trash"></i> '.lang("App.user_btn_delete").'</button>
</div>
</div>
';
}
//Data records
$data = array();
foreach($records as $record ){
$data[] = array(
"sender"=>$record['sender'],
"recipient"=>$record['recipient'],
"title"=>$record['title'],
"is_send_email"=>$record['is_send_email'],
"is_read"=>$record['is_read'],
"created_at"=>$record['created_at'],
"options"=>$record['options']
);
}
//Response
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordwithFilter,
"aaData" => $data,
"token" => csrf_hash() // New token hash
);
return $this->response->setJSON($response);
}else{
return $this->response->setJSON(["error"=>true]);
}
}
public function getMyNotification(){
$postData = service('request')->getVar();
if($postData != null && isset($postData->data)){
$dtpostData = $postData->data;
//Read value
$draw = $dtpostData->draw;
$start = $dtpostData->start;
$rowperpage = $dtpostData->length; // Rows display per page
$columnIndex = $dtpostData->order[0]->column; // Column index
$columnName = $dtpostData->columns[$columnIndex]->data; // Column name
$columnSortOrder = $dtpostData->order[0]->dir; // asc or desc
$searchValue = $dtpostData->search->value; // Search value
//Total number of records without filtering
$totalRecords = $this->notification_model->select('id_notification')
->join('user AS sender','notification.user_sender = sender.token','left')
->join('user AS recipient','notification.user_recipient = recipient.token','left')
->where('user_recipient',$this->token_user)
->countAllResults();
//Total number of records with filtering
$totalRecordwithFilter = $this->notification_model->select('id_notification')
->join('user AS sender','notification.user_sender = sender.token','left')
->join('user AS recipient','notification.user_recipient = recipient.token','left')
->orLike('title', $searchValue)
->where('user_recipient',$this->token_user)
->countAllResults();
//Fetch records
$records = $this->notification_model->select('notification.token, sender.first_name AS sender, recipient.first_name AS recipient, notification.title, is_read, notification.created_at')
->join('user AS sender','notification.user_sender = sender.token','left')
->join('user AS recipient','notification.user_recipient = recipient.token','left')
->orLike('title', $searchValue)
->where('user_recipient',$this->token_user)
->orderBy($columnName,$columnSortOrder)
->findAll($rowperpage, $start);
//Format records
foreach ($records as $key => $value){
$records[$key]['options'] = '<a class="btn btn-primary" href="/my/notification_view/'.$records[$key]['token'].'"><i class="fas fa-eye"></i> '.lang("App.notification_view_btn").'</a>';
}
//Data records
$data = array();
foreach($records as $record ){
$data[] = array(
"sender"=>$record['sender'],
"recipient"=>$record['recipient'],
"title"=>$record['title'],
"created_at"=>$record['created_at'],
"is_read"=>$record['is_read'],
"options"=>$record['options']
);
}
//Response
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordwithFilter,
"aaData" => $data,
"token" => csrf_hash() // New token hash
);
return $this->response->setJSON($response);
}else{
return $this->response->setJSON(["error"=>true]);
}
}
}

View File

@ -0,0 +1,642 @@
<?php
namespace App\Controllers\Albaranes;
use App\Entities\Albaranes\AlbaranEntity;
use App\Models\Albaranes\AlbaranModel;
use Hermawan\DataTables\DataTable;
class Albaran extends \App\Controllers\BaseResourceController
{
protected $modelName = AlbaranModel::class;
protected $format = 'json';
protected static $singularObjectNameCc = 'albaran';
protected static $singularObjectName = 'Albaran';
protected static $pluralObjectName = 'Albaranes';
protected static $controllerSlug = 'albaran';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
public function index()
{
}
public function delete($id = null)
{
if ($this->request->isAJAX()) {
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$model_linea->where('albaran_id', $id)->delete();
$this->model->where('id', $id)->delete();
$data = [
'error' => 0,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function editAlbaran($albaran_id){
$albaran = $this->model->find($albaran_id);
if ($albaran == false) {
return redirect()->to(base_url('albaranesList'));
}
$this->viewData['boxTitle'] = lang('Albaran.editAlbaran') . ' ' . $albaran->numero_albaran;
$this->viewData['albaranId'] = $albaran_id;
return view('themes/vuexy/form/logistica/albaranes/viewAlbaranesEdit', $this->viewData);
}
public function addLinea($albaran_id)
{
if ($this->request->isAJAX()) {
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
// si es un post, es el iva
if ($this->request->getPost()) {
$reqData = $this->request->getPost();
$albaran_id = $reqData['albaran_id'] ?? 0;
$albaran = $this->model->find($albaran_id);
if ($albaran == false) {
$data = [
'error' => 'Albaran no encontrado',
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
}
$presupuesto_model = model('App\Models\Presupuestos\PresupuestoModel');
$presupuesto = $presupuesto_model->find($albaran->presupuesto_id);
if ($presupuesto == false) {
$data = [
'error' => 'Presupuesto no encontrado',
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
}
$iva_reducido = $presupuesto->iva_reducido;
$lineas = $model_linea->where('albaran_id', $albaran_id)->findAll();
$total = 0;
foreach ($lineas as $linea) {
$total += $linea->total;
}
$iva = $iva_reducido ? $total * 4.0 / 100 : $total * 21.0 / 100;
$data_linea = [
'albaran_id' => $albaran_id,
'titulo' => $iva_reducido ? lang('Pedidos.iva4') : lang('Pedidos.iva21'),
'cantidad' => 1,
'precio_unidad' => round($iva, 2),
'total' => round($iva, 2),
'user_created_id' => auth()->user()->id,
'user_updated_id' => auth()->user()->id
];
$id_linea = $model_linea->insert($data_linea);
$linea = $model_linea->find($id_linea);
$data = [
'error' => 0,
'data' => $linea,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
$linea = [
'albaran_id' => $albaran_id,
'user_created_id' => auth()->user()->id,
'user_updated_id' => auth()->user()->id
];
$id_linea = $model_linea->insert($linea);
$data = $model_linea->find($id_linea);
$data = [
'error' => 0,
'data' => $data,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
}
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function add()
{
if ($this->request->isAJAX()) {
$user = auth()->user()->id;
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$reqData = $this->request->getPost();
$pedido_id = $reqData['pedido_id'] ?? 0;
$presupuestos_id = $reqData['presupuestos_id'] ?? 0;
$return_data = $this->model->generarAlbaranes($pedido_id, $presupuestos_id, $user);
$data = [
'data' => $return_data,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function updateAlbaran()
{
if ($this->request->isAJAX()) {
$fieldName = $this->request->getPost('fieldName');
$fieldValue = $this->request->getPost('fieldValue');
$id = $this->request->getPost('albaranId');
if ($id == null) {
$data = [
'success' => false,
'message' => lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Pedidos.albaran')), $id]),
];
return $this->respond($data);
}
$albaranEntity = $this->model->find($id);
if ($albaranEntity == false) {
$data = [
'success' => false,
'message' => lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Pedidos.albaran')), $id]),
];
return $this->respond($data);
}
if($fieldName == 'fecha_albaran'){
if($fieldValue == null || $fieldValue == '')
$fieldValue = null;
else
$fieldValue = date('Y-m-d H:i:s', strtotime($fieldValue));
}
$albaranEntity->fill([
$fieldName => $fieldValue,
'user_updated_id' => auth()->user()->id,
]);
$successfulResult = $this->model->skipValidation(true)->update($id, $albaranEntity);
if ($successfulResult) {
$data = [
'success' => true,
'message' => lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.',
];
} else {
$data = [
'success' => false,
'message' => lang('Basic.global.updateError', [lang('Basic.global.record')]) . '.',
];
}
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function updateLinea($id = null)
{
if ($this->request->isAJAX()) {
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
if ($id == null):
$data = [
'error' => 2,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif;
$id = filter_var($id, FILTER_SANITIZE_URL);
$albaranEntity = $model_linea->find($id);
if ($albaranEntity == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Pedidos.albaran')), $id]);
$data = [
'error' => $message,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif;
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
$sanitizedData['user_updated_id'] = auth()->user()->id;
$noException = true;
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()):
try {
$successfulResult = $model_linea->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Pedidos.albaran'))]);
$this->session->setFlashdata('formErrors', $model_linea->errors());
endif;
$albaranEntity->fill($sanitizedData);
endif;
if ($noException && $successfulResult):
$id = $albaranEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
$data = [
'error' => 0,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$data = [
'error' => 1,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function getAlbaranes()
{
if ($this->request->isAJAX()) {
$envio_id = $this->request->getGet('envio_id');
$albaranes = $this->model->getAlbaranesEnvio($envio_id);
$data = [
'status' => true,
'data' => $albaranes,
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function getAlbaran()
{
if ($this->request->isAJAX()) {
$id = $this->request->getGet('id');
$albaran = $this->model->getAlbaranData($id);
$data = [
'success' => true,
'data' => $albaran,
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function generateAlbaran()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
$envio_id = $reqData['envio_id'] ?? 0;
$envio_lineas = $reqData['envio_lineas'] ?? [];
$cajas = $reqData['cajas'] ?? 0;
$response = $this->model->generarAlbaranes($envio_id, $envio_lineas, $cajas);
return $this->respond($response);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function datatable(){
$pedidosFilter = $this->request->getGet('pedidosFilter');
$q = $this->model->getDatatableQuery();
if($pedidosFilter != null && !empty($pedidosFilter)) {
$q->groupStart();
$q->like('t4.id', $pedidosFilter);
$q->groupEnd();
}
$result = DataTable::of($q)
->add(
"action",
callback: function ($q) {
return '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="' . $q->id . '"></i></a>
</div>
';
}
);
return $result->toJson(returnAsObject: true);
}
public function datatablesLineasAlbaran()
{
$albaranId = $this->request->getGet('albaranId');
$model = model('App\Models\Albaranes\AlbaranLineaModel');
$q = $model->getDatatableQuery($albaranId);
$result = DataTable::of($q)
->add(
"action",
callback: function ($q) {
return '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-albaran-lineas mx-2" data-id="' . $q->id . '"></i></a>
</div>
';
}
)
->edit('pedido', function ($q) {
return '<a href="' . base_url('pedidos/edit/' . $q->pedido) . '" target="_blank">' . $q->pedido . '</a>';
})
->edit('unidades', function ($q) {
if(str_contains($q->titulo, 'IVA'))
return null;
else
return '<input type="number" class="form-control form-control-sm input-albaran-linea text-center"
value="' . $q->unidades . '" data-id="' . $q->id . '" data-field="cantidad" />';
})
->edit('titulo', function ($q) {
return '<input type="text" class="form-control form-control-sm input-albaran-linea" value="' . $q->titulo .
'" data-id="' . $q->id . '" data-field="titulo" />';
})
->edit('cajas', function ($q) {
return '<input class="form-control input-albaran-linea
form-control-sm text-center" value="' . $q->cajas . '" data-id="' . $q->id . '" data-field="cajas" />';
})
->edit('unidades_cajas', function ($q) {
return '<input class="form-control input-albaran-linea
form-control-sm text-center" value="' . $q->unidades_cajas . '" data-id="' . $q->id . '" data-field="unidades_cajas" />';
})
->edit('total', function ($q) {
return '<input class="form-control autonumeric-2 input-albaran-linea
form-control-sm text-center" value="' . $q->total . '" data-id="' . $q->id . '" data-field="total" />';
})
->edit('precio_unidad', function ($q) {
if(str_contains($q->titulo, 'IVA'))
return null;
else
return '<input class="form-control autonumeric-4 form-control-sm text-center input-albaran-linea" value="' .
number_format((float) $q->precio_unidad, 4, ',', '') .
'" data-id="' . $q->id . '" data-field="precio_unidad" />';
});
return $result->toJson(returnAsObject: true);
}
public function updateAlbaranLinea(){
if ($this->request->isAJAX()) {
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$fieldName = $this->request->getPost('fieldName');
$fieldValue = $this->request->getPost('fieldValue');
$id = $this->request->getPost('lineaId');
$linea = $model_linea->find($id);
if ($linea == false) {
$data = [
'success' => false,
'message' => lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Pedidos.albaran')), $id]),
];
return $this->respond($data);
}
if($fieldName == 'cantidad') {
$linea->total = round($linea->precio_unidad * intval($fieldValue), 4);
$linea->cantidad = intval($fieldValue);
}
else if($fieldName == 'precio_unidad') {
$fieldValue2 = str_replace(',', '.', $fieldValue);
$linea->total = round(round(floatval($fieldValue2), 4) * intval($linea->cantidad), 2);
$linea->precio_unidad = round(floatval($fieldValue2), 4);
}
else if($fieldName == 'total') {
$linea->total = round(floatval($fieldValue), 2);
$linea->precio_unidad = round(floatval($fieldValue) / intval($linea->cantidad), 4);
}
else{
$linea->$fieldName = $fieldValue;
}
$linea->user_updated_id = auth()->user()->id;
$linea->updated_at = date('Y-m-d H:i:s');
$model_linea->update($id, $linea->toArray());
if($fieldName == 'cajas'){
$cajas = $model_linea->where('albaran_id', $linea->albaran_id)
->where('cajas > 0')
->select('SUM(cajas) as total_cajas')
->get();
$albaranModel = model('App\Models\Albaranes\AlbaranModel');
$albaran = $albaranModel->find($linea->albaran_id);
if($albaran != false) {
$albaran->cajas = $cajas->getRow()->total_cajas;
$albaran->user_updated_id = auth()->user()->id;
$albaran->updated_at = date('Y-m-d H:i:s');
$albaranModel->update($linea->albaran_id, $albaran->toArray());
}
}
$data = [
'success' => true,
'message' => lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.',
];
if($fieldName == 'cajas') {
$data['cajas'] = $cajas->getRow()->total_cajas;
};
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function addLineasIva(){
if ($this->request->isAJAX()) {
$albaran_id = $this->request->getPost('albaranId');
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$lineas_albaran = $model_linea->where('albaran_id', $albaran_id)->findAll();
$iva_reducido = 0;
$iva_no_reducido = 0;
foreach ($lineas_albaran as $linea) {
if($linea->iva_reducido == 1) {
$iva_reducido += round(floatval($linea->total)*0.04, 2);
} else {
$iva_no_reducido += round(floatval($linea->total)*0.21, 2);
}
}
$iva_reducido = round($iva_reducido, 2);
$iva_no_reducido = round($iva_no_reducido, 2);
if($iva_reducido > 0) {
$linea = [
'albaran_id' => $albaran_id,
'titulo' => lang('Albaran.iva4'),
'total' => round($iva_reducido, 2),
'user_created_id' => auth()->user()->id,
'user_updated_id' => auth()->user()->id
];
$model_linea->insert($linea);
}
if($iva_no_reducido > 0) {
$linea = [
'albaran_id' => $albaran_id,
'titulo' => lang('Albaran.iva21'),
'total' => round($iva_no_reducido, 2),
'user_created_id' => auth()->user()->id,
'user_updated_id' => auth()->user()->id
];
$model_linea->insert($linea);
}
$data = [
'success' => true,
'message' => lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.',
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function addBlankLineaAlbaran(){
if ($this->request->isAJAX()) {
$albaran_id = $this->request->getPost('albaranId');
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$linea = [
'albaran_id' => $albaran_id,
'user_created_id' => auth()->user()->id,
'user_updated_id' => auth()->user()->id
];
$id_linea = $model_linea->insert($linea);
$data = $model_linea->find($id_linea);
$data = [
'success' => true,
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function borrarLinea()
{
if ($this->request->isAJAX()) {
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$reqData = $this->request->getPost();
$id = $reqData['linea'] ?? 0;
$id = filter_var($id, FILTER_SANITIZE_URL);
$albaranLineaEntity = $model_linea->find($id);
if ($albaranLineaEntity == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Pedidos.albaran')), $id]);
$data = [
'success' => false,
'error' => $message,
];
return $this->respond($data);
endif;
$successfulResult = $model_linea->skipValidation(true)->update($id, ['deleted_at' => date('Y-m-d H:i:s')]);
if ($successfulResult):
$data = [
'success' => true,
];
else:
$data = [
'success' => false,
'error' => lang('Basic.global.deleteError', [lang('Basic.global.record')]) . '.',
];
endif;
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function borrarAlbaran()
{
if ($this->request->isAJAX()) {
$id = $this->request->getPost('albaranId');
$model_linea = model('App\Models\Albaranes\AlbaranLineaModel');
$model_linea->where('albaran_id', $id)->delete();
$this->model->where('id', $id)->delete();
$data = [
'success' => true
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -2,8 +2,6 @@
namespace App\Controllers;
use App\Models\NotificationModel;
use App\Models\SettingsModel;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\CLIRequest;
use CodeIgniter\HTTP\IncomingRequest;
@ -37,7 +35,7 @@ class BaseController extends Controller
*
* @var array
*/
protected $helpers = ['general', 'go_common'];
protected $helpers = ['general', 'go_common', 'rbac', 'assets'];
/**
* Constructor.

75
ci4/app/Controllers/BaseResourceController.php Normal file → Executable file
View File

@ -43,23 +43,23 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
*/
protected static $pluralObjectName;
/**
/**
* Path for the views directory for the extending view controller
*
* @var string
*
* @var string
*/
protected static $viewPath;
/**
* JJO: Variable para indicar si el controlador hace soft_delete o no
*
*
* @var bool
*/
public $soft_delete = false;
/**
* JJO: Variable quién puede ver los registros borrados
*
*
* 0 -> Not Deleted
* 1 -> Soft Deleted, shows up in lists of deleted items for management users
* 2 -> Soft Deleted, does not show up for any user except admin users
@ -85,7 +85,7 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
*
* @var array
*/
protected $helpers = ['session', 'go_common', 'form', 'text', 'general']; //JJO
protected $helpers = ['session', 'go_common', 'form', 'text', 'general', 'rbac', 'assets']; //JJO
/**
* Initializer method.
@ -123,7 +123,7 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
$this->viewData['usingSweetAlert'] = true;
$this->viewData['viewPath'] = static::$viewPath;
$this->viewData['currentLocale'] = $this->request->getLocale();
/* IMN */
@ -159,7 +159,7 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
}
if (!isset($this->viewData['formAction'])) {
$this->viewData['formAction'] = base_url(strtolower($this->viewData['currentModule']) . '/' . $formActionSuffix . '/' . $action );
$this->viewData['formAction'] = base_url(strtolower($this->viewData['currentModule']) . '/' . $formActionSuffix . '/' . $action);
}
if ((!isset($this->viewData['boxTitle']) || empty($this->viewData['boxTitle'])) && isset(static::$singularObjectName) && !empty(static::$singularObjectName)) {
@ -223,29 +223,28 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
public function delete($id = null)
{
if (!empty(static::$pluralObjectNameCc) && !empty(static::$singularObjectNameCc)) {
$objName = mb_strtolower(lang(ucfirst(static::$pluralObjectNameCc).'.'.static::$singularObjectNameCc));
$objName = mb_strtolower(lang(ucfirst(static::$pluralObjectNameCc) . '.' . static::$singularObjectNameCc));
} else {
$objName = lang('Basic.global.record');
}
if (!$this->soft_delete){
if (!$this->soft_delete) {
if (!$this->model->delete($id)) {
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
}
}
else{
} else {
$datetime = (new \CodeIgniter\I18n\Time("now"));
$rawResult = $this->model->where('id',$id)
->set(['deleted_at' => $datetime->format('Y-m-d H:i:s'),
'is_deleted' => $this->delete_flag])
$rawResult = $this->model->where('id', $id)
->set(['deleted_at' => $datetime->format('Y-m-d H:i:s'),
'is_deleted' => $this->delete_flag])
->update();
if (!$rawResult) {
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
}
}
// $message = lang('Basic.global.deleteSuccess', [$objName]); IMN commented
$message = lang('Basic.global.deleteSuccess', [lang('Basic.global.record')]);
$response = $this->respondDeleted(['id' => $id, 'msg' => $message]);
@ -261,20 +260,18 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
protected function canValidate($customValidationRules = null, $customValidationMessages = null)
{
if($customValidationRules == null){
if ($customValidationRules == null) {
$validationRules = $this->model->validationRules ?? $this->formValidationRules ?? null;
}
else{
} else {
$validationRules = $customValidationRules;
}
if ($validationRules == null) {
return true;
}
if($customValidationMessages == null){
$validationErrorMessages = $this->model->validationMessages ?? $this->formValidationErrorMessagess ?? null;;
}
else{
if ($customValidationMessages == null) {
$validationErrorMessages = $this->model->validationMessages ?? $this->formValidationErrorMessagess ?? null;;
} else {
$validationErrorMessages = $customValidationMessages;
}
@ -283,7 +280,7 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
} else {
$valid = $this->validate($validationRules);
}
$this->validationErrors = $valid ? '' : $this->validator->getErrors();
/*
@ -303,7 +300,8 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
* @param array|null $postData
* @return array
*/
protected function sanitized(array $postData = null, bool $nullIfEmpty = false) {
protected function sanitized(array $postData = null, bool $nullIfEmpty = false)
{
if ($postData == null) {
$postData = $this->request->getPost();
}
@ -317,7 +315,7 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
}
return $sanitizedData;
}
/**
* Custom fail method needed when CSRF token regeneration is on in security settings
* @param string|array $messages
@ -326,15 +324,15 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
* @param string $customMessage
* @return mixed
*/
protected function failWithNewToken($messages, int $status = 400, string $code = null, string $customMessage = '') {
protected function failWithNewToken($messages, int $status = 400, string $code = null, string $customMessage = '')
{
if (! is_array($messages))
{
if (!is_array($messages)) {
$messages = ['error' => $messages];
}
$response = [
'status' => $status,
'error' => $status,
'status' => $status,
'error' => $status,
'messages' => $messages,
csrf_token() => csrf_hash()
];
@ -360,7 +358,8 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
* Convenience method for common exception handling
* @param \Exception $e
*/
protected function dealWithException(\Exception $e) {
protected function dealWithException(\Exception $e)
{
// using another try / catch block to prevent to avoid CodeIgniter bug throwing trivial exceptions for querying DB errors
try {
$query = $this->model->db->getLastQuery();
@ -368,16 +367,16 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
$dbError = $this->model->db->error();
$userFriendlyErrMsg = lang('Basic.global.persistErr1', [static::$singularObjectNameCc]);
if (isset($dbError['code']) && $dbError['code'] == 1062) :
$userFriendlyErrMsg .= PHP_EOL.lang('Basic.global.persistDuplErr', [static::$singularObjectNameCc]);
$userFriendlyErrMsg .= PHP_EOL . lang('Basic.global.persistDuplErr', [static::$singularObjectNameCc]);
endif;
// $userFriendlyErrMsg = str_replace("'", "\'", $userFriendlyErrMsg); // Uncomment if experiencing unescaped single quote errors
log_message('error', $userFriendlyErrMsg.PHP_EOL.$e->getMessage().PHP_EOL.$queryStr);
log_message('error', $userFriendlyErrMsg . PHP_EOL . $e->getMessage() . PHP_EOL . $queryStr);
if (isset($dbError['message']) && !empty($dbError['message'])) :
log_message('error', $dbError['code'].' : '.$dbError['message']);
log_message('error', $dbError['code'] . ' : ' . $dbError['message']);
endif;
$this->viewData['errorMessage'] = $userFriendlyErrMsg;
} catch (\Exception $e2) {
log_message('debug', 'You can probably safely ignore this: In attempt to check DB errors, CodeIgniter threw: '.PHP_EOL.$e2->getMessage());
log_message('debug', 'You can probably safely ignore this: In attempt to check DB errors, CodeIgniter threw: ' . PHP_EOL . $e2->getMessage());
}
}
}

View File

@ -0,0 +1,274 @@
<?php
namespace App\Controllers\Catalogo;
use App\Controllers\BaseResourceController;
use App\Entities\Catalogo\CatalogoLibroEntity;
use App\Models\Catalogo\CatalogoLibroModel;
use App\Models\Clientes\ClienteModel;
use App\Models\Presupuestos\ImportadorModel;
use Hermawan\DataTables\DataTable;
class CatalogoLibros extends BaseResourceController
{
protected $modelName = CatalogoLibroModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Catalogo';
protected static $singularObjectNameCc = 'CatalogoLibros';
protected static $pluralObjectName = 'Catalogos';
protected static $pluralObjectNameCc = 'catalogos';
protected static $controllerSlug = 'catalogo';
protected static $viewPath = 'themes/vuexy/form/catalogo/';
protected $indexRoute = 'CatalogoLibrosList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Catalogo.listingPage');
$this->viewData['usingSweetAlert'] = true;
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_catalogo"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_catalogo_libros"), 'route' => route_to('catalogoLibrosList'), 'active' => true]
];
parent::initController($request, $response, $logger);
}
public function index()
{
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Catalogo.catalogo')]),
'catalogoLibrosEntity' => new CatalogoLibroEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewCatalogoLibrosList', $viewData);
}
public function add()
{
if ($this->request->getPost()):
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, true);
$sanitizedData['user_created_id'] = auth()->user()->id;
unset($sanitizedData['iskn']);
$noException = true;
if ($successfulResult = $this->canValidate()):
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult):
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['catalogoLibrosEntity'] = isset($sanitizedData) ? new CatalogoLibroEntity($sanitizedData) : new CatalogoLibroEntity();
$this->viewData['formAction'] = route_to('catalogoLibrosAdd');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Catalogo.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null)
{
if ($requestedId == null):
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$catalogoLibrosEntity = $this->model->find($id);
if ($catalogoLibrosEntity == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Catalogo.pais')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()):
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, true);
unset($sanitizedData['iskn']);
$sanitizedData['user_update_id'] = auth()->user()->id;
$noException = true;
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Catalogo.catalogo'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$catalogoLibrosEntity->fill($sanitizedData);
$thenRedirect = false;
endif;
if ($noException && $successfulResult):
$id = $catalogoLibrosEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['catalogoLibrosEntity'] = $catalogoLibrosEntity;
$this->viewData['formAction'] = route_to('catalogoLibrosEdit', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Catalogo.moduleTitle') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable()
{
$reqData = $this->request->getGet();
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$q = $this->model->getDatatableQuery()->limit($length, $start);
$result = DataTable::of($q)
->edit(
"portada",
function ($row, $meta) {
if (is_null($row->cubierta_archivo)) {
return '<img class="img-thumbnail" src="' . $row->portada . '" alt="Portada" style="max-height: 80px;">';
} else {
return '';
}
}
)
->add("actionBtns", callback: function ($q) {
$actions = '';
if (auth()->user()->can('catalogo.edit')) {
$actions .= '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
</div>';
}
if (auth()->user()->can('catalogo.delete')) {
$actions .= '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="' . $q->id . '"></i></a>
</div>';
}
return $actions;
});
return $result->toJson(returnAsObject: true);
}
/* IMN */
public function getClientList()
{
$search = $this->request->getGet("q") ?? "";
$data = (new ClienteModel())->getIdName($search);
return $this->response->setJSON($data);
}
/* Historico de pedidos ERP antiguo */
public function datatablePedidosAntiguos()
{
$reqData = $this->request->getGet();
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 10;
$catalogoId = $reqData['catalogo_id'] ?? null;
// Instanciar el modelo directamente
$importadorModel = new ImportadorModel();
$q = $importadorModel->getHistoricoPedidosCatalogo($catalogoId);
return DataTable::of($q)
->setSearchableColumns([
't1.id',
't1.created_at',
't1.tirada',
'(CASE WHEN t1.tirada > 0 THEN t1.total / t1.tirada ELSE 0 END)',
't1.total',
't1.estado'
])
->edit('total', fn($row) => number_format((float) $row->total, 2, ',', '.') . ' €')
->edit('precio_ud', fn($row) => number_format((float) $row->precio_ud, 2, ',', '.') . ' €')
->edit('created_at', fn($row) => date('d/m/Y', strtotime($row->created_at)))
->add('actionBtns', function ($row) {
return '<div class="btn-group btn-group-sm">
<a href="https://gestion.safekat.es/pedido/detail/' . $row->id . '" class="btn btn-sm btn-info" target="_blank">
<i class="ti ti-eye"></i> Ver
</a>
</div>';
}, 'last')
->toJson(returnAsObject: true);
}
}

View File

@ -0,0 +1,817 @@
<?php
namespace App\Controllers\Chat;
use App\Controllers\BaseController;
use App\Models\Chat\ChatDeparmentModel;
use App\Models\Chat\ChatDeparmentUserModel;
use App\Models\Chat\ChatMessageModel;
use App\Models\Chat\ChatModel;
use App\Models\ChatNotification;
use App\Models\ChatUser;
use App\Models\Clientes\ClienteModel;
use App\Models\Facturas\FacturaModel;
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
use App\Models\Pedidos\PedidoModel;
use App\Models\Presupuestos\PresupuestoModel;
use App\Models\Usuarios\UserModel;
use App\Services\ChatService;
use App\Services\MessageService;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\Log\Logger;
use Psr\Log\LoggerInterface;
use Hermawan\DataTables\DataTable;
use CodeIgniter\I18n\Time;
use CodeIgniter\Validation\Validation;
class ChatController extends BaseController
{
protected ChatDeparmentModel $chatDeparmentModel;
protected ChatDeparmentUserModel $chatDeparmentUserModel;
protected ChatModel $chatModel;
protected ChatMessageModel $chatMessageModel;
protected UserModel $userModel;
protected ClienteModel $clienteModel;
protected ChatUser $chatUserModel;
protected ChatNotification $chatNotificationModel;
protected Validation $validation;
protected ChatService $chatService;
protected array $viewData;
protected static $viewPath = 'themes/vuexy/form/mensajes/';
public function initController(
RequestInterface $request,
ResponseInterface $response,
LoggerInterface $logger
) {
parent::initController($request, $response, $logger);
// Add your code here.
$this->chatDeparmentModel = model(ChatDeparmentModel::class);
$this->chatDeparmentUserModel = model(ChatDeparmentUserModel::class);
$this->chatModel = model(ChatModel::class);
$this->chatMessageModel = model(ChatMessageModel::class);
$this->userModel = model(UserModel::class);
$this->clienteModel = model(ClienteModel::class);
$this->chatUserModel = model(ChatUser::class);
$this->chatNotificationModel = model(ChatNotification::class);
$this->validation = service("validation");
$this->chatService = service("chat");
}
public function index() {}
public function get_chat_departments(string $model,int $modelId)
{
$data = $this->chatService->getChatDepartments($model,$modelId);
return $this->response->setJSON($data);
}
public function get_chat_department_select()
{
$query = $this->chatDeparmentModel->getChatDepartmentSelect($this->request->getGet("q"));
return $this->response->setJSON($query->get()->getResultObject());
}
public function get_chat_presupuesto(int $chat_department_id, int $presupuesto_id)
{
$data = [
"department" => $this->chatDeparmentModel->find($chat_department_id),
"chat" => null,
"messages" => null,
"count" => 0,
];
$chat = $this->chatModel->getChatPresupuesto($chat_department_id, $presupuesto_id);
if ($chat) {
$data["messages"] = $this->chatMessageModel->get_chat_messages($chat->id);
$this->chatMessageModel->set_chat_department_messages_as_read($chat->id);
$this->chatModel->setAsViewedChatUserNotifications($chat->id, auth()->user()->id);
$data["count"] = count($data["messages"]);
}
$data["chat"] = $chat;
return $this->response->setJSON($data);
}
public function get_chat_pedido(int $chat_department_id, int $pedido_id)
{
$data = [
"department" => $this->chatDeparmentModel->find($chat_department_id),
"chat" => null,
"messages" => null,
"count" => 0,
];
$chat = $this->chatModel->getChatPedido($chat_department_id, $pedido_id);
if ($chat) {
$data["messages"] = $this->chatMessageModel->get_chat_messages($chat->id);
$this->chatMessageModel->set_chat_department_messages_as_read($chat->id);
$this->chatModel->setAsViewedChatUserNotifications($chat->id, auth()->user()->id);
$data["count"] = count($data["messages"]);
}
$data["chat"] = $chat;
return $this->response->setJSON($data);
}
public function get_chat_factura(int $chat_department_id, int $factura_id)
{
$data = [
"department" => $this->chatDeparmentModel->find($chat_department_id),
"chat" => null,
"messages" => null,
"count" => 0,
];
$chat = $this->chatModel->getChatFactura($chat_department_id, $factura_id);
if ($chat) {
$data["messages"] = $this->chatMessageModel->get_chat_messages($chat->id);
$this->chatMessageModel->set_chat_department_messages_as_read($chat->id);
$this->chatModel->setAsViewedChatUserNotifications($chat->id, auth()->user()->id);
$data["count"] = count($data["messages"]);
}
$data["chat"] = $chat;
return $this->response->setJSON($data);
}
public function get_chat_orden_trabajo(int $chat_department_id, int $orden_trabajo_id)
{
$data = [
"department" => $this->chatDeparmentModel->find($chat_department_id),
"chat" => null,
"messages" => null,
"count" => 0,
];
$chat = $this->chatModel->getChatOrdenTrabajo($chat_department_id, $orden_trabajo_id);
if ($chat) {
$data["messages"] = $this->chatMessageModel->get_chat_messages($chat->id);
$this->chatMessageModel->set_chat_department_messages_as_read($chat->id);
$this->chatModel->setAsViewedChatUserNotifications($chat->id, auth()->user()->id);
$data["count"] = count($data["messages"]);
}
$data["chat"] = $chat;
return $this->response->setJSON($data);
}
public function get_chat_direct_view($chat_id)
{
$chat = $this->chatModel->find($chat_id);
$this->viewData['breadcrumb'] = [
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
];
$this->viewData["chatId"] = $chat_id;
$auth_user = auth()->user();
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
return view(static::$viewPath . 'messageChat', $this->viewData);
}
public function get_chat_presupuesto_view($chat_id)
{
$chat = $this->chatModel->find($chat_id);
$this->viewData['breadcrumb'] = [
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
];
$this->viewData["modelId"] = $chat->presupuesto_id;
$this->viewData["type"] = "presupuesto";
$auth_user = auth()->user();
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
if ($chat->chat_department_id) {
return view(static::$viewPath . 'messageChatPresupuesto', $this->viewData);
} else {
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
}
}
public function get_chat_pedido_view($chat_id)
{
$chat = $this->chatModel->find($chat_id);
$this->viewData['breadcrumb'] = [
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
];
$this->viewData["modelId"] = $chat->pedido_id;
$this->viewData["type"] = "pedido";
$auth_user = auth()->user();
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
if ($chat->chat_department_id) {
return view(static::$viewPath . 'messageChatPedido', $this->viewData);
} else {
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
}
}
public function get_chat_factura_view($chat_id)
{
$chat = $this->chatModel->find($chat_id);
$this->viewData['breadcrumb'] = [
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
];
$this->viewData["modelId"] = $chat->factura_id;
$this->viewData["type"] = "factura";
$auth_user = auth()->user();
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
if ($chat->chat_department_id) {
return view(static::$viewPath . 'messageChatFactura', $this->viewData);
} else {
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
}
}
public function get_chat_ot_view($chat_id)
{
$chat = $this->chatModel->find($chat_id);
$this->viewData['breadcrumb'] = [
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
];
$this->viewData["modelId"] = $chat->orden_trabajo_id;
$this->viewData["type"] = "ot";
$auth_user = auth()->user();
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
if ($chat->chat_department_id) {
return view(static::$viewPath . 'messageChatFactura', $this->viewData);
} else {
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
}
}
public function get_chat(int $chat_id)
{
$data = $this->chatModel->getChat($chat_id);
return $this->response->setJSON($data);
}
public function store_message($model)
{
$data = $this->request->getPost();
$chatMessageEntity = $this->chatService->storeChatMessage($data["chat_department_id"],$model,$data["model_id"],$data);
return $this->response->setJSON($chatMessageEntity);
}
public function store_chat_message_single()
{
$data = $this->request->getPost();
$existChat = $this->chatMessageModel->get_chat_contact_messages($data["receiver_id"]);
if (count($existChat) > 0) {
$chatId = $existChat[0]->chat_id;
} else {
$chatId = $this->chatModel->createChatSingle();
}
$chat_message_id = $this->chatMessageModel->insert(
[
"chat_id" => $chatId,
"sender_id" => auth()->user()->id,
"message" => $data["message"],
"receiver_id" => $data["receiver_id"],
]
);
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id, "user_id" => $data["receiver_id"]]);
$dataResponse = $this->chatMessageModel->find($chat_message_id);
return $this->response->setJSON($dataResponse);
}
public function get_chat_internal_contacts()
{
$auth_user = auth()->user();
if ($auth_user->cliente_id) {
$users = $this->chatModel->getOpenChatCliente($auth_user->id);
} else {
$users = $this->userModel->builder()
->whereNotIn("id", [$auth_user->id])
->where("deleted_at", null)
->get()->getResultObject();
}
foreach ($users as $user) {
$user->unreadMessages = $this->chatMessageModel->get_chat_messages_count($user->id);
}
usort($users, fn($a, $b) => $a->unreadMessages < $b->unreadMessages);
return $this->response->setJSON($users);
}
public function get_chat_internal_contact(int $user_id)
{
$auth_user = auth()->user();
// if ($auth_user->cliente_id) {
// return $this->response->setJSON([]);
// }
$users = $this->userModel->builder()
->where("deleted_at", null)
->where("id", $user_id)
->get()->getFirstRow();
return $this->response->setJSON($users);
}
public function get_chat_internal_messages(int $user_id)
{
$conversation = $this->chatMessageModel->get_chat_contact_messages($user_id);
return $this->response->setJSON($conversation);
}
public function get_chat_cliente()
{
$cliente_id = auth()->user()->cliente_id;
$response = $this->chatService->getAuthUserNotifications();
return $this->response->setJSON($response);
}
public function get_chat_department_presupuesto_users(int $chat_department_id, int $presupuesto_id)
{
$data = $this->chatDeparmentModel->find($chat_department_id)->withUsers($presupuesto_id, 'presupuesto');
return $this->response->setJSON($data);
}
public function get_chat_department_pedido_users(int $chat_department_id, $pedido_id)
{
$data = $this->chatDeparmentModel->find($chat_department_id)->withUsers($pedido_id, 'pedido');
return $this->response->setJSON($data);
}
public function get_chat_department_factura_users(int $chat_department_id, $factura_id)
{
$data = $this->chatDeparmentModel->find($chat_department_id)->withUsers($factura_id, 'factura');
return $this->response->setJSON($data);
}
public function get_chat_department_orden_trabajo_users(int $chat_department_id, $orden_trabajo_id)
{
$data = $this->chatDeparmentModel->find($chat_department_id)->withUsers($orden_trabajo_id, 'ot');
return $this->response->setJSON($data);
}
public function get_chat_users_internal()
{
$query = $this->userModel->builder()->select(
[
"id",
"CONCAT(first_name,' ',last_name,'(',username,')') as name"
]
)->where("cliente_id", null)
->where("deleted_at", null)
->whereNotIn("id", [auth()->user()->id]);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("users.username", $this->request->getGet("q"))
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
}
public function get_chat_users_all()
{
$query = $this->userModel->builder()->select(
[
"id",
"CONCAT(first_name,' ',last_name) as name"
]
)
->where("deleted_at", null)
->whereNotIn("id", [auth()->user()->id]);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
}
public function get_presupuesto_client_users(int $presupuesto_id)
{
$pm = model(PresupuestoModel::class);
$p = $pm->find($presupuesto_id);
$cm = model(ClienteModel::class);
$clienteContactos = $cm->querySelectClienteContacto($p->cliente_id,$this->request->getGet('q'));
return $this->response->setJSON($clienteContactos);
}
public function get_pedido_client_users(int $pedido_id)
{
$pm = model(PedidoModel::class);
$p = $pm->find($pedido_id);
$cm = model(ClienteModel::class);
$clienteContactos = $cm->querySelectClienteContacto($p->cliente()->id,$this->request->getGet('q'));
return $this->response->setJSON($clienteContactos);
}
public function get_factura_client_users(int $factura_id)
{
$fm = model(FacturaModel::class);
$f = $fm->find($factura_id);
$cm = model(ClienteModel::class);
$clienteContactos = $cm->querySelectClienteContacto($f->cliente_id,$this->request->getGet('q'));
return $this->response->setJSON($clienteContactos);
}
public function get_orden_trabajo_client_users(int $orden_trabajo_id)
{
$otm = model(OrdenTrabajoModel::class);
$ot = $otm->find($orden_trabajo_id);
$cm = model(ClienteModel::class);
$cliente = $ot->pedido()->cliente();
$clienteContactos = $cm->querySelectClienteContacto($cliente->id,$this->request->getGet('q'));
return $this->response->setJSON($clienteContactos);
}
public function store_hebra(string $model)
{
$auth_user = auth()->user();
$bodyData = $this->request->getPost();
$status = $this->chatService->storeHebra($model,$bodyData['modelId'],$bodyData);
return $this->response->setJSON(["message" => "Hebra creada correctamente", "status" => $status]);
}
public function update_hebra($chat_id)
{
$bodyData = $this->request->getPost();
$chatMessageId = $this->chatMessageModel->insert([
"chat_id" => $chat_id,
"message" => $bodyData["message"],
"sender_id" => auth()->user()->id
]);
$actualUsers = $this->chatUserModel->builder()->select("user_id")->where("chat_id", $chat_id)->get()->getResultArray();
$actualUsersArray = array_map(fn($x) => $x["user_id"], $actualUsers);
if (isset($bodyData["users"])) {
foreach ($bodyData["users"] as $userId) {
if (in_array($userId, $actualUsersArray) == false) {
$chatUserData = ["user_id" => $userId, "chat_id" => $chat_id];
$this->chatUserModel->insert($chatUserData);
}
$this->chatNotificationModel->insert(
["chat_message_id" => $chatMessageId, "user_id" => $userId]
);
}
}
return $this->response->setJSON(["message" => "Hebra actualizada correctamente", "status" => true]);
}
public function get_hebra(string $model,int $modelId)
{
$data = $this->chatService->getHebras($model,$modelId);
return $this->response->setJSON($data);
}
public function datatable_messages()
{
$auth_user_id = auth()->user()->id;
$isAdmin = auth()->user()->inGroup('admin');
$query = $this->chatModel->getQueryDatatable();
return DataTable::of($query)
->edit('created_at', fn($q) => Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i"))
->edit('updated_at', fn($q) => Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i"))
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->id, $auth_user_id))
->add("action", fn($q) => [
"type" => "direct",
"modelId" => $q->id,
"isAdmin" => $isAdmin,
"chatMessageId" => $q->chatMessageId,
"lang" => [
"view_chat" => lang('Chat.view_chat'),
"view_by_alt_message" => lang('Chat.view_by_alt_message')
]
])
->toJson(true);
}
public function datatable_presupuesto_messages()
{
$auth_user_id = auth()->user()->id;
$isAdmin = auth()->user()->inGroup('admin');
$query = $this->chatModel->getQueryDatatableMessagePresupuesto($auth_user_id);
return DataTable::of($query)
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
->edit('updated_at', fn($q) => $q->updated_at ? Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i") : "")
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->chatMessageId))
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
->add("action", fn($q) => ["type" => "presupuesto", "modelId" => $q->id, "isAdmin" => $isAdmin,"chatMessageId" => $q->chatMessageId, "lang" => [
"view_chat" => lang('Chat.view_chat'),
"view_by_alt_message" => lang('Chat.view_by_alt_message')
]])
->toJson(true);
}
public function datatable_pedido_messages()
{
$auth_user_id = auth()->user()->id;
$isAdmin = auth()->user()->inGroup('admin');
$query = $this->chatModel->getQueryDatatableMessagePedido($auth_user_id);
return DataTable::of($query)
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
->edit('updated_at', fn($q) => $q->updated_at ? Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i") : "")
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->chatMessageId))
->add("action", fn($q) => ["type" => "pedido", "modelId" => $q->id, "isAdmin" => $isAdmin,"chatMessageId" => $q->chatMessageId, "lang" => [
"view_chat" => lang('Chat.view_chat'),
"view_by_alt_message" => lang('Chat.view_by_alt_message')
]])
->toJson(true);
}
public function datatable_factura_messages()
{
$auth_user_id = auth()->user()->id;
$isAdmin = auth()->user()->inGroup('admin');
$query = $this->chatModel->getQueryDatatableMessageFactura($auth_user_id);
return DataTable::of($query)
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
->edit('updated_at', fn($q) => $q->updated_at ? Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i") : "")
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->chatMessageId))
->add("action", fn($q) => ["type" => "factura", "modelId" => $q->id, "isAdmin" => $isAdmin,"chatMessageId" => $q->chatMessageId, "lang" => [
"view_chat" => lang('Chat.view_chat'),
"view_by_alt_message" => lang('Chat.view_by_alt_message')
]])
->toJson(true);
}
public function datatable_ot_messages()
{
$auth_user_id = auth()->user()->id;
$isAdmin = auth()->user()->inGroup('admin');
$query = $this->chatModel->getQueryDatatableMessageOrdenTrabajo($auth_user_id);
return DataTable::of($query)
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
->edit('updated_at', fn($q) => $q->updated_at ? Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i") : "")
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->chatMessageId))
->add("action", fn($q) => ["type" => "ot", "modelId" => $q->id, "isAdmin" => $isAdmin,"chatMessageId" => $q->chatMessageId, "lang" => [
"view_chat" => lang('Chat.view_chat'),
"view_by_alt_message" => lang('Chat.view_by_alt_message')
]])
->toJson(true);
}
public function datatable_direct_messages()
{
$auth_user_id = auth()->user()->id;
$isAdmin = auth()->user()->inGroup('admin');
$query = $this->chatModel->getQueryDatatableDirectMessages($auth_user_id);
return DataTable::of($query)
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
->edit('updated_at', fn($q) => $q->updated_at ? Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i") : "")
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->chatMessageId))
->add("action", fn($q) => ["type" => "direct", "modelId" => $q->id, "isAdmin" => $isAdmin,"chatMessageId" => $q->chatMessageId, "lang" => [
"view_chat" => lang('Chat.view_chat'),
"view_by_alt_message" => lang('Chat.view_by_alt_message')
]])
->toJson(true);
}
public function get_notifications_not_viewed_from_message(int $chat_message_id)
{
$unviewedNotifications = $this->chatModel->getUsersNotificationNotViewedFromChat($chat_message_id);
// $viewedNotifications = $this->chatModel->getUsersNotificationViewedFromChat($chat_message_id);
return $this->response->setJSON(
[
"data" => [
"notifications" => $unviewedNotifications,
],
"chat_message_id" => $chat_message_id
]
);
}
public function store_new_direct_message()
{
$bodyData = $this->request->getPost();
$rules = [
"title" => "required|string",
"message" => "required|string",
"users" => "required",
];
if (!$this->validate($rules)) {
return $this->response->setStatusCode(400)->setJSON([
'message' => lang('App.global_alert_save_error'),
'status' => 'error',
'errors' => $this->validator->getErrors(),
]);
}
$this->chatModel->createNewDirectChat(...$bodyData);
return $this->response->setJSON(["message" => lang("Chat.new_message_ok"), "status" => true]);
}
public function store_new_direct_message_client()
{
$bodyData = $this->request->getPost();
$rules = [
"title" => "required|string",
"message" => "required|string",
"chat_department_id" => "required",
];
if (!$this->validate($rules)) {
return $this->response->setStatusCode(400)->setJSON([
'message' => lang('App.global_alert_save_error'),
'status' => 'error',
'errors' => $this->validator->getErrors(),
]);
}
$users = $this->chatDeparmentModel->getChatDepartmentUsers($bodyData["chat_department_id"]);
$bodyData["users"] = array_map(fn($q) => $q->id, $users);
dd(1);
$this->chatModel->createNewDirectChat(...$bodyData);
return $this->response->setJSON(["message" => lang("Chat.new_message_ok"), "status" => true]);
}
public function get_chat_direct($chat_id)
{
$chatData = $this->chatModel->getChatDirect($chat_id);
return $this->response->setJSON($chatData);
}
public function get_chat_direct_select_users($chat_id)
{
$chat_users_id = $this->chatUserModel->getChatUserArrayId($chat_id);
$query = $this->userModel->builder()->select(
[
"id",
"CONCAT(first_name,' ',last_name) as name"
]
)
->where("deleted_at", null)
->whereNotIn("id", $chat_users_id);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
}
public function store_chat_direct_users($chat_id)
{
$bodyData = $this->request->getPost();
$chat_users = [];
foreach ($bodyData["users"] as $user_id) {
$chat_users[] = ["chat_id" => $chat_id, "user_id" => $user_id];
if ($bodyData["notification"]) {
$this->chatModel->createNotificationsToNewChatUser($chat_id, $user_id);
}
}
$this->chatUserModel->insertBatch($chat_users);
return $this->response->setJSON(["message" => "ok", "status" => true]);
}
public function store_chat_direct_message(int $chat_id)
{
$bodyData = $this->request->getPost();
$auth_user = auth()->user();
$bodyData["sender_id"] = $auth_user->id;
$chat_message_id = $this->chatMessageModel->insert($bodyData);
$users_id = $this->chatUserModel->getChatUserArrayId($chat_id);
foreach ($users_id as $user_id) {
if ($user_id != $auth_user->id) {
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id, "user_id" => $user_id]);
}
};
$message = $this->chatMessageModel->get_chat_message($chat_message_id);
return $this->response->setJSON($message);
}
public function update_chat_direct_message_unread($chat_id)
{
$this->chatModel->setAsUnviewedChatUserNotifications($chat_id, auth()->user()->id);
return $this->response->setJSON(["message" => "ok", "status" => true]);
}
public function store_chat_error_message()
{
$bodyData = $this->request->getPost();
$messageService = service('messages');
$r = $messageService->createErrorMessagePresupuesto("Error", $bodyData['presupuesto_id']);
return $this->response->setJSON(["message" => "ok", "data" => $r]);
}
public function delete_user_from_department($chat_department_id)
{
$data = $this->request->getRawInput();
$user_id = auth()->user()->id;
$adminExist = $this->chatDeparmentUserModel->where('chat_department_id', $chat_department_id)
->where('user_id', $user_id)
->where('pedido_id', null)
->where('factura_id', null)
->where('presupuesto_id', null)->countAllResults();
if ($adminExist) {
return $this->response->setJSON(["message" => lang('Chat.exit_admin_chat_wrong'), "status" => false]);
}
$chatDepartmentUserEntity = $this->chatDeparmentUserModel->where('chat_department_id', $chat_department_id)->where('user_id', $user_id)->where($data['model_fk'], $data['model_id_fk']);
if ($chatDepartmentUserEntity->countAllResults() > 0) {
$deleted = $this->chatDeparmentUserModel->where('chat_department_id', $chat_department_id)->where('user_id', $user_id)->delete(purge: true);
return $this->response->setJSON(["message" => lang('Chat.exit_chat_ok'), "status" => true]);
} else {
return $this->response->setJSON(["message" => lang('Chat.exit_chat_wrong'), "status" => false]);
}
}
public function delete_user_admin_from_department($chat_department_id, $user_id)
{
$this->chatDeparmentUserModel->where('chat_department_id', $chat_department_id)->where('user_id', $user_id)->delete();
return $this->response->setJSON(["message" => lang('Chat.user_deleted_ok'), "status" => true]);
}
public function subscribe_to_chat_deparment()
{
$data = $this->request->getPost();
$user_id = auth()->user()->id;
$adminExist = $this->chatDeparmentUserModel->where('chat_department_id', $data['chat_department_id'])
->where('user_id', $user_id)
->where('pedido_id', null)
->where('factura_id', null)
->where('presupuesto_id', null)->countAllResults();
if ($adminExist) {
return $this->response->setJSON(["message" => lang('Chat.subscribe_chat_wrong'), "status" => false]);
}
$chatDepartmentUserEntity = $this->chatDeparmentUserModel->where('chat_department_id', $data['chat_department_id'])->where('user_id', $user_id)->where($data['model_fk'], $data['model_id_fk']);
if ($chatDepartmentUserEntity->countAllResults() > 0) {
return $this->response->setJSON(["message" => lang('Chat.subscribe_chat_wrong'), "status" => false]);
} else {
$this->chatDeparmentUserModel->insert(["chat_department_id" => $data["chat_department_id"], "user_id" => $user_id, $data['model_fk'] => $data['model_id_fk']]);
return $this->response->setJSON(["message" => lang('Chat.subscribe_chat_ok'), "status" => true]);
}
}
public function subscribe_admin_to_department()
{
$data = $this->request->getPost();
if ($data['user_id']) {
$this->chatDeparmentUserModel
->insert(
[
"chat_department_id" => $data["chat_department_id"],
"user_id" => $data["user_id"],
]
);
return $this->response->setJSON(["message" => lang('Chat.subscribe_admin_chat_ok'), "status" => true]);
} else {
return $this->response->setStatusCode(422)->setJSON(["message" => lang('Chat.subscribe_admin_chat_wrong'), "status" => false]);
}
}
public function config_view()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => 'javascript:void(0);', 'active' => false],
['title' => lang("App.menu_config_messages"), 'route' => route_to("configMessagesIndex"), 'active' => true]
];
return view('themes/vuexy/form/configuracion/messages/configView', $this->viewData);
}
public function chat_department_edit($chat_department_id)
{
$chatDepartment = $this->chatDeparmentModel->find($chat_department_id);
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => 'javascript:void(0);', 'active' => false],
['title' => lang("App.menu_config_messages"), 'route' => route_to("configMessagesIndex"), 'active' => false],
['title' => $chatDepartment->display, 'route' => route_to("chatDepartmentEditView", $chat_department_id), 'active' => true]
];
$this->viewData["chat_department"] = $chatDepartment;
return view('themes/vuexy/form/configuracion/messages/editChatDepartmentForm', $this->viewData);
}
public function chat_department_datatable()
{
$q = $this->chatDeparmentModel->datatableQuery();
return DataTable::of($q)
->add('action', fn($r) => $r->id)
->toJson(true);
}
public function chat_department_user_datatable(int $chat_department_id)
{
$q = $this->chatDeparmentUserModel->datatableQuery($chat_department_id);
$datatable = DataTable::of($q);
if (auth()->user()->inGroup('admin')) {
$datatable->add('action', fn($r) => $r->userId);
}
return $datatable->toJson(true);
}
public function select_users_not_in_chat_department(int $chat_department_id)
{
$paramQuery = $this->request->getGet("q");
$data = $this->chatDeparmentUserModel->querySelectUsersNotInDepartment($chat_department_id, $paramQuery);
return $this->response->setJSON($data);
}
public function store_chat_department()
{
$data = $this->request->getPost();
$validated = $this->validation->run($data, 'chat_department');
if ($validated) {
$dataValidated = $this->validation->getValidated();
$dataValidated['name'] = newUUID();
$this->chatDeparmentModel->insert($dataValidated);
return $this->response->setJSON(["message" => lang('App.global_alert_save_success'), "status" => true, "data" => $dataValidated]);
} else {
return $this->response->setStatusCode(422)->setJSON(["message" => lang('App.global_alert_save_success'), "status" => false, "errors" => $this->validation->getErrors()]);
}
return $this->response->setJSON(["message" => lang('App.global_alert_save_success'), "status" => true]);
}
public function update_chat_department(int $chat_department_id)
{
$data = $this->request->getPost();
$validated = $this->validation->run($data, 'chat_department');
if ($validated) {
$dataValidated = $this->validation->getValidated();
$this->chatDeparmentModel->update($chat_department_id, $dataValidated);
return $this->response->setJSON(["message" => lang('App.global_alert_save_success'), "status" => true, "data" => $dataValidated]);
} else {
return $this->response->setStatusCode(422)->setJSON(["message" => lang('App.global_alert_save_success'), "status" => false, "errors" => $this->validation->getErrors()]);
}
}
public function delete_chat_department($chat_department_id)
{
if (auth()->user()->inGroup('admin')) {
$this->chatDeparmentModel->delete($chat_department_id);
return $this->response->setJSON(["message" => lang('App.user_alert_delete'), "status" => true]);
} else {
return $this->response->setStatusCode(403)->setJSON(["message" => lang('App.user_alert_forbidden'), "status" => false]);
}
}
}

View File

@ -1,4 +1,6 @@
<?php namespace App\Controllers\Clientes;
<?php
namespace App\Controllers\Clientes;
@ -152,7 +154,7 @@ class Cliente extends \App\Controllers\BaseResourceController
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
@ -248,11 +250,20 @@ class Cliente extends \App\Controllers\BaseResourceController
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ClienteModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$searchValues = get_filter_datatables_columns($reqData);
$requestedOrder = $reqData['order'] ?? [];
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
$resourceData = $this->model->getResource($searchValues);
foreach ($requestedOrder as $order) {
$column = $order['column'] ?? 0;
$dir = $order['dir'] ?? 'asc';
$orderColumn = ClienteModel::SORTABLE[$column] ?? null;
if ($orderColumn) {
$resourceData->orderBy($orderColumn, $dir);
}
}
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
foreach ($resourceData as $item) :
if (isset($item->direccion) && strlen($item->direccion) > 100) :
$item->direccion = character_limiter($item->direccion, 100);
@ -271,7 +282,7 @@ class Cliente extends \App\Controllers\BaseResourceController
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
$this->model->getResource($searchValues)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
@ -310,14 +321,9 @@ class Cliente extends \App\Controllers\BaseResourceController
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
try{
try {
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
}
catch(Exception $e){
} catch (Exception $e) {
$menu = [];
}
@ -334,6 +340,28 @@ class Cliente extends \App\Controllers\BaseResourceController
}
public function getSelect2()
{
if ($this->request->isAJAX()) {
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->where("deleted_at", null);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("clientes.nombre", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null)
{
$paisModel = model('App\Models\Configuracion\PaisModel');
@ -356,7 +384,7 @@ class Cliente extends \App\Controllers\BaseResourceController
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
if (!is_null($selId)) :
$userModel = model('App\Models\UserModel');
$userModel = model('App\Models\Usuarios\UserModel');
$selOption = $userModel->where('id', $selId)->findColumn('first_name');
if (!empty($selOption)) :
@ -386,7 +414,7 @@ class Cliente extends \App\Controllers\BaseResourceController
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
if (!is_null($selId)) :
$userModel = model('App\Models\UserModel');
$userModel = model('App\Models\Usuarios\UserModel');
$selOption = $userModel->where('id', $selId)->findColumn('last_name');
if (!empty($selOption)) :
@ -399,7 +427,7 @@ class Cliente extends \App\Controllers\BaseResourceController
protected function getFormaDePagoListItems($selId = null)
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('FormasPagoes.formaDePago'))])];
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('FormasPago.formaDePago'))])];
if (!empty($selId)) :
$formaPagoModel = model('App\Models\Configuracion\FormaPagoModel');
@ -427,24 +455,23 @@ class Cliente extends \App\Controllers\BaseResourceController
}
protected function getPrecioTemplate($cliente_id){
protected function getPrecioTemplate($cliente_id)
{
$modelPreciosCliente = model('App\Models\Clientes\ClientePreciosModel');
$plantilla_id = $modelPreciosCliente->get_plantilla_precios($cliente_id);
if (is_null($plantilla_id)){
if (is_null($plantilla_id)) {
return null;
}
$modelPlantillaPreciosCliente = model('App\Models\Clientes\ClientePlantillaPreciosModel');
$plantilla = $modelPlantillaPreciosCliente->where("id", $plantilla_id)->where("is_deleted", 0)->first();
if ($plantilla == false){
$plantilla = $modelPlantillaPreciosCliente->where("id", $plantilla_id)->where("deleted_at", null)->first();
if ($plantilla == false) {
return null;
}
else{
} else {
return (object)array(
"value" => $plantilla_id,
"label" => $plantilla->nombre
);
}
}
}

View File

@ -1,4 +1,5 @@
<?php namespace App\Controllers\Clientes;
<?php
namespace App\Controllers\Clientes;
use App\Controllers\BaseResourceController;
@ -45,40 +46,36 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
parent::initController($request, $response, $logger);
}
public function update($requestedId = null)
public function updatePlantilla()
{
if ($this->request->getPost()) :
if ($requestedId == null) :
return;
endif;
if ($this->request->isAJAX()) {
$postData = $this->request->getJSON();
$postData = $this->request->getPost();
$cliente_id = $postData['cliente_id'] ?? -1;
$plantilla_id = $postData['plantilla_id'] ?? -1;
$plantilla_id = $postData->plantilla_id ?? -1;
// Se ha actualizado un registro por lo que no es una plantilla
if($plantilla_id == -1){
$this->model->clean_plantilla_id($requestedId);
}
else if($requestedId== -1){ // actualizar todos los clientes que usan una plantilla
if ($plantilla_id == -1) {
$this->model->clean_plantilla_id($cliente_id);
} else if ($cliente_id == -1) { // actualizar todos los clientes que usan una plantilla
$this->model->update_from_plantilla($plantilla_id);
} else {
$this->model->copy_from_plantilla($cliente_id, $plantilla_id);
}
else{
$this->model->copy_from_plantilla($requestedId, $plantilla_id);
}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif; // ($requestMethod === 'post')
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
@ -93,92 +90,113 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
$requestedOrder2 = $reqData['order']['1']['column'] ?? $requestedOrder;
$requestedOrder3 = $reqData['order']['2']['column'] ?? $requestedOrder;
$requestedOrder4 = $reqData['order']['3']['column'] ?? $requestedOrder;
$requestedOrder5 = $reqData['order']['4']['column'] ?? $requestedOrder;
$order = ClientePreciosModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
$order2 = ClientePreciosModel::SORTABLE[$requestedOrder2 >= 0 ? $requestedOrder2 : $requestedOrder];
$order3 = ClientePreciosModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder3 : $requestedOrder];
$order4 = ClientePreciosModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder4 : $requestedOrder];
$order5 = ClientePreciosModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder5 : $requestedOrder];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$dir2 = $reqData['order']['1']['dir'] ?? $dir;
$dir3 = $reqData['order']['2']['dir'] ?? $dir;
$dir4= $reqData['order']['3']['dir'] ?? $dir;
$dir5= $reqData['order']['4']['dir'] ?? $dir;
$requestedOrder = $reqData['order'] ?? [];
$searchValues = get_filter_datatables_columns($reqData);
$cliente_id = $reqData['cliente_id'] ?? 0;
$resourceData = $this->model->getResource($cliente_id)
->orderBy($order, $dir)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->orderBy($order4, $dir4)->orderBy($order5, $dir5)
->limit($length, $start)->get()->getResultObject();
$resourceData = $this->model->getResource($searchValues, $cliente_id);
foreach ($requestedOrder as $order) {
$column = $order['column'] ?? 0;
$dir = $order['dir'] ?? 'asc';
$orderColumn = ClientePreciosModel::SORTABLE[$column] ?? null;
if ($orderColumn) {
$resourceData->orderBy($orderColumn, $dir);
}
}
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource($cliente_id)->countAllResults(),
$this->model->getResource($cliente_id)->countAllResults()
$this->model->getResource($searchValues, $cliente_id)->countAllResults(),
$this->model->getResource($searchValues, $cliente_id)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function datatable_editor() {
public function datatable_editor()
{
if ($this->request->isAJAX()) {
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
// Build our Editor instance and process the data coming from _POST
$response = Editor::inst( $db, 'cliente_precios' )
$response = Editor::inst($db, 'cliente_precios')
->fields(
Field::inst( 'plantilla_id' ),
Field::inst( 'cliente_id' ),
Field::inst( 'tipo' ),
Field::inst( 'tipo_maquina' ),
Field::inst( 'tipo_impresion' ),
Field::inst( 'user_updated_id' ),
Field::inst( 'updated_at' ),
Field::inst( 'is_deleted' ),
Field::inst( 'tiempo_min' )
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
->validator( 'Validate::notEmpty',array(
'message' => lang('ClientePrecios.validation.required'))
Field::inst('plantilla_id'),
Field::inst('cliente_id'),
Field::inst('tipo'),
Field::inst('tipo_maquina'),
Field::inst('tipo_impresion'),
Field::inst('user_updated_id'),
Field::inst('updated_at'),
Field::inst('tiempo_min')
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClientePrecios.validation.required')
)
)
->validator('Validate::numeric', array(
->validator(
'Validate::numeric',
array(
"decimal" => ',',
'message' => lang('ClientePrecios.validation.decimal'))
'message' => lang('ClientePrecios.validation.decimal')
)
),
Field::inst( 'tiempo_max' )
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
->validator( 'Validate::notEmpty',array(
'message' => lang('ClientePrecios.validation.required'))
Field::inst('tiempo_max')
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClientePrecios.validation.required')
)
)
->validator('Validate::numeric', array(
"decimal" => ',',
'message' => lang('ClientePrecios.validation.decimal'))
),
Field::inst( 'precio_hora' )
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
->validator( 'Validate::notEmpty',array(
'message' => lang('ClientePrecios.validation.required'))
)
->validator('Validate::numeric', array(
"decimal" => ',',
'message' => lang('ClientePrecios.validation.decimal'))
),
Field::inst( 'margen' )
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
->validator( 'Validate::notEmpty',array(
'message' => lang('ClientePrecios.validation.required'))
)
->validator('Validate::numeric', array(
->validator(
'Validate::numeric',
array(
"decimal" => ',',
'message' => lang('ClientePrecios.validation.decimal'))
'message' => lang('ClientePrecios.validation.decimal')
)
),
Field::inst('precio_hora')
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClientePrecios.validation.required')
)
)
->validator(
'Validate::numeric',
array(
"decimal" => ',',
'message' => lang('ClientePrecios.validation.decimal')
)
),
Field::inst('margen')
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClientePrecios.validation.required')
)
)
->validator(
'Validate::numeric',
array(
"decimal" => ',',
'message' => lang('ClientePrecios.validation.decimal')
)
),
)
@ -186,7 +204,6 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
foreach ($data['data'] as $pkey => $values) {
// Si no se quiere borrar...
if ($data['data'][$pkey]['is_deleted'] != 1) {
$process_data['tiempo_min'] = $data['data'][$pkey]['tiempo_min'];
$process_data['tiempo_max'] = $data['data'][$pkey]['tiempo_max'];
$process_data['tipo'] = $data['data'][$pkey]['tipo'];
@ -198,26 +215,23 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
if (!empty($response)) {
return $response;
}
}
}
}
})
->on('preCreate', function ($editor, &$values) {
$session = session();
$datetime = (new \CodeIgniter\I18n\Time("now"));
$editor
->field('user_updated_id')
->setValue($session->id_user);
->setValue(auth()->user()->id);
$editor
->field('updated_at')
->setValue($datetime->format('Y-m-d H:i:s'));
})
->on('preEdit', function ($editor, &$values) {
$session = session();
$datetime = (new \CodeIgniter\I18n\Time("now"));
$editor
->field('user_updated_id')
->setValue($session->id_user);
->setValue(auth()->user()->id);
$editor
->field('updated_at')
->setValue($datetime->format('Y-m-d H:i:s'));
@ -238,4 +252,16 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
}
}
public function getCurrentPlantilla()
{
if ($this->request->isAJAX()) {
$cliente_id = $this->request->getGet('cliente_id');
$plantilla = $this->model->getPlantilla($cliente_id);
return $this->respond($plantilla);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -1,4 +1,6 @@
<?php namespace App\Controllers\Clientes;
<?php
namespace App\Controllers\Clientes;
use App\Models\Collection;
@ -6,6 +8,8 @@ use App\Entities\Clientes\ClienteDireccionesEntity;
use App\Models\Clientes\ClienteDireccionesModel;
use App\Models\Usuarios\UserModel;
use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Validate;
@ -22,21 +26,69 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
protected static $controllerSlug = 'clientedirecciones';
public function add(){
protected static $viewPath = 'themes/vuexy/form/clientes/direcciones/';
protected $indexRoute = 'clienteDireccionesList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Clientes.direccionesEnvio');
$this->viewData['usingSweetAlert'] = true;
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("Clientes.direccionesEnvio"), 'route' => "javascript:void(0);", 'active' => false],
];
$this->viewData['comunidadAutonomaList'] = $this->getComunidadAutonomaListItems($clienteEntity->comunidad_autonoma_id ?? null);
$this->viewData['provinciaList'] = $this->getProvinciaListItems($clienteEntity->provincia_id ?? null);
$this->viewData['paisList'] = $this->getPaisListItems($clienteEntity->pais_id ?? null);
parent::initController($request, $response, $logger);
}
public function index()
{
$id = auth()->user()->id;
$user_model = new UserModel();
$user = $user_model->find($id);
$cliente_id = $user->cliente_id;
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Clientes.cliente')]),
'cliente_id' => $cliente_id,
"user_id" => $id,
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewClienteDireccionesList', $viewData);
}
public function add()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
$cliente_id = $reqData['cliente_id'] ?? -1;
$att = $reqData['att'] ?? "";
$email = $reqData['email'] ?? "";
$direccion = $reqData['direccion'] ?? "";
$pais_id = $reqData['paisId'] ?? -1;
$pais_id = $reqData['pais_id'] ?? -1;
$provincia = $reqData['provincia'] ?? "";
$municipio = $reqData['municipio'] ?? "";
$cp = $reqData['cp'] ?? "";
$telefono = $reqData['telefono'] ?? "";
$alias = $reqData['alias'] ?? "";
$data = [
"cliente_id" => $cliente_id,
"att" => $att,
@ -50,15 +102,11 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
"alias" => $alias,
];
$response = $this->model->insert($data);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data_ret = [
'data' => $response,
$csrfTokenName => $newTokenHash
];
return $this->respond($data_ret);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
@ -68,14 +116,14 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
public function menuItems()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
$cliente_id = $reqData['cliente_id'] ?? -1;
$clienteDireccionesModel = model('App\Models\Clientes\ClienteDireccionesModel');
$menu = $clienteDireccionesModel->getMenuDirecciones($cliente_id);
//$menu = $this->model->getMenuItems($cliente_id);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
@ -89,6 +137,34 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
}
public function getSelect2()
{
if ($this->request->isAJAX()) {
$cliente_id = $this->request->getGet('cliente_id');
$query = $this->model->builder()->select(
[
"id",
"alias as name"
]
)
->where("cliente_id", $cliente_id)
->orderBy("alias", "asc");
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("clientes.nombre", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function datatable()
{
if ($this->request->isAJAX()) {
@ -96,7 +172,7 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
$tipo = $reqData['tipo'] ?? null;
if(is_null($tipo)){
if (is_null($tipo)) {
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
@ -111,22 +187,21 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
$id_C = $reqData['cliente_id'] ?? -1;
$resourceData = $this->model->getResource($search, $id_C)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource("", $id_C)->countAllResults()
));
}
else{
} else {
$id = $reqData['id'] ?? -1;
$resourceData = $this->model->getDireccion($id);
return $this->respond($resourceData);
}
@ -135,6 +210,87 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
}
}
public function get($id)
{
try {
$resourceData = $this->model->getDireccion($id);
$response = (object) [
'error' => false,
'data' => $resourceData
];
return $this->respond($response);
} catch (\Exception $e) {
$response = (object) [
'error' => true,
'message' => $e->getMessage()
];
return $this->fail($response);
}
}
public function getDireccionIdFromData()
{
$data = $this->request->getGet('data') ?? [];
$cliente_id = $this->request->getGet('cliente_id') ?? -1;
$att = $data['att'] ?? "";
$direccion = $data['direccion'] ?? "";
$cp = $data['cp'] ?? "";
$municipio = $data['municipio'] ?? "";
$provincia = $data['provincia'] ?? "";
$pais_id = $data['pais_id'] ?? -1;
$email = $data['email'] ?? "";
$telefono = $data['telefono'] ?? "";
try {
$model = model('App\Models\Clientes\ClienteDireccionesModel');
$id = $model->select('id')
->where('att', $att)
->where('direccion', $direccion)
->where('cp', $cp)
->where('municipio', $municipio)
->where('provincia', $provincia)
->where('pais_id', $pais_id)
->where('email', $email)
->where('telefono', $telefono)
->where('cliente_id', $cliente_id)
->get()
->getResultObject();
if (count($id) > 0) {
$id = $id[0]->id;
} else {
$id = null;
}
return $id;
} catch (\Exception $e) {
throw new \RuntimeException($e->getMessage());
}
}
public function getDireccionPresupuesto($id)
{
try {
$model = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
$resourceData = $model->getDireccion($id);
if (count($resourceData) > 0) {
$resourceData[0]->direccionId = $id;
}
$response = (object) [
'error' => false,
'data' => $resourceData
];
return $this->respond($response);
} catch (\Exception $e) {
$response = (object) [
'error' => true,
'message' => $e->getMessage()
];
return $this->fail($response);
}
}
public function datatable_editor()
{
if ($this->request->isAJAX()) {
@ -145,72 +301,116 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
$response = Editor::inst($db, 'cliente_direcciones')
->fields(
Field::inst('att')
->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClienteDirecciones.validation.required')
)
)
->validator( Validate::maxLen( 100 ) , array(
'message' => lang('ClienteDirecciones.validation.max_length'))
),
->validator(
Validate::maxLen(100),
array(
'message' => lang('ClienteDirecciones.validation.max_length')
)
),
Field::inst('alias')
->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClienteDirecciones.validation.required')
)
)
->validator( Validate::maxLen( 100 ) , array(
'message' => lang('ClienteDirecciones.validation.max_length'))
),
->validator(
Validate::maxLen(100),
array(
'message' => lang('ClienteDirecciones.validation.max_length')
)
),
Field::inst('email')
->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClienteDirecciones.validation.required')
)
)
->validator( Validate::maxLen( 100 ) , array(
'message' => lang('ClienteDirecciones.validation.max_length'))
),
->validator(
Validate::maxLen(100),
array(
'message' => lang('ClienteDirecciones.validation.max_length')
)
),
Field::inst('direccion')
->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClienteDirecciones.validation.required')
)
)
->validator( Validate::maxLen( 255 ) , array(
'message' => lang('ClienteDirecciones.validation.max_length'))
),
->validator(
Validate::maxLen(255),
array(
'message' => lang('ClienteDirecciones.validation.max_length')
)
),
Field::inst('municipio')
->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClienteDirecciones.validation.required')
)
)
->validator( Validate::maxLen( 100 ) , array(
'message' => lang('ClienteDirecciones.validation.max_length'))
),
->validator(
Validate::maxLen(100),
array(
'message' => lang('ClienteDirecciones.validation.max_length')
)
),
Field::inst('cp')
->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClienteDirecciones.validation.required')
)
)
->validator( Validate::maxLen( 20 ) , array(
'message' => lang('ClienteDirecciones.validation.max_length'))
),
->validator(
Validate::maxLen(20),
array(
'message' => lang('ClienteDirecciones.validation.max_length')
)
),
Field::inst('telefono')
->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('ClienteDirecciones.validation.required')
)
)
->validator( Validate::maxLen( 40 ) , array(
'message' => lang('ClienteDirecciones.validation.max_length'))
),
->validator(
Validate::maxLen(40),
array(
'message' => lang('ClienteDirecciones.validation.max_length')
)
),
Field::inst('provincia')
->validator( function ( $val, $data, $field, $host ) {
if ($data['pais_id'] == 1) { // Si es españa provincia y CCAA es obligatorio
if (strlen( $val ) > 100)
return lang('ClienteDirecciones.validation.max_length');
else if (strlen( $val ) == 0)
lang('ClienteDirecciones.validation.required');
else
return true;
->validator(
function ($val, $data, $field, $host) {
if ($data['pais_id'] == 1) { // Si es españa provincia y CCAA es obligatorio
if (strlen($val) > 100)
return lang('ClienteDirecciones.validation.max_length');
else if (strlen($val) == 0)
lang('ClienteDirecciones.validation.required');
else
return true;
}
return true;
}
return true;
}
),
),
Field::inst('pais_id')->validator('Validate::notEmpty', array(
'message' => lang('ClienteDirecciones.validation.required'))),
'message' => lang('ClienteDirecciones.validation.required')
)),
Field::inst('cliente_id'),
)
->debug(true)
->process($_POST)
->data();
@ -221,9 +421,46 @@ class Clientedirecciones extends \App\Controllers\BaseResourceController
$response[$csrfTokenName] = $newTokenHash;
echo json_encode($response);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null)
{
$paisModel = model('App\Models\Configuracion\PaisModel');
$onlyActiveOnes = true;
$data = $paisModel->getAllForMenu('id, nombre', 'nombre', $onlyActiveOnes);
return $data;
}
protected function getComunidadAutonomaListItems($selId = null)
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))])];
if (!is_null($selId)):
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
$selOption = $comunidadAutonomaModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)):
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
protected function getProvinciaListItems($selId = null)
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Provincias.provincia'))])];
if (!empty($selId)):
$provinciaModel = model('App\Models\Configuracion\ProvinciaModel');
$selOption = $provinciaModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)):
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
}

View File

@ -1,4 +1,5 @@
<?php namespace App\Controllers\Clientes;
<?php
namespace App\Controllers\Clientes;
use App\Controllers\BaseResourceController;
@ -42,7 +43,7 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_clientes"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_plantillas_tarifas_clientes"), 'route' => site_url('clientes/clienteplantillaprecios'), 'active' => true]
['title' => lang("App.menu_plantillas_tarifas_clientes"), 'route' => route_to("clienteplantillapreciosList"), 'active' => true]
];
parent::initController($request, $response, $logger);
@ -70,51 +71,48 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
// plantilla desde la lista
public function update($requestedId = null)
{
if ($this->request->getPost()) :
if ($requestedId == null) :
return;
endif;
$model = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
$model->delete_values($requestedId);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
if ($requestedId == null):
return;
endif;
$model = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
$model->delete_values($requestedId);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif; // ($requestMethod === 'post')
}
public function add()
{
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$cliente_id = $postData['cliente_id'] ?? -1;
$from_client_data = $postData['from_client_data'] ?? 0;
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
$sanitizedData['user_created_id'] = auth()->user()->id;
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
@ -126,26 +124,29 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
if ($from_client_data == 1) {
$thenRedirect = false;
} else {
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
}
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if($cliente_id != -1){
if ($cliente_id != -1) {
$modelLineas = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
$modelLineas->copy_from_cliente($cliente_id, $id);
$modelClientePrecios = model('App\Models\Clientes\ClientePreciosModel');
$modelClientePrecios->set_plantilla_id($cliente_id, $id);
return ;
}
else{
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return $this->respond(['status' => 'success', 'id' => $id]);
} else {
if ($thenRedirect):
if (!empty($this->indexRoute)):
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
return redirect()->to(site_url('/clientes/clienteplantillaprecios/edit/' . $id))->with('message', $message);
return redirect()->to(site_url('/clienteplantillaprecios/edit/' . $id))->with('message', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
@ -171,35 +172,35 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
{
if ($requestedId == null) :
if ($requestedId == null):
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$clientePlantillaPreciosEntity = $this->model->find($id);
if ($clientePlantillaPreciosEntity == false) :
if ($clientePlantillaPreciosEntity == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Clientes.cliente')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
$sanitizedData['user_updated_id'] = auth()->user()->id;
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
@ -216,12 +217,12 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $clientePlantillaPreciosEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
@ -236,7 +237,7 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
//var_dump($clientePlantillaPreciosEntity); dd();
$this->viewData['clienteplantillapreciosEntity'] = $clientePlantillaPreciosEntity;
$this->viewData['formAction'] = route_to('updateClienteplantillaprecios', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Clientes.moduleTitle') . ' ' . lang('Basic.global.edit3');
@ -246,6 +247,23 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
} // end function edit(...)
public function updatePlantillaEnCliente(){
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
$plantilla_id = $reqData['plantilla_id'] ?? -1;
$model = model('App\Models\Clientes\ClientePreciosModel');
$model->update_plantilla_id($plantilla_id);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function datatable()
{
if ($this->request->isAJAX()) {
@ -257,16 +275,16 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$searchValues = get_filter_datatables_columns($reqData);
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ClientePlantillaPreciosModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
$resourceData = $this->model->getResource($searchValues)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
$this->model->getResource($searchValues)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
@ -275,34 +293,32 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
try{
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr, true);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
}
catch(Exception $e){
$menu = [];
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->where("deleted_at", null);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("cliente_plantilla_precios.nombre", $this->request->getGet("q"))
->groupEnd();
}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
$items = $query->get()->getResultObject();
// add a custom item at the beginning
$customItem = new \stdClass;
$customItem->id = 0;
$customItem->name = "Personalizado";
array_unshift($items, $customItem);
return $this->response->setJSON($items);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -93,31 +93,47 @@ class Clienteplantillaprecioslineas extends \App\Controllers\BaseResourceControl
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
$requestedOrder2 = $reqData['order']['1']['column'] ?? $requestedOrder;
$requestedOrder3 = $reqData['order']['2']['column'] ?? $requestedOrder;
$requestedOrder4 = $reqData['order']['3']['column'] ?? $requestedOrder;
$requestedOrder5 = $reqData['order']['4']['column'] ?? $requestedOrder;
$order = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
$order2 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder2 >= 0 ? $requestedOrder2 : $requestedOrder];
$order3 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder3 : $requestedOrder];
$order4 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder4 : $requestedOrder];
$order5 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder5 : $requestedOrder];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$dir2 = $reqData['order']['1']['dir'] ?? $dir;
$dir3 = $reqData['order']['2']['dir'] ?? $dir;
$dir4= $reqData['order']['3']['dir'] ?? $dir;
$dir5= $reqData['order']['4']['dir'] ?? $dir;
$requestedOrder = $reqData['order'] ?? [];
$searchValues = get_filter_datatables_columns($reqData);
$plantilla_id = $reqData['plantilla_id'] ?? 0;
$resourceData = $this->model->getResource($plantilla_id)
->orderBy($order, $dir)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->orderBy($order4, $dir4)->orderBy($order5, $dir5)
->limit($length, $start)->get()->getResultObject();
$resourceData = $this->model->getResource($searchValues, $plantilla_id);
foreach ($requestedOrder as $order) {
$column = $order['column'] ?? 0;
$dir = $order['dir'] ?? 'asc';
$orderColumn = ClientePlantillaPreciosLineasModel::SORTABLE[$column] ?? null;
if ($orderColumn) {
$resourceData->orderBy($orderColumn, $dir);
}
}
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource($plantilla_id)->countAllResults(),
$this->model->getResource($plantilla_id)->countAllResults()
$this->model->getResource([], $plantilla_id)->countAllResults(),
$this->model->getResource($searchValues, $plantilla_id)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function getStoredRows()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
$plantilla_id = $reqData['plantilla_id'] ?? 0;
$resourceData = $this->model->getResource([], $plantilla_id);
$resourceData = $resourceData->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource([], $plantilla_id)->countAllResults(),
$this->model->getResource([], $plantilla_id)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
@ -180,42 +196,21 @@ class Clienteplantillaprecioslineas extends \App\Controllers\BaseResourceControl
),
)
->validator(function ($editor, $action, $data) {
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
foreach ($data['data'] as $pkey => $values) {
// Si no se quiere borrar...
if ($data['data'][$pkey]['is_deleted'] != 1) {
$process_data['tiempo_min'] = $data['data'][$pkey]['tiempo_min'];
$process_data['tiempo_max'] = $data['data'][$pkey]['tiempo_max'];
$process_data['tipo'] = $data['data'][$pkey]['tipo'];
$process_data['tipo_maquina'] = $data['data'][$pkey]['tipo_maquina'];
$process_data['tipo_impresion'] = $data['data'][$pkey]['tipo_impresion'];
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['plantilla_id']);
// No se pueden duplicar valores al crear o al editar
if (!empty($response)) {
return $response;
}
}
}
}
})
->on('preCreate', function ($editor, &$values) {
$session = session();
$datetime = (new \CodeIgniter\I18n\Time("now"));
$editor
->field('user_updated_id')
->setValue($session->id_user);
->setValue(auth()->user()->id);
$editor
->field('updated_at')
->setValue($datetime->format('Y-m-d H:i:s'));
})
->on('preEdit', function ($editor, &$values) {
$session = session();
$datetime = (new \CodeIgniter\I18n\Time("now"));
$editor
->field('user_updated_id')
->setValue($session->id_user);
->setValue(auth()->user()->id);
$editor
->field('updated_at')
->setValue($datetime->format('Y-m-d H:i:s'));

73
ci4/app/Controllers/Clientes/Clienteusuarios.php Normal file → Executable file
View File

@ -1,4 +1,5 @@
<?php namespace App\Controllers\Clientes;
<?php
namespace App\Controllers\Clientes;
use App\Controllers\BaseResourceController;
@ -40,6 +41,59 @@ class Clienteusuarios extends \App\Controllers\BaseResourceController
parent::initController($request, $response, $logger);
}
public function removeClienteFromUser($user_id)
{
if ($this->request->isAJAX()) {
if (intval($user_id) > 0) {
$this->model->removeClienteFromUser($user_id);
return $this->respond(['status' => 'success', 'msg' => 'Usuario eliminado correctamente']);
}
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function addUserToClient(){
if ($this->request->isAJAX()) {
$user_id = $this->request->getPost("user_id");
$cliente_id = $this->request->getPost("cliente_id");
if (intval($user_id) > 0 && intval($cliente_id) > 0) {
$this->model->addUserToClient($user_id, $cliente_id);
return $this->respond(['status' => 'success', 'msg' => 'Usuario añadido correctamente']);
}
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function getAvailableUsers()
{
if ($this->request->isAJAX()) {
$query = $this->model->builder()->select(
[
"id",
"CONCAT(first_name, ' ', last_name) as name"
]
)
->where("deleted_at", null)
->where("cliente_id", null);
if ($this->request->getGet("q")) {
$column = "CONCAT(first_name, ' ', last_name)";
$value = $this->request->getGet("q");
$query->groupStart()
->where("LOWER(CONVERT($column USING utf8)) COLLATE utf8_general_ci LIKE", "%" . strtolower($value) . "%")
->groupEnd();
}
$items = $query->get()->getResultObject();
return $this->response->setJSON($items);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function datatable()
@ -53,14 +107,19 @@ class Clienteusuarios extends \App\Controllers\BaseResourceController
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ClienteUsuariosModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$requestedOrder = $reqData['order'] ?? [];
$id_C = $reqData['id_cliente'] ?? -1;
$resourceData = $this->model->getResource("", $id_C)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
$resourceData = $this->model->getResource("", $id_C);
foreach ($requestedOrder as $order) {
$column = $order['column'] ?? 0;
$dir = $order['dir'] ?? 'asc';
$orderColumn = ClienteUsuariosModel::SORTABLE[$column] ?? null;
if ($orderColumn) {
$resourceData->orderBy($orderColumn, $dir);
}
}
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,

View File

@ -50,6 +50,8 @@ class Proveedores extends \App\Controllers\BaseResourceController {
public function index() {
checkPermission('proveedores.menu');
$viewData = [
'currentModule' => static::$controllerSlug,
@ -67,9 +69,7 @@ class Proveedores extends \App\Controllers\BaseResourceController {
public function add() {
checkPermission('proveedores.create');
if ($this->request->getPost()) :
@ -138,6 +138,8 @@ class Proveedores extends \App\Controllers\BaseResourceController {
} // end function add()
public function edit($requestedId = null) {
checkPermission('proveedores.edit');
if ($requestedId == null) :
return $this->redirect2listView();
@ -381,4 +383,26 @@ class Proveedores extends \App\Controllers\BaseResourceController {
}
}
public function getForSelect(){
if ($this->request->isAJAX()) {
$tipo_id = $this->request->getGet("tipo_id");
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->where('tipo_id', $tipo_id)->where('deleted_at', null)->orderBy("nombre", "asc");
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("lg_proveedores.nombre", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -271,6 +271,27 @@ class Comunidadesautonomas extends \App\Controllers\BaseResourceController
}
}
public function menuItems2()
{
if ($this->request->isAJAX()) {
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->orderBy("nombre", "asc");
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("lg_comunidades_autonomas.nombre", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null)
{

View File

@ -0,0 +1,81 @@
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
use App\Models\Collection;
use App\Models\Presupuestos\ErrorPresupuesto as ErrorPresupuestoModel;
use CodeIgniter\HTTP\Response;
use Hermawan\DataTables\DataTable;
class ConfigErrores extends BaseResourceController
{
protected ErrorPresupuestoModel $errorPresupuestoModel;
protected $format = 'json';
protected array $viewData = [];
protected static $viewPath = 'themes/vuexy/form/configuracion/error_presupuesto/';
protected static $controllerSlug = "errores-presupuesto";
protected $indexRoute = 'viewErrorPresupuestoList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->errorPresupuestoModel = model(ErrorPresupuestoModel::class);
}
public function index()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_error_presupuesto"), 'route' => site_url('configuracion/errores-presupuesto'), 'active' => true]
];
return view(static::$viewPath . $this->indexRoute, $this->viewData);
}
public function viewForm(int $error_presupuesto_id)
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_error_presupuesto"), 'route' => site_url('configuracion/errores-presupuesto'), 'active' => true]
];
$this->viewData["error_presupuesto_id"] = $error_presupuesto_id;
$this->errorPresupuestoModel->update($error_presupuesto_id, [
"last_user_id" => auth()->user()->id,
"visto" => true,
]);
return view(static::$viewPath . 'viewErrorPresupuestoForm', $this->viewData);
}
public function store()
{
$data = [];
$variableCreated = $this->errorPresupuestoModel->store($data);
return $this->response->setJSON($variableCreated);
}
public function get_error_presupuesto(int $error_presupuesto_id)
{
$data = $this->errorPresupuestoModel->getErrorPresupuestoForm($error_presupuesto_id);
if (isset($data[0])) {
return $this->response->setJSON(["data" => $data[0]]);
} else {
return $this->response->setJSON(["data" => []]);
}
}
public function update_error_presupuesto(int $error_presupuesto_id)
{
$bodyData = $this->request->getPost();
$this->errorPresupuestoModel->updateComment($error_presupuesto_id, $bodyData["comments"]);
return $this->response->setJSON(["message" => "Comentario actualizado", "status" => true]);
}
public function datatable()
{
$query = $this->errorPresupuestoModel->getQueryDatatable()->orderBy("created_at", "DESC");
return DataTable::of($query)
->add("action", fn($q) => $q->id)
->toJson(true);
}
}

View File

@ -0,0 +1,92 @@
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
use App\Models\Collection;
use App\Models\Configuracion\ConfigVariableModel;
use CodeIgniter\HTTP\Response;
use Hermawan\DataTables\DataTable;
class ConfigVariables extends BaseResourceController
{
protected $modelName = ConfigVariableModel::class;
protected ConfigVariableModel $configVariableModel;
protected $format = 'json';
protected static $singularObjectName = 'Variables';
protected static $singularObjectNameCc = 'variables';
protected static $pluralObjectName = 'Variables';
protected static $pluralObjectNameCc = 'variables';
protected static $controllerSlug = 'variables';
protected static $viewPath = 'themes/vuexy/form/configuracion/variables/';
protected $indexRoute = 'viewVariablesList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->configVariableModel = model(ConfigVariableModel::class);
}
public function index()
{
$viewData = [
'currentModule' => static::$controllerSlug,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . $this->indexRoute, $viewData);
}
public function store()
{
$data = [];
$variableCreated = $this->configVariableModel->store($data);
return $this->response->setJSON($variableCreated);
}
public function get(int $config_variable_id)
{
$data = $this->configVariableModel->find($config_variable_id);
return $this->response->setJSON($data);
}
public function updateVariable(int $config_variable_id)
{
$reqData = [];
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
$status = $this->configVariableModel->update($config_variable_id, $reqData);
return $this->response->setJSON([
"message" => "Variable actualizada correctamente",
"status" => $status
]);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function deleteVariable(int $config_variable_id): Response
{
return $this->response->setJSON([]);
}
public function datatable()
{
$query = $this->configVariableModel->builder()->select([
"id",
"name",
"value",
"description"
])->orderBy("name", "asc");
return DataTable::of($query)
->add("action", fn($q) => $q->id)
->toJson(true);
}
}

View File

@ -0,0 +1,103 @@
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseController;
use App\Controllers\BaseResourceController;
use App\Entities\Configuracion\FestivoEntity;
use App\Models\Collection;
use App\Entities\Configuracion\Imposicion;
use App\Models\Configuracion\FestivoModel;
use App\Models\Configuracion\ImposicionEsquemaModel;
use App\Models\Configuracion\ImposicionModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Hermawan\DataTables\DataTable;
use Psr\Log\LoggerInterface;
class FestivoController extends BaseController
{
protected $modelName = FestivoModel::class;
protected FestivoModel $model;
protected static $controllerSlug = 'festivos';
protected $format = 'json';
protected string $viewPath = 'themes/vuexy/form/configuracion/festivos/';
protected $indexRoute = 'festivoList';
protected array $viewData = [];
protected Validation $validation;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Festivos.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
$this->model = model($this->modelName);
$this->validation = service("validation");
parent::initController($request, $response, $logger);
}
public function index()
{
return view($this->viewPath . $this->indexRoute);
}
public function store_festivo_date()
{
$bodyData = $this->request->getPost();
$date = $bodyData['date'];
$count = $this->model->where('date',$date)->countAllResults();
if ($count) {
$status = $this->model->where('date', $date)->delete(purge: true);
return $this->response->setJSON([
"message" => lang("App.user_alert_delete"),
"status" => $status,
]);
} else {
$status = $this->model->insert($bodyData);
if ($status) {
$festivoEntity = $this->model->find($status);
return $this->response->setJSON([
"message" => lang("App.global_alert_save_success"),
"status" => $status,
"data" => $festivoEntity
]);
} else {
return $this->response->setJSON([
"message" => lang("App.global_alert_save_error"),
"errors" => $this->model->errors(),
"status" => true
])->setStatusCode(400);
}
}
}
public function delete_festivo_date($id)
{
$status = $this->model->delete($id, true);
if ($status) {
return $this->response->setJSON([
"message" => lang("App.user_alert_delete"),
"status" => $status,
]);
} else {
return $this->response->setJSON([
"message" => lang("App.global_alert_save_error"),
"errors" => $this->model->errors(),
"status" => true
])->setStatusCode(400);
}
}
public function find_all()
{
$festivos = $this->model->findAll();
return $this->response->setJSON([
"message" => lang("App.global_alert_fetch_success"),
"status" => true,
"data" => $festivos
]);
}
}

View File

@ -9,7 +9,7 @@ use App\Entities\Configuracion\FormaPagoEntity;
use App\Models\Configuracion\FormaPagoModel;
class Formaspagos extends \App\Controllers\BaseResourceController
class FormasPago extends \App\Controllers\BaseResourceController
{
protected $modelName = FormaPagoModel::class;
@ -22,15 +22,22 @@ class Formaspagos extends \App\Controllers\BaseResourceController
protected static $controllerSlug = 'formas-pagos';
protected static $viewPath = 'themes/vuexy/form/configuracion/formasPagoViews/';
protected static $viewPath = 'themes/vuexy/form/configuracion/formas-pago/';
protected $indexRoute = 'formaDePagoList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('FormasPagoes.moduleTitle');
$this->viewData['pageTitle'] = lang('FormasPago.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_formas_pago"), 'route' => route_to('formasPagoList'), 'active' => true]
];
parent::initController($request, $response, $logger);
}
@ -40,7 +47,7 @@ class Formaspagos extends \App\Controllers\BaseResourceController
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('FormasPagoes.formaDePago')]),
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('FormasPago.formaDePago')]),
'formaPagoEntity' => new FormaPagoEntity(),
'usingServerSideDataTable' => true,
@ -55,22 +62,15 @@ class Formaspagos extends \App\Controllers\BaseResourceController
public function add()
{
if ($this->request->getPost()) :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$sanitizedData = $this->sanitized($postData, true);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
@ -93,7 +93,8 @@ class Formaspagos extends \App\Controllers\BaseResourceController
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
return redirect()->to(site_url('/configuracion/formas-pago/edit/' . $id))->with('sweet-success', $message);
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
@ -106,11 +107,8 @@ class Formaspagos extends \App\Controllers\BaseResourceController
endif; // ($requestMethod === 'post')
$this->viewData['formaPagoEntity'] = isset($sanitizedData) ? new FormaPagoEntity($sanitizedData) : new FormaPagoEntity();
$this->viewData['formAction'] = route_to('createFormaDePago');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('FormasPagoes.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
$this->viewData['formAction'] = route_to('formasPagoAdd');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('FormasPago.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
@ -125,25 +123,18 @@ class Formaspagos extends \App\Controllers\BaseResourceController
$formaPagoEntity = $this->model->find($id);
if ($formaPagoEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('FormasPagoes.formaDePago')), $id]);
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('FormasPago.formaDePago')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$sanitizedData = $this->sanitized($postData, true);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
@ -152,13 +143,12 @@ class Formaspagos extends \App\Controllers\BaseResourceController
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('FormasPagoes.formaDePago'))]);
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('FormasPago.formaDePago'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$formaPagoEntity->fill($sanitizedData);
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
@ -179,11 +169,8 @@ class Formaspagos extends \App\Controllers\BaseResourceController
endif; // ($requestMethod === 'post')
$this->viewData['formaPagoEntity'] = $formaPagoEntity;
$this->viewData['formAction'] = route_to('updateFormaDePago', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('FormasPagoes.moduleTitle') . ' ' . lang('Basic.global.edit3');
$this->viewData['formAction'] = route_to('formasPagoEdit', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('FormasPago.moduleTitle') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
@ -243,25 +230,19 @@ class Formaspagos extends \App\Controllers\BaseResourceController
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->orderBy("nombre", "asc");
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("formas_pago.nombre", $this->request->getGet("q"))
->groupEnd();
}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}

View File

@ -28,7 +28,7 @@ class Group extends \App\Controllers\GoBaseController
// Breadcrumbs
$this->viewData['breadcrumb'] = [
['title' => "Home", 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_permission_group"), 'route' => site_url("configuracion/group"), 'active' => true]
['title' => lang("App.menu_permission_group"), 'route' => route_to("userGroupList"), 'active' => true]
];
parent::initController($request, $response, $logger);

View File

@ -1,36 +1,42 @@
<?php namespace App\Controllers\Configuracion;
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseController;
use App\Controllers\BaseResourceController;
use App\Models\Collection;
use App\Entities\Configuracion\Imposicion;
use App\Models\Configuracion\ImposicionEsquemaModel;
use App\Models\Configuracion\ImposicionModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Hermawan\DataTables\DataTable;
use Psr\Log\LoggerInterface;
class Imposiciones extends \App\Controllers\BaseResourceController
class Imposiciones extends BaseController
{
protected $modelName = ImposicionModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Imposicion';
protected static $singularObjectNameCc = 'imposicion';
protected static $pluralObjectName = 'Imposiciones';
protected static $pluralObjectNameCc = 'imposiciones';
protected ImposicionModel $model;
protected ImposicionEsquemaModel $imposicionEsquemaModel;
protected static $controllerSlug = 'imposiciones';
protected $format = 'json';
protected static $viewPath = 'themes/vuexy/form/configuracion/imposiciones/';
protected $indexRoute = 'imposicionList';
protected array $viewData = [];
protected Validation $validation;
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Imposiciones.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
$this->model = model($this->modelName);
$this->validation = service("validation");
$this->imposicionEsquemaModel = model(ImposicionEsquemaModel::class);
parent::initController($request, $response, $logger);
}
@ -45,7 +51,10 @@ class Imposiciones extends \App\Controllers\BaseResourceController
'usingServerSideDataTable' => true,
];
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true],
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewImposicionList', $viewData);
@ -54,231 +63,155 @@ class Imposiciones extends \App\Controllers\BaseResourceController
public function add()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true],
if ($this->request->getPost()) :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['imposicion'] = isset($sanitizedData) ? new Imposicion($sanitizedData) : new Imposicion();
$this->viewData['orientacionList'] = $this->getOrientacionOptions();
$this->viewData['formAction'] = route_to('createImposicion');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Imposiciones.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null)
];
$this->viewData["method"] = "add";
return view(static::$viewPath . 'viewImposicionNewForm', $this->viewData);
}
public function add_esquema()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true],
];
$this->viewData["imposicion_esquema"] = null;
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$imposicion = $this->model->find($id);
return view(static::$viewPath . 'viewImposicionEsquemaForm', $this->viewData);
}
public function edit($imposicion_id = null)
{
if ($imposicion_id) {
$this->viewData["imposicion"] = $this->model->find($imposicion_id);
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => false],
['title' => $this->viewData["imposicion"]->full_name, 'route' => route_to("updateImposicionForm", $imposicion_id), 'active' => true],
if ($imposicion == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Imposiciones.imposicion')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
];
}
$this->viewData["method"] = "edit";
return view(static::$viewPath . 'viewImposicionForm', $this->viewData);
}
public function edit_imposicion_esquema($imposicion_esquema_id = null)
{
if ($imposicion_esquema_id) {
$this->viewData["imposicion_esquema"] = $this->imposicionEsquemaModel->find($imposicion_esquema_id);
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => false],
['title' => $this->viewData["imposicion_esquema"]->name, 'route' => route_to("updateImposicionEsquemaForm", $imposicion_esquema_id), 'active' => true],
if ($this->request->getPost()) :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Imposiciones.imposicion'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$imposicion->fill($sanitizedData);
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
$id = $imposicion->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['imposicion'] = $imposicion;
$this->viewData['orientacionList'] = $this->getOrientacionOptions();
$this->viewData['formAction'] = route_to('updateImposicion', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Imposiciones.moduleTitle') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
];
}
return view(static::$viewPath . 'viewImposicionEsquemaForm', $this->viewData);
}
public function update($imposicion_id = null)
{
if ($imposicion_id) {
$bodyData = $this->request->getPost();
if(isset($bodyData["imposicion_esquema_id"])){
if($bodyData["imposicion_esquema_id"] == ""){
$bodyData["imposicion_esquema_id"] = null;
}
}
$status = $this->model->update($imposicion_id, $bodyData);
if ($status) {
$imposicionEntity = $this->model->find($imposicion_id);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->model->errors(), "status" => true])->setStatusCode(400);
}
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status, "data" => $imposicionEntity]);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "message" => "", "status" => false])->setStatusCode(400);
}
}
public function update_imposicion_esquema($imposicion_esquema_id = null)
{
if ($imposicion_esquema_id) {
$bodyData = $this->request->getPost();
$status = $this->imposicionEsquemaModel->update($imposicion_esquema_id, $bodyData);
if ($status) {
$imposicionEsquemaEntity = $this->imposicionEsquemaModel->find($imposicion_esquema_id);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->imposicionEsquemaModel->errors(), "status" => true])->setStatusCode(400);
}
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status, "data" => $imposicionEsquemaEntity]);
} else {
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "message" => "", "status" => false])->setStatusCode(400);
}
}
public function delete($imposicion_id = null)
{
$status = $this->model->delete($imposicion_id);
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true]);
}
public function delete_imposicion_esquema($imposicion_esquema_id = null)
{
$status = $this->imposicionEsquemaModel->delete($imposicion_esquema_id);
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
}
public function datatable()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = ImposicionModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$q = $this->model->queryDatatable();
return DataTable::of($q)
->add('esquema', fn($q) => ["imposicionId" => $q->id,"esquemaId" => $q->esquemaId, "esquemaName" => $q->esquemaName])
->add(
'action',
fn($q) => "<div class='btn-group btn-group-md gap-2 w-100 d-flex justify-space-between'>" . ImposicionModel::datatable_buttons($q->id) . "</div>"
)
->toJson(true);
}
public function datatable_imposicion_esquema()
{
$q = $this->imposicionEsquemaModel->queryDatatable();
return DataTable::of($q)
->add(
'action',
fn($q) => "<div class='btn-group btn-group-md gap-2'>" . ImposicionEsquemaModel::datatable_buttons($q->id) . "</div>"
)
->toJson(true);
}
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
public function selectImposicion()
{
$data = $this->model->querySelect($this->request->getGet('q'));
return $this->response->setJSON($data);
}
public function selectImposicionEsquema()
{
$data = $this->imposicionEsquemaModel->querySelect($this->request->getGet('q'));
return $this->response->setJSON($data);
}
public function find_imposicion(int $imposicion_id)
{
$imposicionEntity = $this->model->find($imposicion_id)->withImposicionEsquema();
return $this->response->setJSON($imposicionEntity);
}
public function find_imposicion_esquema(int $imposicion_esquema_id)
{
$imposicionEsquemaEntity = $this->imposicionEsquemaModel->find($imposicion_esquema_id);
return $this->response->setJSON($imposicionEsquemaEntity);
}
public function create()
{
$bodyData = $this->request->getPost();
$createdId = $this->model->insert($bodyData);
if ($createdId) {
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true]);
} else {
return $this->failUnauthorized('Invalid request', 403);
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->model->errors(), "status" => true])->setStatusCode(400);
}
}
public function allItemsSelect()
public function create_imposicion_esquema()
{
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal . ', ancho', 'ancho', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->ancho = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
$bodyData = $this->request->getPost();
$createdId = $this->imposicionEsquemaModel->insert($bodyData);
if ($createdId) {
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true]);
} else {
return $this->failUnauthorized('Invalid request', 403);
return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->imposicionEsquemaModel->errors(), "status" => true])->setStatusCode(400);
}
}
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'ancho'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getOrientacionOptions()
{
$orientacionOptions = [
'' => lang('Basic.global.pleaseSelect'),
'H' => 'H',
'V' => 'V',
];
return $orientacionOptions;
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseController;
use App\Models\Configuracion\MaquinaTareaModel;
use CodeIgniter\HTTP\Response;
use Hermawan\DataTables\DataTable;
use CodeIgniter\I18n\Time;
class MaquinaTarea extends BaseController
{
protected MaquinaTareaModel $maquinaTareaModel;
protected $format = 'json';
protected array $viewData = [];
protected static $viewPath = 'themes/vuexy/form/configuracion/maquina_tareas/';
protected static $controllerSlug = "maquina-tareas";
protected $indexRoute = 'viewMaquinaTarea';
protected $editRoute = 'editMaquinaTarea';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->maquinaTareaModel = model(MaquinaTareaModel::class);
}
public function index()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_maquina_tareas"), 'route' => site_url('configuracion/maquina-tareas'), 'active' => true]
];
return view(static::$viewPath . $this->indexRoute, $this->viewData);
}
public function viewForm(int $maquina_tarea_id)
{
$maquinaTarea = $this->maquinaTareaModel->find($maquina_tarea_id);
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_maquina_tareas"), 'route' => site_url('configuracion/maquina-tareas'), 'active' => false],
['title' => $maquinaTarea->name, 'route' => site_url('configuracion/maquina-tareas/edit/' . $maquina_tarea_id), 'active' => true]
];
$this->viewData["model"] = $maquinaTarea;
return view(static::$viewPath . $this->editRoute, $this->viewData);
}
public function show(int $id)
{
$data = $this->maquinaTareaModel->find($id);
return $this->response->setJSON($data);
}
public function update_servicio_cliente(int $id)
{
$data = $this->request->getPost();
$status = $this->maquinaTareaModel->update($id, [
"name" => $data["name"],
"description" => $data["description"]
]);
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]);
}
public function store()
{
$bodyData = $this->request->getPost();
$r = $this->maquinaTareaModel->insert($bodyData);
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r,"data" => $bodyData]);
}
public function delete(int $maquina_tarea_id){
$r = $this->maquinaTareaModel->delete($maquina_tarea_id);
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $r]);
}
public function datatable()
{
$query = $this->maquinaTareaModel->getQueryDatatable()->orderBy("created_at", "DESC");
return DataTable::of($query)
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
->add("action", fn($q) => $q->id)
->toJson(true);
}
}

View File

@ -1,4 +1,5 @@
<?php namespace App\Controllers\Configuracion;
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
@ -8,6 +9,8 @@ use App\Models\Collection;
use App\Entities\Configuracion\Maquina;
use App\Models\Configuracion\MaquinaModel;
use App\Services\MaquinaService;
use CodeIgniter\Validation\Validation;
class Maquinas extends \App\Controllers\BaseResourceController
{
@ -25,24 +28,25 @@ class Maquinas extends \App\Controllers\BaseResourceController
protected static $viewPath = 'themes/vuexy/form/configuracion/maquinas/';
protected $indexRoute = 'maquinaList';
protected MaquinaService $maquinaService;
protected Validation $validation;
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Maquinas.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
$this->maquinaService = service('maquina');
$this->validation = service('validation');
// Se indica que este controlador trabaja con soft_delete
$this->soft_delete = true;
// Se indica el flag para los ficheros borrados
$this->delete_flag = 1;
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_maquina"), 'route' => site_url('configuracion/maquinas'), 'active' => true]
['title' => lang("App.menu_maquina"), 'route' => route_to('maquinaList'), 'active' => true]
];
parent::initController($request, $response, $logger);
@ -65,14 +69,50 @@ class Maquinas extends \App\Controllers\BaseResourceController
return view(static::$viewPath . 'viewMaquinaList', $viewData);
}
public function delete($id = null)
{
// Sanitizar el ID
$id = filter_var($id, FILTER_SANITIZE_URL);
// Validar que el ID es válido
if (empty($id) || !is_numeric($id)) {
return $this->respond(['status' => 'error', 'msg' => 'ID no válida']);
}
// Buscar la máquina en la base de datos
$maquina = $this->model->find($id);
if (!$maquina) {
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Maquinas.maquina')), $id]);
return $this->respond(['status' => 'error', 'msg' => 'ID no válida']);
}
// Verificar que el usuario está autenticado
if (!auth()->user()) {
return $this->respond(['status' => 'error', 'msg' => 'Usuario no autenticado']);
}
// Preparar los datos para actualizar
$data = [
'id' => $id,
'is_deleted' => 1,
'deleted_at' => date('Y-m-d H:i:s'),
'user_updated_id' => auth()->user()->id,
];
// Guardar los cambios
if (!$this->model->save($data)) {
return $this->respond(['status' => 'error', 'msg' => 'Error al eliminar']);
}
// Retornar éxito
$message = lang('Basic.global.deleteSuccess', [lang('Basic.global.record')]) . '.';
return $this->respond(['status' => 'error', 'msg' => $message]);
}
public function add()
{
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
@ -84,10 +124,10 @@ class Maquinas extends \App\Controllers\BaseResourceController
$sanitizedData['user_created_id'] = auth()->user()->id;
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
@ -101,14 +141,14 @@ class Maquinas extends \App\Controllers\BaseResourceController
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
return redirect()->to(site_url('configuracion/maquinas/edit/' . $id))->with('sweet-success', $message);
else:
@ -138,20 +178,20 @@ class Maquinas extends \App\Controllers\BaseResourceController
{
if ($requestedId == null) :
if ($requestedId == null):
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$maquina = $this->model->find($id);
if ($maquina == false) :
if ($maquina == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Maquinas.maquina')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
@ -167,21 +207,26 @@ class Maquinas extends \App\Controllers\BaseResourceController
if ($this->request->getPost('is_inkjet') == null) {
$sanitizedData['is_inkjet'] = false;
}
if ($this->request->getPost('etiqueta_envio') == null) {
$sanitizedData['etiqueta_envio'] = false;
}
// JJO
$sanitizedData['user_updated_id'] = auth()->user()->id;
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
//JJO: comprobar alto y ancho impresion < alto y ancho
if ($sanitizedData['alto'] < $sanitizedData['alto_impresion']) {
$successfulResult = false;
$this->viewData['errorMessage'] = lang('Maquinas.validation.alto_menor_alto_impresion');;
$this->viewData['errorMessage'] = lang('Maquinas.validation.alto_menor_alto_impresion');
;
$this->session->setFlashdata('formErrors', $this->model->errors());
} else if ($sanitizedData['ancho'] < $sanitizedData['ancho_impresion']) {
$successfulResult = false;
$this->viewData['errorMessage'] = lang('Maquinas.validation.ancho_menor_ancho_impresion');;
$this->viewData['errorMessage'] = lang('Maquinas.validation.ancho_menor_ancho_impresion');
;
$this->session->setFlashdata('formErrors', $this->model->errors());
} else {
try {
@ -202,12 +247,12 @@ class Maquinas extends \App\Controllers\BaseResourceController
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $maquina->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
@ -243,22 +288,24 @@ class Maquinas extends \App\Controllers\BaseResourceController
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = MaquinaModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$searchValues = get_filter_datatables_columns($reqData);
$requestedOrder = $reqData['order'] ?? [];
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
foreach ($resourceData as $item) :
if (isset($item->observaciones) && strlen($item->observaciones) > 100) :
$item->observaciones = character_limiter($item->observaciones, 100);
endif;
endforeach;
$resourceData = $this->model->getResource($searchValues);
foreach ($requestedOrder as $order) {
$column = $order['column'] ?? 0;
$dir = $order['dir'] ?? 'asc';
$orderColumn = MaquinaModel::SORTABLE[$column] ?? null;
if ($orderColumn) {
$resourceData->orderBy($orderColumn, $dir);
}
}
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
$this->model->getResource([])->countAllResults(),
$this->model->getResource($searchValues)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
@ -297,7 +344,7 @@ class Maquinas extends \App\Controllers\BaseResourceController
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr, true);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
@ -315,15 +362,19 @@ class Maquinas extends \App\Controllers\BaseResourceController
}
}
public function select(){
$r = $this->model->getSelectQuery($this->request->getGet("q"));
return $this->response->setJSON($r);
}
protected function getMaquinaListItems($selId = null)
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
if (!empty($selId)) :
if (!empty($selId)):
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
$selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
if (!empty($selOption)):
$data[$selId] = $selOption[0];
endif;
endif;
@ -341,6 +392,23 @@ class Maquinas extends \App\Controllers\BaseResourceController
];
return $tipoOptions;
}
public function duplicate(int $maquina_id)
{
$bodyData = $this->request->getPost();
$validated = $this->validation->run($bodyData,'maquina_duplicate');
if($validated){
$this->maquinaService->setMaquina($maquina_id);
$duplicated = $this->maquinaService->duplicate($bodyData['name']);
return $this->response->setJSON(["data" => $duplicated]);
}else{
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
}
}
public function find_maquina(int $maquina_id){
$maquinaEntity = $this->model->find($maquina_id);
return $this->response->setJSON($maquinaEntity);
}
}

View File

@ -225,7 +225,9 @@ class Maquinaspapelesimpresion extends \App\Controllers\BaseResourceController {
];
// Se checkea que no haya otro papel con ese gramaje seleccionado y que la accion sea activar ese papel
if($this->model->getPapelActivo($maquina_id, $gramaje)->countAllResults() != 0 && intval($active)==1){
// Esta funcionalidad esta mal: habría que comprobar también que tienen el mismo papel genérico. Se opta por
// quitar la condición el 22012025
/*if($this->model->getPapelActivo($maquina_id, $gramaje)->countAllResults() != 0 && intval($active)==1){
$response['error']= lang('MaquinasPapelImpresion.gramaje_duplicado');;
$ret_vals = [
'DT_RowId' => 'row_'. $papel_id,
@ -235,9 +237,9 @@ class Maquinaspapelesimpresion extends \App\Controllers\BaseResourceController {
];
$response['data'] = $ret_vals;
}
else{
else{*/
$this->model->updateRows([$data]);
}
//}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();

View File

@ -1,4 +1,5 @@
<?php namespace App\Controllers\Configuracion;
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
@ -12,8 +13,8 @@ use App\Models\Configuracion\MaquinasTarifasImpresionModel;
use App\Models\Configuracion\MaquinaModel;
use
DataTables\Editor,
DataTables\Editor\Field;
DataTables\Editor,
DataTables\Editor\Field;
class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
{
@ -69,9 +70,9 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
{
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
@ -81,10 +82,10 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
@ -98,14 +99,14 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
@ -129,25 +130,25 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null)
{
if ($requestedId == null) :
if ($requestedId == null):
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$maquinasTarifasImpresion = $this->model->find($id);
if ($maquinasTarifasImpresion == false) :
if ($maquinasTarifasImpresion == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifaImpresion')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
@ -160,10 +161,10 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
@ -180,12 +181,12 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $maquinasTarifasImpresion->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
@ -220,30 +221,48 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
$response = Editor::inst($db, 'lg_maquinas_tarifas_impresion')
->fields(
Field::inst('uso')
->validator('Validate::notEmpty', array(
'message' => lang('MaquinasTarifasImpresions.validation.uso.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('MaquinasTarifasImpresions.validation.uso.required')
)
),
Field::inst('tipo')
->validator('Validate::notEmpty', array(
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required')
)
),
Field::inst('precio')
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
->validator('Validate::numeric', array(
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
->validator(
'Validate::numeric',
array(
"decimal" => ',',
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal'))
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal')
)
)
->validator('Validate::notEmpty', array(
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required')
)
),
Field::inst('margen')
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
->validator('Validate::numeric', array(
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
->validator(
'Validate::numeric',
array(
"decimal" => ',',
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal'))
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal')
)
)
->validator('Validate::notEmpty', array(
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
->validator(
'Validate::notEmpty',
array(
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required')
)
),
Field::inst('maquina_id'),
Field::inst('user_created_id'),
@ -269,16 +288,21 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
'maquina_id' => $values['maquina_id'],
'tipo' => $values['tipo'],
'uso' => $values['uso'],
'is_deleted' => 0));
'is_deleted' => 0
));
$id = $builder->get()->getFirstRow()->id;
$id = $builder->get()->getFirstRow();
if ($id) {
$id = $id->id;
// No se pueden duplicar valores al crear o al editar
if ($builder->countAllResults() >= 1) {
if (
($action === Editor::ACTION_EDIT && $id != $pkey)
|| $action === Editor::ACTION_CREATE
) {
// No se pueden duplicar valores al crear o al editar
if ($builder->countAllResults() >= 1) {
if (($action === Editor::ACTION_EDIT && $id != $pkey)
|| $action === Editor::ACTION_CREATE) {
return lang('MaquinasTarifasImpresions.validation.duplicated_uso_tipo');
return lang('MaquinasTarifasImpresions.validation.duplicated_uso_tipo');
}
}
}
}
@ -413,11 +437,11 @@ class Maquinastarifasimpresion extends \App\Controllers\BaseResourceController
protected function getMaquinaListItems($selId = null)
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
if (!empty($selId)) :
if (!empty($selId)):
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
$selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
if (!empty($selOption)):
$data[$selId] = $selOption[0];
endif;
endif;

View File

@ -1,4 +1,5 @@
<?php namespace App\Controllers\Configuracion;
<?php
namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
@ -9,6 +10,8 @@ use App\Entities\Configuracion\PaisEntity;
use App\Models\Configuracion\PaisModel;
use Hermawan\DataTables\DataTable;
class Paises extends \App\Controllers\BaseResourceController
{
@ -62,17 +65,17 @@ class Paises extends \App\Controllers\BaseResourceController
public function add()
{
if ($this->request->getPost()) :
if ($this->request->getPost()):
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, true);
$noException = true;
if ($successfulResult = $this->canValidate()) :
if ($successfulResult = $this->canValidate()):
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
@ -86,14 +89,14 @@ class Paises extends \App\Controllers\BaseResourceController
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
@ -117,20 +120,20 @@ class Paises extends \App\Controllers\BaseResourceController
public function edit($requestedId = null)
{
if ($requestedId == null) :
if ($requestedId == null):
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$paisEntity = $this->model->find($id);
if ($paisEntity == false) :
if ($paisEntity == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Paises.pais')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
@ -143,10 +146,10 @@ class Paises extends \App\Controllers\BaseResourceController
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
@ -163,12 +166,12 @@ class Paises extends \App\Controllers\BaseResourceController
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $paisEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
@ -193,30 +196,38 @@ class Paises extends \App\Controllers\BaseResourceController
public function datatable()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = PaisModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$q = $this->model->getDatatableQuery();
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
$result = DataTable::of($q)
->edit(
"show_erp",
function ($row, $meta) {
if($row->show_erp == 1) {
return '<i class="ti ti-check"></i>';
}else{
return '';
}
}
)
->add("actionBtns", callback: function ($q) {
$actions = '';
if (auth()->user()->can('paises.edit')) {
$actions .= '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
</div>';
}
if (auth()->user()->can('paises.delete')) {
$actions .= '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="' . $q->id . '"></i></a>
</div>';
}
return $actions;
});
return $result->toJson(returnAsObject: true);
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function allItemsSelect()
@ -269,4 +280,25 @@ class Paises extends \App\Controllers\BaseResourceController
}
}
public function menuItems2()
{
if ($this->request->isAJAX()) {
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->orderBy("nombre", "asc");
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("lg_paises.nombre", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -43,7 +43,7 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_papelgenerico"), 'route' => site_url('configuracion/papelesgenericos'), 'active' => true]
['title' => lang("App.menu_papelgenerico"), 'route' => route_to('papelGenericoList'), 'active' => true]
];
parent::initController($request, $response, $logger);
@ -72,9 +72,9 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
@ -84,36 +84,36 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else :
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else :
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else :
else:
$this->session->setFlashData('sweet-success', $message);
endif;
@ -133,20 +133,20 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
public function edit($requestedId = null)
{
if ($requestedId == null) :
if ($requestedId == null):
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$papelGenerico = $this->model->find($id);
if ($papelGenerico == false) :
if ($papelGenerico == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('PapelGenerico.papelGenerico')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
@ -156,22 +156,33 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
if ($this->request->getPost('show_in_client') == null) {
$sanitizedData['show_in_client'] = false;
}
if ($this->request->getPost('activo') == null) {
$sanitizedData['activo'] = false;
}
if ($this->request->getPost('show_in_client_special') == null) {
$sanitizedData['show_in_client_special'] = false;
}
if ($sanitizedData['show_in_client_special']) {
$sanitizedData['show_in_client'] = true;
}
if ($sanitizedData['activo']) {
$sanitizedData['activo'] = true;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else :
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
@ -181,17 +192,17 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
if ($noException && $successfulResult):
$id = $papelGenerico->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]).'.';
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
if ($thenRedirect):
if (!empty($this->indexRoute)):
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else :
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else :
else:
$this->session->setFlashData('sweet-success', $message);
endif;
@ -205,7 +216,7 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('PapelGenerico.moduleTitle') . ' ' . lang('Basic.global.edit3');
$this->viewData['usingServerSideDataTable'] = true;
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
@ -271,7 +282,7 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr, true);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
@ -288,4 +299,115 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
return $this->failUnauthorized('Invalid request', 403);
}
}
public function getPapelCliente()
{
if ($this->request->isAJAX()) {
$tirada = goSanitize($this->request->getGet('tirada'))[0] ?? null;
$POD = null;
if ($tirada != null) {
$POD_value = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
if (intval($tirada) <= intval($POD_value)) {
$POD = true;
} else {
$POD = false;
}
}
$tipo = goSanitize($this->request->getGet('tipo'))[0];
$selected_papel = goSanitize($this->request->getGet('papel'))[0] ?? null;
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
$tapa_dura = goSanitize($this->request->getGet('tapa_dura'))[0] ?? null;
$sobrecubierta = goSanitize($this->request->getGet('sobrecubierta'))[0] ?? 0;
$guardas = goSanitize($this->request->getGet('guardas'))[0] ?? 0;
$ancho = floatval($this->request->getGet('ancho') ?? 0);
$alto = floatval($this->request->getGet('alto') ?? 0);
$solapas = floatval($this->request->getGet('solapas') ?? 0);
$lomo = floatval($this->request->getGet('lomo') ?? 0);
$forSelect2 = intval($this->request->getGet('forSelect2') ?? 0);
$anchoLibro = $ancho;
if(intval($cubierta) == 1 || intval($sobrecubierta) == 1){
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
}
$menu = $this->model->getPapelCliente($tipo, $cubierta, $sobrecubierta, $guardas, $selected_papel, $tapa_dura, false, $POD, $anchoLibro, $alto, $tirada);
$menu2 = $this->model->getPapelCliente($tipo, $cubierta, $sobrecubierta, $guardas, $selected_papel, $tapa_dura, true, $POD, $anchoLibro, $alto, $tirada);
if ($forSelect2) {
$menu = array_map(function ($item) {
if (isset($item->id)) {
return [
'id' => $item->id,
'name' => $item->nombre
];
} else {
return [
'id' => $item->gramaje,
'name' => $item->gramaje
];
}
}, $menu);
return $this->respond($menu);
}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'papeles' => $menu,
'papeles_especiales' => $menu2,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function selectPapelEspecial()
{
if ($this->request->isAJAX()) {
$tirada = goSanitize($this->request->getGet('tirada'))[0] ?? null;
$POD = null;
if ($tirada != null) {
$POD_value = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
if (intval($tirada) <= intval($POD_value)) {
$POD = true;
} else {
$POD = false;
}
}
$tipo = goSanitize($this->request->getGet('tipo'))[0];
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
$sobrecubierta = goSanitize($this->request->getGet('sobrecubierta'))[0] ?? 0;
$ancho = floatval($this->request->getGet('ancho') ?? 0);
$alto = floatval($this->request->getGet('alto') ?? 0);
$solapas = floatval($this->request->getGet('solapas') ?? 0);
$lomo = floatval($this->request->getGet('lomo') ?? 0);
$tapa_dura = $this->request->getGet('tapa_dura') ?? 0;
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
$items = $this->model->getPapelCliente($tipo, $cubierta, $sobrecubierta, false, null, $tapa_dura, true, $POD, $anchoLibro, $alto, $tirada);
$items = array_map(function ($item) {
return [
'id' => $item->id,
'name' => $item->nombre
];
}, $items);
return $this->response->setJSON($items);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -22,6 +22,7 @@ use
use App\Models\Collection;
use CodeIgniter\Validation\Validation;
@ -35,7 +36,6 @@ use App\Models\Configuracion\PapelImpresionTipologiaModel;
use App\Models\Configuracion\MaquinasPapelesImpresionModel;
use App\Models\Configuracion\MaquinaModel;
class Papelesimpresion extends \App\Controllers\BaseResourceController
{
@ -52,6 +52,7 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
protected static $viewPath = 'themes/vuexy/form/configuracion/papel/';
protected $indexRoute = 'papelImpresionList';
protected Validation $validation;
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
@ -66,11 +67,12 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
$this->delete_flag = 1;
$this->tpModel = new PapelImpresionTipologiaModel();
$this->validation = service("validation");
// Breadcrumbs
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_papelimpresion"), 'route' => site_url('configuracion/papelesimpresion'), 'active' => true]
['title' => lang("App.menu_papelimpresion"), 'route' => route_to('papelImpresionList'), 'active' => true]
];
parent::initController($request, $response, $logger);
@ -175,7 +177,7 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if ($this->request->getPost()) :
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$nullIfEmpty = false; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
@ -188,6 +190,9 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if ($this->request->getPost('defecto') == null) {
$sanitizedData['defecto'] = false;
}
if ($this->request->getPost('interior') == null) {
$sanitizedData['interior'] = false;
}
if ($this->request->getPost('bn') == null) {
$sanitizedData['bn'] = false;
}
@ -197,6 +202,9 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if ($this->request->getPost('cubierta') == null) {
$sanitizedData['cubierta'] = false;
}
if ($this->request->getPost('use_for_tapa_dura') == null) {
$sanitizedData['use_for_tapa_dura'] = false;
}
if ($this->request->getPost('sobrecubierta') == null) {
$sanitizedData['sobrecubierta'] = false;
}
@ -209,6 +217,12 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if ($this->request->getPost('inkjet') == null) {
$sanitizedData['inkjet'] = false;
}
if ($this->request->getPost('isActivo') == null) {
$sanitizedData['isActivo'] = false;
}
if ($this->request->getPost('use_in_client') == null) {
$sanitizedData['use_in_client'] = false;
}
// Hay que asegurarse de que se quitan los consumos de tintas de rotativa
// en caso de que se haya deseleccionado la opción rotativa
@ -405,7 +419,7 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
if (!empty($selId)) :
$papelGenericoModel = model('App\Models\Configuracion\PapelGenericoModel');
$selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
$selOption = $papelGenericoModel->where('is_deleted', 0)->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
@ -431,4 +445,38 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
$ma_pa_model->updateRows($active_values);
}
}
/**
* Duplica el papel impresion y sus relaciones
*
* @param int $papel_impresion_id
* @return Response
*/
public function duplicate( int $papel_impresion_id)
{
$bodyData = $this->request->getPost();
$validated = $this->validation->run($bodyData, "papel_impresion_duplicate");
if($validated){
$papelImpresionEntity = $this->model->find($papel_impresion_id);
$papelImpresionService = service('papel_impresion');
$duplicated = $papelImpresionService
->setPapelImpresionEntity($papelImpresionEntity)
->duplicate($bodyData["name"]);
return $this->response->setJSON(["data" => $duplicated]);
}else{
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
}
}
public function papel_impresion_select()
{
$q = $this->request->getGet('q');
$data = $this->model->querySelect($q)->get()->getResultArray();
return $this->response->setJSON($data);
}
public function papel_impresion_find(int $papel_impresion_id)
{
$piEntity = $this->model->find($papel_impresion_id);
return $this->response->setJSON($piEntity);
}
}

View File

@ -244,23 +244,15 @@ class Papelformato extends \App\Controllers\BaseResourceController {
public function menuItems() {
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'ancho'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
$searchStr = goSanitize($this->request->getPfgost('searchTerm'))[0];
$menu = $papelFormatoModel->getElementsForMenu2($searchStr);
if(empty(($searchStr)))
array_shift($menu);
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
@ -268,4 +260,15 @@ class Papelformato extends \App\Controllers\BaseResourceController {
}
}
public function getSelect2()
{
if ($this->request->isAJAX()) {
$data = $this->model->getElementsForMenu2($this->request->getGet("q"));
return $this->response->setJSON($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -166,7 +166,7 @@ class Papelimpresionmargenes extends \App\Controllers\BaseResourceController
$id_PI = $reqData['id_PI'] ?? -1;
$resourceData = $this->model->getResource("", $id_PI)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),

View File

@ -271,6 +271,27 @@ class Provincias extends \App\Controllers\BaseResourceController
}
}
public function menuItems2()
{
if ($this->request->isAJAX()) {
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->orderBy("nombre", "asc");
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("lg_provincias.nombre", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null)
{

View File

@ -0,0 +1,268 @@
<?php namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
use App\Models\Collection;
use App\Entities\Configuracion\SeriesFacturasEntity;
use App\Models\Configuracion\SeriesFacturasModel;
class SeriesFacturas extends BaseResourceController
{
protected $modelName = SeriesFacturasModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Series Facturas';
protected static $singularObjectNameCc = 'seriesFacturas';
protected static $pluralObjectName = 'Series Facturas';
protected static $pluralObjectNameCc = 'seriesFacturas';
protected static $controllerSlug = 'ubicaciones';
protected static $viewPath = 'themes/vuexy/form/configuracion/series-facturas/';
protected $indexRoute = 'seriesFacturasList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('SeriesFacturas.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_series_facturas"), 'route' => route_to('seriesFacturasList'), 'active' => true]
];
parent::initController($request, $response, $logger);
}
public function index()
{
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('SeriesFacturas.moduleTitle')]),
'seriesFacturasEntity' => new SeriesFacturasEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewSeriesFacturasList', $viewData);
}
public function add()
{
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, true);
$noException = true;
if ($successfulResult = $this->canValidate()) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['seriesFacturasEntity'] = isset($sanitizedData) ? new SeriesFacturasEntity($sanitizedData) : new SeriesFacturasEntity();
$this->viewData['formAction'] = route_to('seriesFacturasAdd');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null)
{
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$seriesFacturasEntity = $this->model->find($id);
if ($seriesFacturasEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('SeriesFacturas.moduleTitle')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, true);
if ($this->request->getPost('show_erp') == null) {
$sanitizedData['show_erp'] = false;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('SeriesFacturas.moduleTitle'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$seriesFacturasEntity->fill($sanitizedData);
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
$id = $seriesFacturasEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['seriesFacturasEntity'] = $seriesFacturasEntity;
$this->viewData['formAction'] = route_to('seriesFacturasEdit', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = SeriesFacturasModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function allItemsSelect()
{
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal . ', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->nombre = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItemsFacturas()
{
if ($this->request->isAJAX()) {
$menu = $this->model->getMenuItemsFacturas();
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -0,0 +1,257 @@
<?php namespace App\Controllers\Configuracion;
use App\Controllers\BaseResourceController;
use App\Models\Collection;
use App\Entities\Configuracion\UbicacionesEntity;
use App\Models\Configuracion\UbicacionesModel;
class Ubicaciones extends BaseResourceController
{
protected $modelName = UbicacionesModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Ubicaciones';
protected static $singularObjectNameCc = 'ubicaciones';
protected static $pluralObjectName = 'Ubicaciones';
protected static $pluralObjectNameCc = 'ubicaciones';
protected static $controllerSlug = 'ubicaciones';
protected static $viewPath = 'themes/vuexy/form/configuracion/ubicaciones/';
protected $indexRoute = 'ubicacionesList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Ubicaciones.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_ubicaciones"), 'route' => route_to('ubicacionesList'), 'active' => true]
];
parent::initController($request, $response, $logger);
}
public function index()
{
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Ubicaciones.pais')]),
'ubicacionesEntity' => new UbicacionesEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewUbicacionesList', $viewData);
}
public function add()
{
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, true);
$noException = true;
if ($successfulResult = $this->canValidate()) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['ubicacionesEntity'] = isset($sanitizedData) ? new UbicacionesEntity($sanitizedData) : new UbicacionesEntity();
$this->viewData['formAction'] = route_to('ubicacionesAdd');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Ubicaciones.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null)
{
if ($requestedId == null) :
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$ubicacionesEntity = $this->model->find($id);
if ($ubicacionesEntity == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Ubicaciones.moduleTitle')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, true);
if ($this->request->getPost('show_erp') == null) {
$sanitizedData['show_erp'] = false;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Ubicaciones.moduleTitle'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$ubicacionesEntity->fill($sanitizedData);
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
$id = $ubicacionesEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else:
return $this->redirect2listView('sweet-success', $message);
endif;
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['ubicacionesEntity'] = $ubicacionesEntity;
$this->viewData['formAction'] = route_to('ubicacionesEdit', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Ubicaciones.moduleTitle') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function datatable()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
$order = UbicacionesModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource()->countAllResults(),
$this->model->getResource($search)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function allItemsSelect()
{
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id';
$menu = $this->model->getAllForMenu($reqVal . ', nombre', 'nombre', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->nombre = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
$reqText = goSanitize($this->request->getPost('text'))[0];
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $menu,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

View File

@ -1,24 +1,31 @@
<?php namespace App\Controllers\Configuracion;
<?php
namespace App\Controllers\Configuracion;
use App\Entities\Usuarios\UserEntity;
use App\Models\Chat\ChatDeparmentModel;
use App\Models\Chat\ChatDeparmentUserModel;
use App\Models\Usuarios\GroupModel;
use App\Models\UserModel;
use App\Models\Usuarios\UserModel;
use App\Models\Usuarios\GroupsUsersModel;
use CodeIgniter\Shield\Entities\User;
use App\Models\Collection;
class Users extends \App\Controllers\GoBaseController {
class Users extends \App\Controllers\GoBaseController
{
private $group_model;
private $group_user_model;
private $user_model;
private ChatDeparmentModel $chat_department_model;
private ChatDeparmentUserModel $chat_department_user_model;
use \CodeIgniter\API\ResponseTrait;
use \CodeIgniter\API\ResponseTrait;
protected static $primaryModelName = 'App\Models\UserModel';
protected static $primaryModelName = UserModel::class;
protected $modelName = ClientePlantillaPreciosLineasModel::class;
protected static $singularObjectNameCc = 'user';
protected static $singularObjectName = 'User';
@ -29,88 +36,124 @@ class Users extends \App\Controllers\GoBaseController {
protected $indexRoute = 'userList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->group_model = new GroupModel();
$this->group_user_model = new GroupsUsersModel();
$this->user_model = new UserModel();
$this->chat_department_model = model(ChatDeparmentModel::class);
$this->chat_department_user_model = model(ChatDeparmentUserModel::class);
$this->viewData['pageTitle'] = lang('Users.moduleTitle');
// Breadcrumbs (IMN)
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_users"), 'route' => site_url('configuracion/users'), 'active' => true]
['title' => lang("App.menu_users"), 'route' => route_to('userList'), 'active' => true]
];
parent::initController($request, $response, $logger);
}
public function index() {
$this->viewData['usingClientSideDataTable'] = true;
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]);
$this->viewData['user_model'] = $this->user_model;
public function index()
{
$this->viewData['usingServerSideDataTable'] = true;
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]);
parent::index();
}
public function add() {
public function add()
{
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$currentGroups = $postData['group']??[];
unset($postData['group']);
// Obtener contraseña nueva si se ha introducido en texto plano
if (empty($postData['new_pwd'])) {
$postData['password'] = 'Safekat2024'; // Contraseña por defecto
} else {
$postData['password'] = $postData['new_pwd'];
}
$sanitizedData = $this->sanitized($postData, true);
// Obtener los grupos a los que pertenece
$currentGroups = $postData['group'] ?? [];
$chatDepartments = $postData['chatDepartments'] ?? [];
unset($postData['group']);
unset($postData['chatDepartments']);
// Marcar el username como NULL
$sanitizedData = $this->sanitized($postData, true);
$noException = true;
// Obtener proveedor de usuarios
$users = auth()->getProvider();
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()) :
if ($this->canValidate()) :
try {
if ($this->canValidate()) :
try {
// The Email is unique
if ($this->user_model->isEmailUnique($sanitizedData['email'])) {
$user = new User([
'username' => strstr($sanitizedData['email'], '@', true),
'email' => $sanitizedData['email'],
'password' => 'Safekat2024',
]);
$users->save($user);
$successfulResult = true; // Hacked
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
// Crear el usuario si pasa la validación
$user = new \CodeIgniter\Shield\Entities\User([
'username' => null, // If you don't have a username, be sure to set the value to null anyway, so that it passes CodeIgniter's empty data check
'first_name' => $sanitizedData['first_name'],
'last_name' => $sanitizedData['last_name'],
'cliente_id' => $sanitizedData['cliente_id'],
'comments' => $sanitizedData['comments'],
'email' => $sanitizedData['email'],
'password' => $sanitizedData['password'],
'status' => $sanitizedData['status'] ?? 0,
'active' => $sanitizedData['active'] ?? 0,
]);
// Add the user to the system
$users->save($user);
$successfulResult = true; // Hacked
} // Email is not unique!
else {
$this->viewData['errorMessage'] = "El correo '" . $sanitizedData['email'] . "' ya está registrado en el sistema";
$this->session->setFlashdata('formErrors', $this->model->errors());
$successfulResult = false; // Hacked
}
} catch (\Exception $e) {
$noException = false;
$this->viewData['errorMessage'] = $e->getMessage();
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
endif;
if ($noException && $successfulResult) :
$id = $users->getInsertID();
$this->group_user_model->where('user_id', $user->id)->delete();
foreach($currentGroups as $group){
$this->group_user_model->where('user_id', $id)->delete();
foreach ($currentGroups as $group) {
$group_user_data = [
'user_id' => $user->id,
'user_id' => $id,
'group' => $group
];
$this->group_user_model->insert($group_user_data);
}
$this->chat_department_user_model->where("user_id", $id)->delete();
foreach ($chatDepartments as $chatDepartment) {
$this->chat_department_user_model->insert([
"user_id" => $id,
"chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()->id
]);
}
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads';
$message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?');
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Users.user'))]) . '.';
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
@ -128,75 +171,103 @@ class Users extends \App\Controllers\GoBaseController {
endif; // ($requestMethod === 'post')
$this->viewData['user'] = isset($sanitizedData) ? new UserEntity($sanitizedData) : new UserEntity();
$this->viewData['clienteList'] = $this->getClienteListItems();
$this->viewData['formAction'] = route_to('createUser');
$this->viewData['groups'] = $this->group_model->select('keyword, title')->findAll();
$this->viewData['boxTitle'] = lang('Basic.global.addNew') .lang('Users.user').' '.lang('Basic.global.addNewSuffix');
$this->viewData['chatDepartments'] = $this->chat_department_model->findAll();
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Users.user') . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__);
} // end function add()
public function edit($requestedId = null) {
if ($requestedId == null) :
public function edit($requestedId = null)
{
if ($requestedId == null) {
return $this->redirect2listView();
endif;
}
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$user = $this->model->find($id);
$users = auth()->getProvider();
$user = $users->findById($id);
if ($user == false) :
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Users.user')), $id]);
return $this->redirect2listView('errorMessage', $message);
endif;
if ($this->request->getPost()) :
$postData = $this->request->getPost();
$currentGroups = $postData['group'];
$currentGroups = $postData['group'] ?? [];
$chatDepartments = $postData['chatDepartments'] ?? [];
unset($postData['group']);
unset($postData['chatDepartments']);
// Obtener contraseña nueva si se ha introducido en texto plano
if (!empty($postData['new_pwd'])) {
$postData['password'] = $postData['new_pwd'];
}
$sanitizedData = $this->sanitized($postData, true);
if ($this->request->getPost('status') == 0 ) {
if ($this->request->getPost('status') == 0) {
$sanitizedData['status'] = null;
}
$noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($successfulResult = $this->canValidate()) :
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
if ($this->canValidate()) :
try {
$user->fill($sanitizedData);
$thenRedirect = false;
if (in_array('cliente-editor', $currentGroups) || in_array('cliente-administrador', $currentGroups)) {
if (!array_key_exists('cliente_id', $sanitizedData) || is_null($sanitizedData['cliente_id'])) {
$this->viewData['errorMessage'] = lang('Users.errors.cliente_sin_clienteID');
$this->session->setFlashdata('formErrors', $this->model->errors());
$successfulResult = false;
} else {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
}
} else {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
}
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Users.user'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$user->fill($sanitizedData);
$users->save($user);
$thenRedirect = false;
endif;
if ($noException && $successfulResult) :
$this->group_user_model->where('user_id', $user->id)->delete();
foreach($currentGroups as $group){
foreach ($currentGroups as $group) {
$group_user_data = [
'user_id' => $user->id,
'group' => $group
];
$this->group_user_model->insert($group_user_data);
}
$this->chat_department_user_model->where("user_id", $id)->delete();
foreach ($chatDepartments as $chatDepartment) {
$this->chat_department_user_model->insert([
"user_id" => $id,
"chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()->id
]);
}
$id = $user->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads';
$message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?');
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Users.user'))]) . '.';
$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
@ -208,21 +279,25 @@ class Users extends \App\Controllers\GoBaseController {
else:
$this->session->setFlashData('sweet-success', $message);
endif;
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['user'] = $user;
$this->viewData['clienteList'] = $this->getClienteListItems($user->cliente_id);
$this->viewData['formAction'] = route_to('updateUser', $id);
$this->viewData['selectedGroups'] = $this->group_model->getUsersRoles($requestedId);
$this->viewData['groups'] = $this->group_model->select('keyword, title')->findAll();
$this->viewData['boxTitle'] = lang('Basic.global.edit2') .lang('Users.user').' '.lang('Basic.global.edit3');
$this->viewData['chatDepartments'] = $this->chat_department_model->select(["display", "name", "id as chatDepartmentId"])->findAll();
$this->viewData['chatDepartmentUser'] = $this->chat_department_user_model->getChatDepartmentUser($user->id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Users.user') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
} // end function edit(...)
public function delete($requestedId = null, bool $deletePermanently = true) {
public function delete($requestedId = null, bool $deletePermanently = true)
{
if ($requestedId == null) :
return $this->redirect2listView();
@ -236,27 +311,26 @@ class Users extends \App\Controllers\GoBaseController {
return $this->redirect2listView('errorMessage', $message);
endif;
$this->chat_department_user_model->where("user_id", $id)->delete();
$users = auth()->getProvider();
$users->delete($user->id, $deletePermanently);
$users->delete($user->id);
$message = "Usuario eliminado correctamente";
return $this->redirect2listView('successMessage', $message);
} // end function delete(...)
public function allItemsSelect() {
public function allItemsSelect()
{
if ($this->request->isAJAX()) {
$onlyActiveOnes = true;
$reqVal = $this->request->getPost('val') ?? 'id_user';
$menu = $this->model->getAllForMenu($reqVal.', first_name', 'first_name', $onlyActiveOnes, false);
$menu = $this->model->getAllForMenu($reqVal . ', first_name', 'first_name', $onlyActiveOnes, false);
$nonItem = new \stdClass;
$nonItem->id_user = '';
$nonItem->first_name = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$nonItem->first_name = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
@ -269,8 +343,9 @@ class Users extends \App\Controllers\GoBaseController {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function menuItems() {
public function menuItems()
{
if ($this->request->isAJAX()) {
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$reqId = goSanitize($this->request->getPost('id'))[0];
@ -281,8 +356,8 @@ class Users extends \App\Controllers\GoBaseController {
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- '.lang('Basic.global.None').' -';
array_unshift($menu , $nonItem);
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
@ -296,14 +371,100 @@ class Users extends \App\Controllers\GoBaseController {
}
}
protected function getPaisListItems() {
$data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Pais.pais'))])];
public function datatable()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$searchValues = get_filter_datatables_columns($reqData);
$requestedOrder = $reqData['order'] ?? [];
$resourceData = $this->model->getResource($searchValues);
foreach ($requestedOrder as $order) {
$column = $order['column'] ?? 0;
$dir = $order['dir'] ?? 'asc';
$orderColumn = UserModel::SORTABLE[$column] ?? null;
if ($orderColumn) {
$resourceData->orderBy($orderColumn, $dir);
}
}
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource([])->countAllResults(),
$this->model->getResource($searchValues)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function getMenuComerciales()
{
if ($this->request->isAJAX()) {
$comerciales = $this->model->getComerciales();
return $this->respond($comerciales);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems()
{
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Pais.pais'))])];
$paisModel = model('App\Models\Configuracion\PaisModel');
$registers = $paisModel->findAll();
return $registers;
}
return $registers;
}
protected function getClienteListItems($selId = null)
{
$data = ['' => ""];
if (!empty($selId)) :
$clienteModel = model('App\Models\Clientes\ClienteModel');
$selOption = $clienteModel->where('id', $selId)->findColumn('nombre');
if (!empty($selOption)) :
$data[$selId] = $selOption[0];
endif;
endif;
return $data;
}
public function index_maquinista_change_user()
{
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_change_session"), 'route' => route_to('maquinistaUserChangeList'), 'active' => true]
];
$maquinistas = [];
$users = auth()->getProvider()->whereNotIn('id',[auth()->user()->id])->findAll();
foreach ($users as $key => $user) {
if ($user->inGroup('maquina') && !$user->inGroup('admin', 'comercial', 'cliente-editor', 'cliente-admin')) {
$maquinistas[] = $user;
}
}
$this->viewData['maquinistas'] = $maquinistas;
return view('/themes/vuexy/form/produccion/maquinista/viewMaquinistaCambioUserList.php', $this->viewData);
}
public function change_user_session(int $user_id)
{
// Check the credentials
$user = auth()->getProvider()->findById($user_id);
auth()->logout();
auth()->login($user);
return redirect("home");
}
}

View File

@ -0,0 +1,82 @@
<?php
namespace App\Controllers\Excel;
use App\Controllers\BaseController;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class PrintGiros extends BaseController
{
public function generateExcel($factura_id = null)
{
// AQUI CREAR LAS CONSULTAS A LA BBDD, QUIZAS HAYA QUE CREARLO O COMO POST O COMO QUERY AJAX
// Crear un nuevo Spreadsheet
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
// Especificar encabezados
$headers = [
'BIC (SWIFT)*',
'FECHA FIRMA MANDATO*',
'IBAN*',
'IMPORTE*',
'NOMBRE*',
'PAIS*',
'REFERENCIA DEL ADEUDO (REFADEUDO)*',
'REFERENCIA*',
'REFERENCIA DEL MANDATO (REMANDATO)*',
'RESIDENTE*',
'TIPO DE ADEUDO*',
'FECHA DE COBRO*',
'DIAS*'
];
// Establecer los encabezados en la primera fila
$column = 'A';
foreach ($headers as $header) {
$sheet->setCellValue($column . '1', $header);
$column++;
}
// Generar datos dummy
$dummyData = [
['ABCDEF12', '2024-01-01', 'ES1234567890123456789012', 100.50, 'John Doe', 'Spain', 'REF001', '12345', 'MAND001', 'Yes', 'Type1', '2024-02-01', 30],
['GHIJKL34', '2024-02-01', 'ES9876543210987654321098', 200.75, 'Jane Smith', 'France', 'REF002', '67890', 'MAND002', 'No', 'Type2', '2024-03-01', 60],
// Añade más datos dummy según sea necesario
];
// Rellenar las filas con datos dummy
$rowNumber = 2; // Empezar en la segunda fila
foreach ($dummyData as $row) {
$column = 'A';
foreach ($row as $cell) {
$sheet->setCellValue($column . $rowNumber, $cell);
$column++;
}
$rowNumber++;
}
// Ajustar automáticamente el tamaño de las columnas
foreach (range('A', $column) as $col) {
$sheet->getColumnDimension($col)->setAutoSize(true);
}
// Crear un escritor para guardar el archivo
$writer = new Xlsx($spreadsheet);
// Configurar la respuesta para descarga
$fileName = 'giros_reporte.xlsx';
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="' . $fileName . '"');
header('Cache-Control: max-age=0');
// Escribir el archivo a la salida
$writer->save('php://output');
exit;
}
}

View File

@ -0,0 +1,70 @@
<?php
namespace App\Controllers\Excel;
use App\Controllers\BaseController;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class PrintLineas extends BaseController
{
public function generateExcel($factura_id = null)
{
// Modelos
$lineasFacturaModel = model('App\Models\Facturas\FacturaLineaModel');
$infoLineasFactura = $lineasFacturaModel->getResourceForExcel($factura_id)->get()->getResultObject();
// Crear un nuevo Spreadsheet
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
// Especificar encabezados
$headers = [
'Factura',
'ID Pedido',
'Ref. Cliente',
'Base'
];
// Establecer los encabezados en la primera fila
$column = 'A';
foreach ($headers as $header) {
$sheet->setCellValue($column . '1', $header);
$column++;
}
// Rellenar las filas con datos
$rowNumber = 2; // Empezar en la segunda fila
foreach ($infoLineasFactura as $infoLineaFactura) {
$column = 'A';
foreach ($infoLineaFactura as $cell) {
$sheet->setCellValue($column . $rowNumber, $cell);
$column++;
}
$rowNumber++;
}
// Ajustar automáticamente el tamaño de las columnas
foreach (range('A', $column) as $col) {
$sheet->getColumnDimension($col)->setAutoSize(true);
}
// Crear un escritor para guardar el archivo
$writer = new Xlsx($spreadsheet);
// Configurar la respuesta para descarga
$fileName = 'lineas-pedido.xlsx';
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="' . $fileName . '"');
header('Cache-Control: max-age=0');
// Escribir el archivo a la salida
$writer->save('php://output');
exit;
}
}

View File

@ -1,30 +0,0 @@
<?php
namespace App\Controllers\Facturacion;
use App\Controllers\BaseController;
class Albaran extends BaseController
{
function __construct()
{
}
public function index()
{
echo 'Albaran';
}
public function delete()
{
}
public function export()
{
}
}

View File

@ -1,41 +0,0 @@
<?php
namespace App\Controllers\Facturacion;
use App\Controllers\BaseController;
class Factura extends BaseController
{
function __construct()
{
}
public function index()
{
echo 'Facturas';
}
public function nueva()
{
echo 'Nueva Factura';
}
public function vencimiento()
{
echo 'Vencimiento Factura';
}
public function delete()
{
}
public function export()
{
}
}

View File

@ -0,0 +1,939 @@
<?php
namespace App\Controllers\Facturacion;
use App\Models\Facturas\FacturaModel;
use App\Entities\Facturas\FacturaEntity;
use App\Models\Clientes\ClienteModel;
use App\Models\Collection;
use Hermawan\DataTables\DataTable;
use Exception;
class Facturas extends \App\Controllers\BaseResourceController
{
protected $modelName = FacturaModel::class;
protected $format = 'json';
protected static $singularObjectNameCc = 'factura';
protected static $singularObjectName = 'Factura';
protected static $pluralObjectName = 'Facturas';
protected static $controllerSlug = 'factura';
protected static $viewPath = 'themes/vuexy/form/facturas/';
protected $indexRoute = 'facturaList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Facturas.facturas');
// Se indica que este controlador trabaja con soft_delete
$this->viewData = ['usingServerSideDataTable' => true];
// Breadcrumbs
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_facturas"), 'route' => "javascript:void(0);", 'active' => false],
];
parent::initController($request, $response, $logger);
}
public function index()
{
checkPermission('facturas.menu');
if (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) {
// Se obtiene el cliente ID a partir del usuario de la sesion
$model_user = model('App\Models\Usuarios\UserModel');
$user = $model_user->find(auth()->user()->id);
$clienteId = $user->cliente_id;
} else {
$clienteId = -1;
}
$this->viewData['cliente_id'] = $clienteId;
$this->viewData['usingClientSideDataTable'] = true;
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Tarifaextra.tarifaextra')]);
parent::index();
}
public function list()
{
checkGroups(['admin', 'cliente-admin', 'cliente-editor', 'contabilidad']);
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Facturas.facturas')]),
'usingServerSideDataTable' => true,
'pageTitle' => lang('Facturas.facturas'),
['title' => lang("App.menu_facturas"), 'route' => site_url('facturas/list'), 'active' => true]
];
$viewData['breadcrumb'] = [
['title' => lang("App.menu_facturas"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("Facturas.facturaList"), 'route' => "javascript:void(0);", 'active' => true]
];
if (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) {
// Se obtiene el cliente ID a partir del usuario de la sesion
$model_user = model('App\Models\Usuarios\UserModel');
$user = $model_user->find(auth()->user()->id);
$clienteId = $user->cliente_id;
} else {
$clienteId = -1;
}
$viewData['cliente_id'] = $clienteId;
// Establecer el idioma (opcional, si no está configurado en app/Config/App.php)
$locale = explode('-', config('Basics')->i18n)[0]; // Or dynamically set it: \Config\Services::language()->getLocale();
// Specify the language file name (without .php)
$fileName = 'datePicker';
// Build the path to the language file
$filePath = APPPATH . "Language/{$locale}/{$fileName}.php";
// Load the entire language file as an array
$viewData['datepickerLang'] = json_encode(file_exists($filePath) ? require $filePath : []);
$viewData['datepickerLocale'] = config('Basics')->i18n;
return view(static::$viewPath . 'viewFacturasList', $viewData);
}
public function add()
{
checkPermission('facturas.create');
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$noException = true;
$allData = true;
if (!isset($postData['cliente_id']) || !isset($postData['serie_id'])) {
$this->viewData['errorMessage'] = lang('Facturas.errors.requiredFields');
$this->session->setFlashdata('formErrors', $this->model->errors());
$allData = false;
$noException = false;
}
try {
$clienteModel = model('App\Models\Clientes\ClienteModel');
$datosCliente = $clienteModel->getClienteDataFacturas($postData['cliente_id']);
if (count($datosCliente) > 0) {
// add array data datosCliente to postData
$postData = array_merge($postData, $datosCliente[0]);
}
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$sanitizedData['user_updated_id'] = auth()->user()->id;
$sanitizedData['user_created_id'] = auth()->user()->id;
if (!$sanitizedData['creditoAsegurado']) {
$sanitizedData['creditoAsegurado'] = 0;
}
if ($allData && $successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
endif;
if ($noException && $successfulResult):
$id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
return redirect()->to(route_to('editarFactura', $id))->with('sweet-success', $message);
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$this->viewData['factura'] = isset($sanitizedData) ? new FacturaEntity($sanitizedData) : new FacturaEntity();
$this->viewData['formAction'] = route_to('createFactura');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Facturas.facturas') . ' ' . lang('Basic.global.addNewSuffix');
helper('form');
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_facturas"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("Facturas.facturaList"), 'route' => route_to('facturasList'), 'active' => true]
];
$this->viewData['usingSelect2'] = true;
$validation = \Config\Services::validation();
$this->viewData['validation'] = $validation;
$viewFilePath = static::$viewPath . 'viewAddFactura';
return view($viewFilePath, $this->viewData);
} // end function add()
public function edit($id = null)
{
checkPermission('facturas.edit');
if ($id == null):
return $this->redirect2listView();
endif;
$id = filter_var($id, FILTER_SANITIZE_URL);
$factura = $this->model->find($id);
if ($factura == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Facturas.factura')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
$this->obtenerDatosFormulario($factura);
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_facturas"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("Facturas.facturaList"), 'route' => route_to('facturasList'), 'active' => true]
];
$userModel = model('App\Models\Usuarios\UserModel');
$factura->created_by = $userModel->getFullName($factura->user_created_id);
$factura->updated_by = $userModel->getFullName($factura->user_updated_id);
$factura->created_at_footer = $factura->created_at ? date(' H:i d/m/Y', strtotime($factura->created_at)) : '';
$factura->updated_at_footer = $factura->updated_at ? date(' H:i d/m/Y', strtotime($factura->updated_at)) : '';
$factura->showDeleteButton = model('App\Models\Facturas\FacturaPagoModel')
->where('factura_id', $factura->id)->countAllResults() == 0;
if($factura->numero != null && $factura->numero != '' && strpos($factura->numero, "REC ") === 0) {
$modelPagos = model('App\Models\Facturas\FacturaPagoModel');
if($modelPagos->where('factura_id', $factura->id)->countAllResults() > 0) {
$factura->facturaRectificativaPagada = 1;
}
}
$this->viewData['facturaEntity'] = $factura;
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Facturas.factura') . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id);
}
public function datatable()
{
$dataForClienteForm = false;
if (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) {
// Se obtiene el cliente ID a partir del usuario de la sesion
$model_user = model('App\Models\Usuarios\UserModel');
$user = $model_user->find(auth()->user()->id);
$clienteId = $user->cliente_id;
} else {
$temp = $this->request->getGet('cliente_id');
$clienteId = ($temp && $temp != null && $temp != "") ? $temp : -1;
$dataForClienteForm = ($temp && $temp != null && $temp != "") ? true : false;
}
$model = model(FacturaModel::class);
$q = $model->getDatatableQuery($clienteId);
$searchValue = $this->request->getGet('fecha_factura') ?? '';
if (!empty($searchValue)) {
// Extraer las fechas del formato "YYYY-MM-DD|YYYY-MM-DD"
$dates = explode('|', $searchValue);
if (count($dates) == 2) {
$q->where('t1.fecha_factura_at >=', $dates[0] . ' 00:00:00')
->where('t1.fecha_factura_at <=', $dates[1] . ' 23:59:59');
}
}
$result = DataTable::of($q)
->edit(
"creditoAsegurado",
function ($row, $meta) {
switch ($row->creditoAsegurado) {
case "0":
return lang('Basic.global.no');
case "1":
return lang('Basic.global.yes');
default:
return '--'; // Debug
}
}
)
->edit(
"estado",
function ($row, $meta) {
switch ($row->estado) {
case "borrador":
return lang('Facturas.borrador');
case "validada":
return lang('Facturas.validada');
default:
return '--'; // Debug
}
}
)
->edit(
"estado_pago",
function ($row, $meta) {
switch ($row->estado_pago) {
case "pendiente":
return lang('Facturas.pendiente');
case "pagada":
return lang('Facturas.pagada');
case "insolvente":
return lang('Facturas.insolvente');
default:
return '--'; // Debug
}
}
)
->edit(
"forma_pago",
function ($row, $meta) {
switch ($row->forma_pago) {
case "cheque":
return lang('Facturas.cheque');
case "compensada":
return lang('Facturas.compensada');
case "confirming":
return lang('Facturas.confirming');
case "giroDomiciliado":
return lang('Facturas.giroDomiciliado');
case "pagare":
return lang('Facturas.pagare');
case "transferencia":
return lang('Facturas.transferencia');
default:
return $row->forma_pago; // Debug
}
}
)
->add("action", callback: function ($q) {
if (auth()->user()->can('facturas.edit')) {
if ($q->estado == 'borrador') {
return '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
</div>
';
} else {
return '
<div class="btn-group btn-group-sm">
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
</div>
';
}
} else
return '';
});
if ($clienteId != -1) {
$result->hide('cliente');
$result->hide('creditoAsegurado');
if (!$dataForClienteForm) {
$result->hide('estado');
$result->hide('estado_pago');
}
$result->hide('forma_pago');
$result->hide('vencimiento');
$result->hide('dias_vencimiento');
}
return $result->toJson(returnAsObject: true);
}
public function getDatosFacturacionClienteForm($cliente_id)
{
return $this->respond($this->model->getSumatoriosFacturacionCliente($cliente_id));
}
public function datatablePedidos()
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
$order = FacturaModel::SORTABLE_PEDIDOS[$requestedOrder >= 0 ? $requestedOrder : 0];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$pedido_id = $reqData['pedido_id'] ?? 0;
$resourceData = $this->model->getResourcePedidos($pedido_id)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResourcePedidos($pedido_id)->countAllResults(),
$this->model->getResourcePedidos($pedido_id)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function update($id = null)
{
if ($this->request->isAJAX()) {
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
if ($id == null):
$data = [
'error' => 2,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif;
$id = filter_var($id, FILTER_SANITIZE_URL);
$facturaEntity = $this->model->find($id);
if ($facturaEntity == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Factura.factura')), $id]);
$data = [
'error' => $message,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif;
if ($this->request->getPost()):
$nullIfEmpty = true; // !(phpversion() >= '8.1');
$postData = $this->request->getPost();
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
$sanitizedData['user_updated_id'] = auth()->user()->id;
$noException = true;
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
if ($this->canValidate()):
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else:
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Facturas.factura'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$facturaEntity->fill($sanitizedData);
endif;
if ($noException && $successfulResult):
$id = $facturaEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
$data = [
'error' => 0,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post')
$data = [
'error' => 1,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function delete($id = null)
{
$user_id = auth()->user()->id;
$datetime = (new \CodeIgniter\I18n\Time("now"));
$rawResult = $this->model->where('id', $id)
->set([
'deleted_at' => $datetime->format('Y-m-d H:i:s'),
'user_updated_id' => $user_id,
])
->update();
if (!$rawResult) {
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
}
$modelLineas = model('\App\Models\Facturas\FacturaLineaModel');
$rawResult = $modelLineas->where('factura_id', $id)
->set([
'deleted_at' => $datetime->format('Y-m-d H:i:s'),
'user_updated_id' => $user_id,
])
->update();
$this->model->db->query('DELETE FROM facturas_pedidos_lineas WHERE factura_id=' . $id);
// $message = lang('Basic.global.deleteSuccess', [$objName]); IMN commented
$message = lang('Basic.global.deleteSuccess', [lang('Basic.global.record')]);
$response = $this->respondDeleted(['id' => $id, 'msg' => $message]);
return $response;
}
public function menuPedidosPendientes($cliente_id)
{
if ($this->request->isAJAX()) {
$model = model('\App\Models\Pedidos\PedidoLineaModel');
$pedidos = [];
try {
$pedidos = $model->obtenerLineasPedidoSinFacturar($cliente_id);
} catch (Exception $e) {
}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'menu' => $pedidos,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function duplicate($factura_id = 0)
{
if ($this->request->isAJAX()) {
$factura_origen = $this->model->find($factura_id);
// se quita la key "id" del objeto
unset($factura_origen->id);
$factura_origen->estado = 'borrador';
$factura_origen->estado_pago = 'pendiente';
$factura_origen->base = 0;
$factura_origen->total = 0;
$factura_origen->pendiente = 0;
$factura_origen->total_pagos = 0;
$factura_origen->user_created_id = auth()->user()->id;
$factura_origen->user_updated_id = null;
$this->model->insert($factura_origen);
$id = $this->model->getInsertID();
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'id' => $id,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function updateTotales($factura_id = 0)
{
if ($this->request->isAJAX()) {
$postData = $this->request->getPost();
$pendiente = $postData['pendiente'] ?? 0;
$total = $postData['total'] ?? 0;
$data = [
'base' => $postData['base'] ?? 0,
'total' => $total,
'pendiente' => $pendiente,
'total_pagos' => $postData['total_pagos'] ?? 0,
'user_updated_id' => auth()->user()->id,
'estado_pago' => (intval($pendiente) == 0 && intval($total) != 0) ? 'pagada' : 'pendiente',
];
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data_ret = [
$csrfTokenName => $newTokenHash
];
if ($factura_id == 0) {
return $this->respond($data_ret);
}
$data_ret['estado_pago'] = $data['estado_pago'];
$model = model('\App\Models\Facturas\FacturaModel');
$model->update($factura_id, $data);
return $this->respond($data_ret);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function addExcedentes($factura_id)
{
if ($this->request->isAJAX()) {
$model_factura_linea = model('\App\Models\Facturas\FacturaLineaModel');
$postData = $this->request->getPost();
$cantidad = $postData['cantidad'] ?? 0;
$precio_unidad = $postData['precio_unidad'] ?? 0;
$iva = $postData['iva'] ?? 0;
$descripcion = $postData['descripcion'] ?? '';
$descuento = $postData['descuento'] ?? 0;
$pedido_linea_impresion_id = $postData['pedido_linea_impresion_id'] ?? null;
$pedido_linea_maquetacion_id = $postData['pedido_linea_maquetacion_id'] ?? null;
$pedido_id = $postData['pedido_id'] ?? 0;
$nuevo_precio_unidad = round($precio_unidad * (100 - floatval($descuento)) / 100, 4);
$base = round($cantidad * $nuevo_precio_unidad, 2);
$total_iva = round($base * $iva / 100, 2);
$data = (object) [
'factura_id' => $factura_id,
'pedido_linea_impresion_id' => $pedido_linea_impresion_id,
'pedido_linea_maquetacion_id' => $pedido_linea_maquetacion_id,
'descripcion' => $newString = preg_replace_callback('/Impresión de (\d+) ejemplares/', function ($matches) use ($cantidad) {
return 'Impresión de ' . $cantidad . ' ejemplares';
}, $descripcion),
'cantidad' => $cantidad,
'precio_unidad' => $nuevo_precio_unidad,
'iva' => $iva,
'base' => $base,
'total_iva' => $total_iva,
'total' => round($base + $total_iva, 2),
'user_updated_id' => auth()->user()->id,
];
$model_factura_linea->insert($data);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data_ret = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data_ret);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function addLineaPedidoImpresion($factura_id, $data = -1)
{
if ($this->request) {
if ($this->request->isAJAX())
$pedido_linea_id = $this->request->getPost('lineaPedido') ?? 0;
} else {
if ($data == -1) {
return "Error: sin datos";
}
$pedido_linea_id = $data;
}
$model_pedido_linea = model('\App\Models\Pedidos\PedidoLineaModel');
$model_presupuesto = model('\App\Models\Presupuestos\PresupuestoModel');
$model_factura_linea = model('\App\Models\Facturas\FacturaLineaModel');
$model_factura = model('\App\Models\Facturas\FacturaModel');
try {
$linea = $model_pedido_linea->find($pedido_linea_id);
$factura = $model_factura->find($factura_id);
if ($factura) {
if ($linea) {
$presupuesto = $model_presupuesto->find($linea->presupuesto_id);
if ($presupuesto) {
// Se añade la linea de factura
$descripcion = $model_presupuesto->generarLineaPedido($presupuesto->id, true, $linea->pedido_id);
$cantidad = intval($presupuesto->tirada) - intval($model_factura->getCantidadLineaPedidoFacturada($linea->id));
$base =
floatval($presupuesto->total_aceptado_revisado && $presupuesto->total_aceptado_revisado != 0 ?
$presupuesto->total_aceptado_revisado : $presupuesto->total_aceptado);
$base = round($base, 2);
$total_iva = $base * ($presupuesto->iva_reducido == 1 ? 0.04 : 0.21);
// se redondea a dos decimales
$total_iva = round($total_iva, 2);
$total = $base + $total_iva;
$data = (object) [
'factura_id' => $factura_id,
'pedido_linea_impresion_id' => $pedido_linea_id,
'descripcion' => $descripcion[0]->concepto,
'cantidad' => $cantidad,
'iva' => $presupuesto->iva_reducido == 1 ? 4 : 21,
'base' => $base,
'total_iva' => $total_iva,
'total' => $total,
'user_updated_id' => auth()->user()->id,
];
$model_factura_linea->insert($data);
$id = $model_factura_linea->getInsertID();
if ($id) {
$model_factura_linea->addFacturaPedidoLinea($factura_id, $linea->id, $cantidad);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'error' => 0,
'id' => $id,
$csrfTokenName => $newTokenHash
];
if ($this->request) {
if ($this->request->isAJAX())
return $this->respond($data);
} else {
// remove csrf token
unset($data[$csrfTokenName]);
return $data;
}
}
}
}
}
} catch (Exception $e) {
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'error' => 1,
'error_text' => $e->getMessage(),
$csrfTokenName => $newTokenHash
];
if ($this->request) {
if ($this->request->isAJAX())
return $this->respond($data);
} else {
unset($data[$csrfTokenName]);
return $data;
}
}
}
public function deleteLineaPedidoImpresion()
{
if ($this->request->isAJAX()) {
$postData = $this->request->getPost();
$factura_id = $postData['factura_id'] ?? 0;
$linea_id = $postData['linea_id'] ?? 0;
$cantidad = $postData['cantidad'] ?? 0;
$model_factura_linea = model('\App\Models\Facturas\FacturaLineaModel');
$model_factura_linea->deleteFacturasLineasPedido($factura_id, $linea_id, $cantidad);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function deleteLineaPago()
{
if ($this->request->isAJAX()) {
$postData = $this->request->getPost();
$factura_id = $postData['factura_id'] ?? 0;
$pago_id = $postData['pago_id'] ?? 0;
$model_factura_pago = model('\App\Models\Facturas\FacturaPagoModel');
$model_factura_pago->update($pago_id, [
'deleted_at' => date('Y-m-d H:i:s'),
'user_updated_id' => auth()->user()->id,
]);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function validar($factura_id)
{
if ($this->request->isAJAX()) {
$factura = $this->model->find($factura_id);
if ($factura) {
$model_series = model('\App\Models\Configuracion\SeriesFacturasModel');
$numero = $model_series->getSerieNumerada($factura->serie_id);
$data = [
'estado' => 'validada',
'numero' => $numero,
'user_updated_id' => auth()->user()->id,
];
$this->model->update($factura_id, $data);
if ((strpos($numero, "REC ") === 0)) {
$this->model->where('numero', $factura->factura_rectificada_id)->set([
'factura_rectificativa_id' => $numero,
'user_updated_id' => auth()->user()->id,
])->update();
}
}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function updateCabecera($factura_id)
{
if ($this->request->isAJAX()) {
if ($factura_id == 0) {
return;
}
$factura = $this->model->find($factura_id);
if ($factura) {
$postData = $this->request->getPost();
$dataName = $postData['name'] ?? '';
$dataValue = $postData['value'] ?? '';
if ($dataName == 'factura_rectificativa_id') {
// se actualiza la factura donde el campo 'numero' sea igual al valor de $dataValue. El campo a actualizar es 'factura_rectificada_id'
$factura_rectificada = $this->model->where('numero', $dataValue)->first();
if ($factura_rectificada) {
$data2 = [
'factura_rectificada_id' => $factura->numero,
'user_updated_id' => auth()->user()->id,
];
$this->model->update($factura_rectificada->id, $data2);
}
}
$data = [
$dataName => $dataValue,
'user_updated_id' => auth()->user()->id,
];
$this->model->update($factura_id, $data);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
}
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
/*************************************
* FUNCIONES AUXILIARES
************************************/
private function obtenerDatosFormulario(&$factura)
{
if ($factura->estado == 'borrador') {
$serieModel = model('App\Models\Configuracion\SeriesFacturasModel');
$serie = $serieModel->find($factura->serie_id);
if ($serie) {
$factura->numero = str_replace("{numero}", $serie->next, $serie->formato);
}
}
$clienteModel = model('App\Models\Clientes\ClienteModel');
$cliente = $clienteModel->find($factura->cliente_id);
$factura->cliente_alias = $cliente->alias;
$serieModel = model('App\Models\Configuracion\SeriesFacturasModel');
$serie = $serieModel->find($factura->serie_id);
$factura->serie_nombre = $serie->nombre;
$formaPagoModel = model('App\Models\Configuracion\FormaPagoModel');
$factura->formas_pago = $formaPagoModel->getMenuItems();
$factura->fecha_factura_at_text = $factura->fecha_factura_at ? date('d/m/Y', strtotime($factura->fecha_factura_at)) : '';
}
}

View File

@ -0,0 +1,262 @@
<?php
namespace App\Controllers\Facturacion;
use App\Models\Facturas\FacturaLineaModel;
use App\Models\Collection;
use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Validate;
class FacturasLineas extends \App\Controllers\BaseResourceController
{
protected $modelName = FacturaLineaModel::class;
protected $format = 'json';
protected static $controllerSlug = 'factura-lineas';
public function datatable($factura_id = null)
{
if ($this->request->isAJAX() && $factura_id != null) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
//$order = FacturaModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($factura_id)->orderBy(1, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource($factura_id)->countAllResults(),
$this->model->getResource($factura_id)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function deleteLinea($factura_linea_id = 0)
{
if (!empty(static::$pluralObjectNameCc) && !empty(static::$singularObjectNameCc)) {
$objName = mb_strtolower(lang(ucfirst(static::$pluralObjectNameCc) . '.' . static::$singularObjectNameCc));
} else {
$objName = lang('Basic.global.record');
}
if ($factura_linea_id == 0) {
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
}
$facturaLinea = $this->model->find($factura_linea_id);
if ($facturaLinea == null) {
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
}
if ($facturaLinea->pedido_linea_impresion_id != null) {
$this->model->deleteFacturasLineasPedido($facturaLinea->factura_id, $facturaLinea->pedido_linea_impresion_id, $facturaLinea->cantidad);
}
if ($facturaLinea->pedido_maquetacion_id != null) {
//$this->model->deleteFacturasLineasPedido($facturaLinea->factura_id, $facturaLinea->pedido_maquetacion_id, $facturaLinea->cantidad);
}
$facturaLinea = $this->model->delete($factura_linea_id);
$message = lang('Basic.global.deleteSuccess', [lang('Basic.global.record')]);
$response = $this->respondDeleted(['id' => $factura_linea_id, 'msg' => $message]);
return $response;
}
public function datatable_editor()
{
if ($this->request->isAJAX()) {
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
// Build our Editor instance and process the data coming from _POST
$response = Editor::inst($db, 'facturas_lineas')
->fields(
Field::inst('id'),
Field::inst('base'),
Field::inst('total_iva'),
Field::inst('total')->set(Field::SET_BOTH),
Field::inst('cantidad')
->validator(
'Validate::numeric',
array(
'message' => lang('Facturas.validation.numerico')
)
)
->validator(
'Validate::notEmpty',
array(
'message' => lang('Facturas.validation.requerido')
)
),
Field::inst('descripcion')
->validator(
'Validate::notEmpty',
array(
'message' => lang('Facturas.validation.requerido')
)
),
Field::inst('iva')
->validator(
'Validate::numeric',
array(
'message' => lang('Facturas.validation.numerico')
)
)
->validator(
'Validate::notEmpty',
array(
'message' => lang('Facturas.validation.requerido')
)
),
Field::inst('pedido_linea_impresion_id')
->setFormatter(function ($val, $data, $opts) {
return $val === '' ? null : $val;
}),
Field::inst('pedido_maquetacion_id')
->setFormatter(function ($val, $data, $opts) {
return $val === '' ? null : $val;
}),
Field::inst('factura_id'),
Field::inst('user_updated_id'),
)
->on('preCreate', function ($editor, &$values) {
$totales = $this->generate_totales(
$values['factura_id'],
$values['pedido_linea_impresion_id'],
$values['total'],
$values['iva'],
$values['cantidad'],
$values['old_cantidad'],
$values['base']
);
$editor
->field('user_updated_id')
->setValue(auth()->user()->id);
$editor
->field('base')
->setValue($totales['base']);
$editor
->field('total_iva')
->setValue($totales['total_iva']);
$editor
->field('total')
->setValue($totales['total']);
$editor
->field('user_updated_id')
->setValue(auth()->user()->id);
})
->on('preEdit', function ($editor, $id, &$values) {
$totales = $this->generate_totales(
$values['factura_id'],
$values['pedido_linea_impresion_id'],
$values['total'],
$values['iva'],
$values['cantidad'],
$values['old_cantidad'],
$values['base']
);
$editor
->field('factura_id')
->setValue($values['factura_id']);
$editor
->field('pedido_linea_impresion_id')
->setValue(null);
$editor
->field('pedido_maquetacion_id')
->setValue(null);
$editor
->field('user_updated_id')
->setValue(auth()->user()->id);
$editor
->field('base')
->setValue($totales['base']);
$editor
->field('total_iva')
->setValue($totales['total_iva']);
$editor
->field('total')
->setValue($totales['total']);
})
->debug(true)
->process($_POST)
->data();
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$response[$csrfTokenName] = $newTokenHash;
echo json_encode($response);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function updateTotalesFactura($factura_id = 0)
{
if ($factura_id == 0) {
return;
}
$model = model('\App\Models\Facturas\FacturaModel');
$model->updateTotales($factura_id);
}
private function generate_totales($factura_id, $pedido_linea_id, $total, $iva, $cantidad, $old_cantidad, $base_input)
{
// si es una linea que se refiere a pedido
if ($pedido_linea_id != null && $factura_id != null) {
// se actualiza la cantidad de la linea de pedido en la tabla pivote facturas_pedidos_lineas
$this->model->updateFacturaPedidoLinea($factura_id, $pedido_linea_id, $old_cantidad, $cantidad);
}
// Si es una linea añadida a mano, el total y el iva tienen que venir metidos a mano
if ($pedido_linea_id != null) {
// se calcula y se actualiza el subtotal, total_iva y total
// redondeando a 4 decimales el precio_unidad y a dos el resto
$precio_unidad = round($total / $old_cantidad, 4);
$base = round($precio_unidad * $cantidad, 2);
$total_iva = round($base * $iva / 100, 2);
$total = round($base + $total_iva, 2);
$values = [];
$values['base'] = $base;
$values['total_iva'] = $total_iva;
$values['total'] = $total;
} else {
// se pasa la base y el iva
$total_iva = round($base_input * $iva / 100, 2);
$total = round($base_input + $total_iva, 2);
$values = [];
$values['base'] = (float) $base_input;
$values['total_iva'] = $total_iva;
$values['total'] = $total;
}
return $values;
}
}

View File

@ -0,0 +1,171 @@
<?php
namespace App\Controllers\Facturacion;
use App\Models\Facturas\FacturaPagoModel;
use App\Models\Collection;
use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Validate;
use DataTables\Editor\Format;
class FacturasPagos extends \App\Controllers\BaseResourceController
{
protected $modelName = FacturaPagoModel::class;
protected $format = 'json';
protected static $controllerSlug = 'factura-pagos';
public function datatable($factura_id = null){
if ($this->request->isAJAX() && $factura_id != null) {
$reqData = $this->request->getPost();
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
$errstr = 'No data available in response to this specific request.';
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
return $response;
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
//$order = FacturaModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
$resourceData = $this->model->getResource($factura_id)->orderBy(1, $dir)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
$this->model->getResource($factura_id)->countAllResults(),
$this->model->getResource($factura_id)->countAllResults()
));
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function datatable_editor() {
if ($this->request->isAJAX()) {
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
// Build our Editor instance and process the data coming from _POST
$response = Editor::inst( $db, 'facturas_pagos' )
->fields(
Field::inst( 'id' ),
Field::inst( 'forma_pago_id' ),
Field::inst( 'notes' ),
Field::inst( 'fecha_pago_at' )
->validator( Validate::dateFormat( 'Y-m-d H:i:s' ) )
->getFormatter( Format::dateSqlToFormat( 'Y-m-d H:i:s' ) )
->setFormatter( Format::dateFormatToSql( 'Y-m-d H:i:s' ) ),
Field::inst( 'fecha_vencimiento_at' )
->validator( Validate::dateFormat( 'Y-m-d H:i:s' ) )
->getFormatter( Format::dateSqlToFormat( 'Y-m-d H:i:s' ) )
->setFormatter( Format::dateFormatToSql( 'Y-m-d H:i:s' ) ),
Field::inst( 'total' )
->validator('Validate::numeric', array(
'message' => lang('Facturas.validation.numerico'))
)
->validator('Validate::notEmpty', array(
'message' => lang('Facturas.validation.requerido'))
),
Field::inst( 'factura_id' ),
Field::inst( 'user_updated_id' ),
)
->on('preCreate', function ($editor, &$values) {
/*
$editor
->field('user_updated_id')
->setValue(auth()->user()->id);
$editor
->field('base')
->setValue($totales['base']);
$editor
->field('total_iva')
->setValue($totales['total_iva']);
$editor
->field('total')
->setValue($totales['total']);
$editor
->field('user_updated_id')
->setValue(auth()->user()->id);
*/
})
->on('preEdit', function ($editor, $id, &$values) {
/*
$editor
->field('factura_id')
->setValue($values['factura_id']);
$editor
->field('pedido_linea_impresion_id')
->setValue(null);
$editor
->field('pedido_maquetacion_id')
->setValue(null);
$editor
->field('user_updated_id')
->setValue(auth()->user()->id);
$editor
->field('base')
->setValue($totales['base']);
$editor
->field('total_iva')
->setValue($totales['total_iva']);
$editor
->field('total')
->setValue($totales['total']);
*/
})
->debug(true)
->process($_POST)
->data();
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$response[$csrfTokenName] = $newTokenHash;
echo json_encode($response);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
public function addPagoRectificativa()
{
if ($this->request->isAJAX()) {
$data['factura_id'] = $this->request->getPost('factura_id');
$data['fecha_vencimiento_at'] = $this->request->getPost('fecha');
$data['total'] = $this->request->getPost('total');
$data['user_updated_id'] = auth()->user()->id;
$data['forma_pago_id'] = 6; // compensada
if($data['fecha_vencimiento_at'] != null && $data['fecha_vencimiento_at'] != '') {
$data['fecha_vencimiento_at'] = date('Y-m-d H:i:s', strtotime($data['fecha_vencimiento_at']));
}
$model = new FacturaPagoModel();
$model->insert($data);
$modelFactura = model('App\Models\Facturas\FacturaModel');
$modelFactura->update($data['factura_id'], [
'estado_pago' => 'pagada',
'updated_at' => date('Y-m-d H:i:s'),
'user_updated_id' => auth()->user()->id,
]);
return $this->response->setJSON([
'status' => true,
'message' => lang('Facturas.facturaConformada'),
]);
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
}

Some files were not shown because too many files have changed in this diff Show More