814 Commits

Author SHA1 Message Date
7bd946976e Merge branch 'develop' into feature/cierres 2025-08-12 19:24:48 -04:00
4e4c0b7648 Merge pull request 'Se registra todo envio a Toku' (#28) from feature/mas-registro-en-toku into develop
Reviewed-on: #28
2025-08-12 19:20:27 -04:00
47679cd4e4 Se registra todo envio a Toku 2025-08-12 19:18:18 -04:00
27f7d1d579 Mostrar reservas 2025-08-12 19:17:32 -04:00
977b5f76f4 Mostrar reservations 2025-08-08 17:06:16 -04:00
42336133cd Reservations 2025-08-08 17:04:50 -04:00
62aa6a08a0 Listado de cierres 2025-08-05 18:18:05 -04:00
28b272bc55 Merge branch 'develop' into feature/cierres 2025-08-05 15:46:21 -04:00
0f8db5a3f8 Merge pull request 'FIX: Telefono sobre rango maximo de integer en MySQL' (#26) from hotfix/nueva-venta-fallando into develop
Reviewed-on: #26
2025-08-05 15:44:54 -04:00
c38e89d3f1 FIX: Telefono sobre rango maximo de integer en MySQL 2025-08-05 15:41:23 -04:00
909bb2b879 Mostrar reservas 2025-07-22 18:21:05 -04:00
39bc190775 Cambios a modelo Reservation 2025-07-22 18:20:48 -04:00
413709e443 Cambio a migraciones de reservation 2025-07-22 18:19:49 -04:00
808b55cf29 Merge branch 'develop' into feature/cierres 2025-07-22 18:15:55 -04:00
307f2ac7d7 feature/cierres (#25)
Varios cambios

Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl>
Reviewed-on: #25
2025-07-22 13:18:00 +00:00
6c25c5f6d5 FIX: Venta no se actualizaba 2025-07-18 16:20:23 -04:00
3ce41914e5 FIX: Venta desistida pero sin resciliacion 2025-07-18 16:15:30 -04:00
56505fe519 Merge 2025-07-18 13:57:31 -04:00
c7aa731261 FIX: Desistir cuando no existe pie 2025-07-18 13:56:07 -04:00
b211af47d0 Permissions 2025-07-15 23:30:53 -04:00
fd134804a2 Queue runs batch of jobs 2025-07-15 23:18:09 -04:00
d3d6940842 Add retries when job execute failed 2025-07-15 23:07:32 -04:00
c512d7a79a FIX: sacar configuracion de json 2025-07-15 22:56:48 -04:00
9310d65d77 Push can now push json file 2025-07-15 22:19:07 -04:00
8b3cf47762 Pending now in queue 2025-07-15 22:18:45 -04:00
48f992dd47 Merge remote-tracking branch 'origin/feature/cierres' into feature/cierres 2025-07-15 19:07:03 -04:00
2f1628887e Permisos entrypoint 2025-07-15 19:06:07 -04:00
79073ebeb7 Beanstalkd -> Pheanstalk 2025-07-15 19:04:19 -04:00
501151a90e Beanstalkd for jobs 2025-07-14 14:29:41 -04:00
e6e7470bb2 Limit children 2025-07-12 11:00:08 -04:00
2efe4e4a85 Don't run all jobs directly 2025-07-12 10:48:50 -04:00
5ab94e7b2d Reset memory 2025-07-12 10:33:50 -04:00
e037c86e6f Run one job at a time. 2025-07-12 10:31:48 -04:00
595a71d7dd System info 2025-07-12 10:30:32 -04:00
8666499626 Merge remote-tracking branch 'origin/feature/cierres' into feature/cierres 2025-07-12 09:43:19 -04:00
f752256f76 Fcgi idle timeout 2025-07-12 09:43:02 -04:00
6dda5aef00 Habilitar sync 2025-07-03 17:30:58 -04:00
18e79b76d6 Better logging 2025-07-03 17:17:55 -04:00
239376fadc Send all 2025-07-03 17:13:22 -04:00
15ba23bf23 Toku update output 2025-07-03 17:06:00 -04:00
73328240cc Update invoices 2025-07-03 17:00:01 -04:00
495581de8f Update subscriptions 2025-07-03 16:59:41 -04:00
cb0731b67d Update subscriptions 2025-07-03 16:37:57 -04:00
4980839568 Merge remote-tracking branch 'origin/feature/cierres' into feature/cierres 2025-07-01 17:16:39 -04:00
7714e25270 Uso de cuenta al agregar y editar para Toku 2025-07-01 17:14:53 -04:00
8a043b21bc Migracion para guardar account-key de toku 2025-07-01 17:14:21 -04:00
925faeb6f4 Migracion para guardar account-key de toku 2025-07-01 15:28:07 -04:00
f11b7dcd9b PHP more request handlers 2025-06-30 17:25:48 -04:00
e35053edce FastCGI Command max requests 2025-06-30 17:09:45 -04:00
829ab86770 FastCGI pool 2025-06-30 16:39:55 -04:00
4b66694166 Batch queue 2025-06-30 15:52:36 -04:00
d4f8804fbb Batch queue 2025-06-30 15:52:28 -04:00
5f4d8a4bc2 FIX: separate details exception 2025-06-30 11:47:57 -04:00
1fa152c07f FIX: new line exception.log 2025-06-30 11:44:05 -04:00
7f8bd607e3 Job retries 2025-06-27 18:42:47 -04:00
1bbee1121b FIX: Authorization en FastCGI 2025-06-27 18:00:45 -04:00
352e33179c More detail 2025-06-27 17:42:09 -04:00
f34d7338f1 FIX: FasCGI Response 2025-06-27 17:35:17 -04:00
4dd83ae63d FIX: Error observado 2025-06-27 17:24:04 -04:00
e265854958 FIX: Error observado 2025-06-27 17:21:25 -04:00
174b29efff FIX: str_starts_with 2025-06-27 17:17:21 -04:00
1c0f4a5ae9 Try to register fatal errors in file 2025-06-27 17:17:06 -04:00
ccee5f9f56 FIX: more details 2025-06-27 16:58:15 -04:00
9677f11aef FIX: seguir cuando existe error. 2025-06-27 16:56:24 -04:00
c21de2848d FIX: saltarse lineas comentadas 2025-06-27 16:51:16 -04:00
348bb18654 LoggerEnabled Fix 2025-06-25 18:14:43 -04:00
a2a9f4bbb4 LoggerEnabled Fix 2025-06-25 18:11:28 -04:00
ab7328b40b FastCGI 2025-06-25 18:07:08 -04:00
7f97862324 Revisiones 2025-06-25 12:41:28 -04:00
9edf0d9120 Revisiones 2025-06-25 12:22:01 -04:00
ca1ed3f870 Pruebas de integracion con seeds 2025-06-24 21:55:02 -04:00
360537c638 Prueba de integracion para service worker 2025-06-24 14:24:47 -04:00
a6e6b8acc0 Prueba de integracion para service worker 2025-06-24 12:56:03 -04:00
a4e2b4fc7a Seed TipoEstadoPago 2025-06-24 12:55:46 -04:00
479047cd6a Dependencias para testeo 2025-06-24 12:55:02 -04:00
29d9ea8e4a Correr seeds y botar tablas al final 2025-06-24 12:54:48 -04:00
a7cd661938 Registro de worker 2025-06-24 12:54:32 -04:00
7bdcc7168a Container separado a archivo a parte para poder cargarlo en otros lados 2025-06-24 12:54:19 -04:00
d2dff57531 FIX: id de migracion 2025-06-24 12:53:56 -04:00
39198bbe7c get Uf asincronico 2025-06-24 11:20:53 -04:00
200510d60a Prueba Service Worker 2025-06-24 11:20:21 -04:00
ecc67a43c8 Service Worker, corre metodos de servicios asincronicamente, requiere parametros escalares y no retornar mas que bool o void 2025-06-24 11:19:58 -04:00
64791d1fc5 Alias enqueue 2025-06-24 11:16:29 -04:00
4053854410 Prueba UF 2025-06-24 11:16:19 -04:00
a687743762 FIX: No buscar UF para fechas mayores a hoy o día nueve del mes 2025-06-24 11:04:33 -04:00
38fb6f3bcc Pausa a external 2025-06-19 16:47:24 -04:00
1e6bac61b5 FIX: Limpiar archivos 2025-06-19 16:47:06 -04:00
a611ae247d FIX: prorrateo ingresado en valor % 2025-06-12 11:28:04 -04:00
c02c6eb15c FIX: Add custom HttpException 2025-06-10 19:36:56 -04:00
b7e0217cf3 FIX: remove ext-http 2025-06-10 19:35:17 -04:00
2fd1a44984 FIX: install ext-http with external script 2025-06-10 19:04:32 -04:00
fe912db62b Add ext-http 2025-06-10 18:20:05 -04:00
da90160a2a Add ext-http 2025-06-10 18:02:05 -04:00
64047ef577 TOKU: FIX: exceptions 2025-06-10 17:48:36 -04:00
feef90afd6 TOKU: payments loop through pages 2025-06-10 17:46:16 -04:00
32e1e49a97 FIX: cuerpo para borrar payments 2025-06-10 17:34:04 -04:00
11c64cb10f FIX: url para borrar 2025-06-10 17:29:39 -04:00
823f97ce5f FIX: log levels 2025-06-10 17:24:38 -04:00
4ae72199fc Better external logging 2025-06-10 17:00:20 -04:00
d841b1aeed FIX: url de payments en Toku 2025-06-10 16:57:34 -04:00
666cac1958 FIX: url de payments en Toku 2025-06-10 16:54:46 -04:00
71c189e236 FIX: circular dependency 2025-06-10 16:49:34 -04:00
5b6a1c42e3 Toku: reorden 2025-06-10 16:28:46 -04:00
81bce6fe7f Cleanup 2025-06-10 16:28:13 -04:00
e1072ea252 Toku: Reset payments 2025-06-10 16:26:33 -04:00
21473fe52c Valor cuota en CLP 2025-06-10 15:27:09 -04:00
7d589e0e87 Valor cuota en CLF 2025-06-10 15:24:51 -04:00
c48a0d2381 Valor cuota en CLP 2025-06-10 15:14:25 -04:00
abb1ce7299 Mas logging 2025-06-09 12:44:42 -04:00
f1ed9668fc email -> mail 2025-06-06 18:25:12 -04:00
f9ae809fc4 Data too large 2025-06-06 18:10:59 -04:00
06e5292af1 Log add response 2025-06-06 18:10:06 -04:00
47ba664142 Log customer params 2025-06-06 18:04:57 -04:00
d10ee33215 better format for mysql 2025-06-06 17:55:58 -04:00
5134630525 Correct Exceptions 2025-06-06 17:37:42 -04:00
13b246b998 Merge remote-tracking branch 'origin/feature/cierres' into feature/cierres 2025-06-06 17:11:33 -04:00
d601d7d719 Mas logs y middlewares en Guzzle 2025-06-06 17:11:22 -04:00
dc0ae2746b FIX: Correct HMAC validation 2025-06-03 23:07:47 -04:00
eb402b1b71 FIX: notice logs 2025-06-03 23:07:08 -04:00
c5188a1feb HMAC not static 2025-06-03 23:04:57 -04:00
1c3052219c Debug 2025-06-03 22:59:49 -04:00
9e8a388653 Debug 2025-06-03 22:59:03 -04:00
cbee830f7a Debug 2025-06-03 22:55:35 -04:00
d5b8c7f877 FIX: JSON_SEARCH 2025-06-03 22:51:26 -04:00
b668844fea Debug 2025-06-03 22:29:13 -04:00
f2169c9536 FIX: fetch all values in column 2025-06-03 22:27:15 -04:00
48bcb33bad FIX: event_types -> events 2025-06-03 22:24:09 -04:00
92ae0b4ac2 FIX: Missing connection 2025-06-03 22:22:33 -04:00
44540d0dc3 Validated external query log 2025-06-03 22:19:11 -04:00
d9a2f63691 Use webhook secrets to validate 2025-06-03 22:11:57 -04:00
b10accf602 Store webhooks 2025-06-03 22:01:03 -04:00
981858f251 HMAC implementation for signature validation 2025-06-03 21:53:49 -04:00
8c0bd450ef FIX: delete url 2025-06-03 21:26:10 -04:00
8996765cb4 FIX: maxLogLevel 2025-06-03 21:16:44 -04:00
ec2451cb69 FIX: maxLogLevel 2025-06-03 21:12:43 -04:00
37d30d2aec Cleanup logs 2025-06-03 21:09:13 -04:00
afb6e2526f FIX: Timezone cli 2025-06-03 20:14:15 -04:00
a9b6f2a87b FIX: Error code for missing TOKU_ENV 2025-06-03 19:58:36 -04:00
9aeb6906f6 Debug 2025-06-03 19:43:46 -04:00
879d365baf Not needed 2025-06-03 19:42:23 -04:00
1d03b262ae Debug 2025-06-03 19:35:36 -04:00
2c175c8171 Detailed login errors 2025-06-03 19:20:55 -04:00
a750bdbfaa Detailed login errors 2025-06-03 19:20:44 -04:00
7f6d0232c0 Cleanup files 2025-06-03 19:20:09 -04:00
37cff67a1c Log reseteando 2025-06-03 17:06:39 -04:00
bc3d739af9 Cleanup 2025-06-03 16:52:01 -04:00
46efbb57c1 Log body de reset 2025-06-03 16:25:07 -04:00
d71333b334 Queue cada 2 minutos 2025-06-03 16:13:04 -04:00
688b500f1e Parametros correctos 2025-06-03 16:06:14 -04:00
d4b1a66a9e FIX: ventas_ids vacios 2025-06-03 16:02:04 -04:00
e796d91d95 Si token no existe, no se puede borrar 2025-06-03 16:01:48 -04:00
2a442417ce FIX: Loop frequency 2025-06-03 13:01:40 -04:00
3c161ed4e9 Loop frequency 2025-06-03 12:58:57 -04:00
3c8822e531 FIX: Log job requests 2025-06-03 12:46:47 -04:00
b3b91d3f8f Log job requests 2025-06-03 12:45:36 -04:00
6e34a76a3f FIX: Request log processor no funciona 2025-06-03 12:34:08 -04:00
ed29dfb984 Request Log Processor 2025-06-03 12:17:52 -04:00
7f37dc76e3 Log forbidden 2025-06-03 12:06:35 -04:00
a62293e509 Mejora en separacion 2025-06-03 12:06:02 -04:00
fbfc2cb8ae Cambios de usos de env vars 2025-06-03 12:04:53 -04:00
02665ac6bd Extras ya enviados por processor 2025-06-03 11:52:31 -04:00
300d966f3f Separation of logs in cli 2025-06-03 11:49:03 -04:00
27031035ed Filtro en server params faltante 2025-06-03 11:45:36 -04:00
18fc9a76fd Filtro en server params 2025-06-03 11:37:14 -04:00
cb6fa73a21 FIX: Recargar proyectos si no se encuentra proyecto_id, si aun no existe retornar 0 2025-06-03 10:35:07 -04:00
8796762cfe Mas datos en el registro de accessos 2025-06-03 10:24:54 -04:00
99c9952c93 Mas datos en el registro de logins. 2025-06-03 10:22:52 -04:00
9895fd6a70 FIX: Mas registro de login desde cli 2025-06-02 18:45:11 -04:00
c1149d89be FIX: Cleanup after create, but before initialized query. 2025-06-02 18:03:43 -04:00
7d8e2249de FIX: Detalle en logging. 2025-06-02 17:58:24 -04:00
a54586e870 FIX: valor cuota cuando UF no existe. 2025-05-30 17:10:59 -04:00
734f258382 Validar con headers 2025-05-30 14:18:48 -04:00
f728ed0b55 FIX: Log de envio 2025-05-30 12:48:12 -04:00
6144accb8e FIX: Toku envía complejo el header 2025-05-29 19:56:43 -04:00
f399eb8d47 Validate with service 2025-05-29 19:43:06 -04:00
b4159d1417 Log external tries 2025-05-29 19:24:35 -04:00
2a792a947d More granular control of external validation configuration 2025-05-29 19:22:55 -04:00
25710d616a Registro de success entrantes 2025-05-29 19:15:17 -04:00
3197802264 Cleanup 2025-05-29 19:10:09 -04:00
6c53127c2f Body json 2025-05-29 19:06:54 -04:00
b7391a77d3 DEBUG: body 2025-05-29 17:44:30 -04:00
5b499aee75 Content-type 2025-05-29 17:43:14 -04:00
4505531c5f Output body 2025-05-29 17:42:21 -04:00
3f8adc753c Add body to Enqueue command 2025-05-29 17:40:45 -04:00
ace205798f FIX: Manejo de Errores en Ventas 2025-05-29 16:02:13 -04:00
6e0e1fc75e Parametros faltantes 2025-05-27 19:30:08 -04:00
026474c63c Enqueue ventas para enviar a Toku 2025-05-27 19:24:23 -04:00
f32204df97 FIX: Remove toku concept in database 2025-05-27 18:35:06 -04:00
2852816eae FIX: Parametros extra para Toku 2025-05-27 18:27:37 -04:00
892cdf324f Comando para resetear Toku 2025-05-27 18:17:56 -04:00
a9a10e012d Uso de external Logger para los servicios External 2025-05-27 16:28:34 -04:00
b7089f7a1c Timezone por DI 2025-05-27 16:19:47 -04:00
aed26cfcd8 FIX: Estado cuota abono 2025-05-23 12:15:51 -04:00
896dded6eb Apellido materno en blanco 2025-05-23 12:12:34 -04:00
3b03c4b64b Logging 2025-05-19 16:06:44 -04:00
f34ed03b84 Logging 2025-05-19 14:02:55 -04:00
ce75ec1548 External logs
FIX: Ofuscator
2025-05-19 13:55:59 -04:00
312baa34f6 Access Logs 2025-05-19 13:14:13 -04:00
b7c5e4ebc3 Opcion de enviar update a los servicios externos 2025-05-16 19:14:20 -04:00
105179b4ed Fixes de telefono y apellido de persona 2025-05-16 16:35:17 -04:00
16cd29635d Zona horaria en cli 2025-05-16 14:47:31 -04:00
2bdb2a0ed0 Uso de zona horaria en output de comandos 2025-05-16 14:44:48 -04:00
8ce7d2570d FIX: Check if invoice exists before sending, if exists then save
Send correct UF amount if date in future
2025-05-16 14:36:20 -04:00
8ba54fd3ad Queue command with direct redis access so it's faster 2025-05-16 13:56:32 -04:00
f47f86dd2b BaseLoop different logger 2025-05-16 12:54:52 -04:00
8ca68bf7e8 Crontab para revisar servicios externos 1 vez al dia 2025-05-15 19:33:53 -04:00
8965354528 Cambio en queue para que no quede pegado esperando respuesta en cli.
Chequeo de servicios externos para agregar elementos pendientes.
2025-05-15 19:32:25 -04:00
8d32aecd09 Zona horaria en logs 2025-05-15 16:07:29 -04:00
c8f79e076e Envio de datos editados de Propietario 2025-05-15 16:05:55 -04:00
9e0d604d79 Respuesta 200 a webhook de Toku 2025-05-15 16:05:03 -04:00
331d004040 Eliminar script::type 2025-05-15 16:04:35 -04:00
03317b3aa5 Agregar datos propietario 2025-05-15 15:23:34 -04:00
e33edc4d7b FIX: proyectos minuto 0 de cada hora, en vez de cada minuto de esa hora 2025-05-15 12:08:33 -04:00
bb459a2ff5 FIX: proxy no identificado por web 2025-05-15 11:47:28 -04:00
5e2d2e861f Logs no pasan desbordan de nivel 2025-05-15 10:53:59 -04:00
e9b2fe9963 FIX: monto enviado en UF 2025-05-15 10:12:34 -04:00
2f481ef8a9 FIX: mapeo de datos al actualizar pago 2025-05-15 10:06:35 -04:00
386fe452af Catch error 2025-05-15 10:06:00 -04:00
91ad1e39f8 Endpoint para la prueba 2025-05-14 12:41:59 -04:00
a3a5b58cfb Correctos parametros 2025-05-13 20:19:03 -04:00
1d77d65af2 Ventas con cuotas pendientes 2025-05-13 20:18:51 -04:00
0f0c81e283 Uso de request en queue 2025-05-13 20:18:40 -04:00
ac278ca690 Parametros correctos para persona. 2025-05-13 20:18:20 -04:00
97d34f9ad6 Uso de request original 2025-05-13 20:18:09 -04:00
134588c96d Envio de estado de cuotas. 2025-05-13 20:17:53 -04:00
8b6516241d Manejo de contenido 2025-05-13 20:13:15 -04:00
d6e60efcaf Parametros correctos 2025-05-13 20:12:26 -04:00
3e937ab748 Fetch ventas con cuotas pendientes 2025-05-13 20:11:49 -04:00
fa6881d0a9 Formato correcto de fecha y bool 2025-05-13 20:11:02 -04:00
f07c1f1cbd Formato correcto de fecha 2025-05-13 20:10:46 -04:00
148d08089d Estado Cuota y Pago 2025-05-13 20:10:24 -04:00
45b6ee710e Job mas completo 2025-05-13 20:10:12 -04:00
c84277fdc4 Update services 2025-05-13 20:09:50 -04:00
c0024a4a63 Parse body correctly and test fill 2025-05-13 20:03:20 -04:00
308a84a448 Send current request to queue for parameters 2025-05-13 20:02:50 -04:00
91c74bf113 Min log level 2025-05-13 16:17:47 -04:00
024a6eae54 Jobs not being updated 2025-05-13 16:06:09 -04:00
d536342425 No output on wait 2025-05-13 15:58:49 -04:00
e7f3b33850 Wait till next minute after running jobs 2025-05-13 15:53:13 -04:00
c47d94d475 FIX: missing use 2025-05-13 15:49:41 -04:00
ee74fc7588 FIX: esperar al siguiente minuto 2025-05-13 15:47:18 -04:00
5ac324de6a Hora en output 2025-05-13 15:40:32 -04:00
dfb0ff7aea Missing middlewares 2025-05-13 15:16:29 -04:00
6d1a1c914a Wait for execution 2025-05-13 15:15:20 -04:00
b45d03aa7e Reestructura APIClient 2025-05-13 09:32:48 -04:00
4e0b611bcf FIX: Mayuscula 2025-05-13 09:31:51 -04:00
20ea5d021d FIX: missing text 2025-05-12 19:58:20 -04:00
32dc24a783 Newline 2025-05-12 19:54:03 -04:00
95a6aa96e9 Queue 2025-05-12 19:46:31 -04:00
f14cdd2730 Updates 2025-05-12 19:46:09 -04:00
3006adb0f7 Configuracion servicios 2025-05-12 19:44:58 -04:00
d22480dcb8 User edit and delete 2025-05-12 19:44:16 -04:00
425b85e40d Unify cli logs 2025-05-12 19:44:00 -04:00
2c21e48562 FIX: DEPRECATED 2025-05-12 19:43:39 -04:00
8d3ce99be7 Update env sample 2025-05-12 18:32:30 -04:00
35386724b3 FIX: DEPRECATED 2025-05-12 18:07:14 -04:00
1597657f0e FIX: Toku external 2025-05-12 16:35:33 -04:00
c6bbaf3404 FIX: DEPRECATED 2025-05-12 16:08:10 -04:00
9e2d7277b0 Validacion API/external 2025-05-12 16:01:09 -04:00
abe37227ce API/external 2025-05-12 15:47:51 -04:00
32130f0bc2 Usando variables definidas 2025-05-12 14:04:58 -04:00
d78bdaa7f5 Falta ortografia 2025-05-12 13:57:43 -04:00
1266c3859d Migration for Jobs 2025-05-12 13:54:28 -04:00
c5466b2c4d Ignore optionals 2025-05-12 13:15:22 -04:00
6d8e8a9068 Env sample update 2025-05-12 13:06:44 -04:00
4d5b657b92 Manejo de trabajos en cli por php en vez de cron 2025-05-10 12:40:06 -04:00
4ca1616dfc Integracion Toku a flujo 2025-05-10 12:39:31 -04:00
fb7177fd65 Reorden Toku 2025-05-10 12:38:14 -04:00
1486d6cf38 Toku settings 2025-05-10 12:32:01 -04:00
8b2de31e02 Job Queue 2025-05-10 12:30:35 -04:00
61324f159b Toku endpoint 2025-05-10 12:30:21 -04:00
c95e74d574 Controlador Toku 2025-05-09 18:31:00 -04:00
59ecb6cc79 Se agregan fetchs 2025-05-09 18:05:40 -04:00
db84187461 Pruebas de Toku 2025-05-09 18:05:19 -04:00
c2f98c8b0d Excepcion 2025-05-09 18:04:37 -04:00
8d73987ac3 FIX: Cambios a Servicios Toku 2025-05-09 18:04:17 -04:00
400b2754bf FIX: Totales para multipropietario no sumaban correctamente 2025-05-09 13:33:08 -04:00
418becaeda FIX: onChange 2025-05-08 18:15:32 -04:00
679b401101 Servicio Toku para enviar datos 2025-05-08 17:17:49 -04:00
26b6862955 FIX: prueba Servicio Customer 2025-05-08 17:17:24 -04:00
e239669839 FIX: prueba modelo Customer 2025-05-08 17:16:55 -04:00
adc0e52c1e Fix: estructura interface 2025-05-08 17:16:32 -04:00
d1905194bd rut en Customer en formato Toku 2025-05-08 17:16:03 -04:00
a5c1d60819 Servicios para Toku 2025-05-08 16:17:26 -04:00
5ad4fc4038 Tests de Repositories 2025-05-08 16:17:14 -04:00
ca5354a3ee Cambio en namespace 2025-05-08 11:13:23 -04:00
c1ebac6c0c Pruebas de repositories 2025-05-08 11:13:06 -04:00
f742c7ddd0 Pruebas de modelos 2025-05-08 10:45:31 -04:00
5d5f9866bb Modelos para Toku 2025-05-07 20:05:00 -04:00
0866292d84 Migraciones para guardar datos de Toku 2025-05-07 20:04:27 -04:00
e02ed4684f LoggerAwareInterface abstract 2025-05-07 20:04:06 -04:00
8be5f94b7c Log solo los errores fatales. 2025-05-07 20:01:55 -04:00
878b02ee52 SII falla si fecha está en el futuro. 2025-05-07 19:42:39 -04:00
f3e15b34a8 Persona conectada con Propietario 2025-05-07 19:24:33 -04:00
3903551176 FIX: migraciones fallando 2025-05-07 19:23:37 -04:00
43eb8ec758 FIX: no borra todo 2025-05-07 19:22:39 -04:00
a405b15410 Uso de script central de Rut 2025-05-06 10:00:12 -04:00
a2f2d94e64 Docker image con tag 2025-05-06 09:47:54 -04:00
0587b64d65 Docker image 2025-05-06 09:37:23 -04:00
a6b81f1bff FIX: Not needed 2025-05-06 09:15:46 -04:00
4239bafc26 FIX: echo append 2025-05-05 19:33:46 -04:00
6591e9f80e FIX: debian ftp 2025-05-05 19:33:01 -04:00
b57f32c86b FIX: Circular dependency 2025-05-05 19:10:31 -04:00
0e903f99c4 FIX: Circular dependency 2025-05-05 19:08:44 -04:00
186cd0f5b8 Reparaciones con Prueba 2025-05-05 19:01:15 -04:00
167d8e1ab7 PHP Dom en PHP 8.4 2025-05-05 19:00:41 -04:00
46802507a7 SII como provider de UF 2025-05-05 18:16:18 -04:00
aaf2ed7612 UF service en Venta 2025-05-05 18:15:48 -04:00
3ced9e40b1 const en Money y multi provider 2025-05-05 18:15:29 -04:00
594cb68b09 Provider SII 2025-05-05 18:14:50 -04:00
af68c4b8ec Ine null date 2025-05-05 18:14:20 -04:00
ea8f483dd5 FIX: Repository UF 2025-05-05 18:13:55 -04:00
5f53c77a1f Repository::getConnection 2025-05-05 18:13:12 -04:00
b9adb9108b Provider null date 2025-05-05 18:12:58 -04:00
8be085222a Not Allowed template 2025-05-05 16:46:41 -04:00
d1e4314b35 Valor de UF de hoy cuando no se encuentra valor. 2025-05-05 16:46:14 -04:00
7d04b406ab Grabar UF y capacidad de obtener hoy. 2025-05-05 16:45:43 -04:00
972e57b6f1 Mejora en respuesta cuando no existe algun valor. 2025-05-05 16:43:24 -04:00
5f63bdbf4a Fecha maxima de venta es hoy 2025-05-05 16:41:08 -04:00
a8325c3310 Uso de NumberInput en Edit BonoPie 2025-05-05 15:55:23 -04:00
7e54b72587 NumberInput, para formateo de numeros 2025-05-05 15:45:07 -04:00
ebe31a3d3d Guardar UF en DB 2025-05-05 15:40:55 -04:00
db6445bcf3 Cleanup View 2025-05-05 15:40:26 -04:00
4e1901b7c8 FatalErrors 2025-05-05 15:40:05 -04:00
c3316029c9 Se borra migracion duplicada 2025-05-05 14:01:39 -04:00
cbfc796685 Merge remote-tracking branch 'origin/feature/cierres' into feature/cierres 2025-05-05 11:35:29 -04:00
da56192f97 Formateo de numeros en JS 2025-04-30 23:36:32 -04:00
b5d08620f9 Unidades que no son departamentos 2025-04-30 17:13:40 -04:00
c92b07ee6f Excepcion correcta 2025-04-30 17:13:26 -04:00
ee6956d417 Reorden 2025-04-30 16:18:20 -04:00
21d5e2d03b Api en archivo separado 2025-04-30 16:18:00 -04:00
73a742c01e Nada en public 2025-04-30 10:51:47 -04:00
dd42c12d49 Orden 2025-04-30 10:38:20 -04:00
41ea5f5c15 Update prueba 2025-04-30 10:38:05 -04:00
eeb6f5bcd1 Se agrega condicion 2025-04-30 10:37:57 -04:00
2680f51167 Correccion migracion 2025-04-30 10:37:41 -04:00
019d57a0b0 Nuevas pruebas 2025-04-30 01:12:23 -04:00
1a400d9a5c Watcher solo para unit tests 2025-04-30 01:12:09 -04:00
6276f87274 Pruebas nuevas 2025-04-30 00:14:38 -04:00
28c93a42bc Logs de pruebas 2025-04-30 00:14:24 -04:00
4ff5d28522 Nuevas pruebas 2025-04-29 23:57:59 -04:00
a93642c55d Actualizacion de pruebas con extensiones 2025-04-29 23:57:49 -04:00
87c0d8c8d9 Se mueve todo a extension de pruebas 2025-04-29 23:55:51 -04:00
dd1741a930 Broker test 2025-04-29 23:21:19 -04:00
ad0fd82a9e Assert nuevo 2025-04-29 23:21:13 -04:00
bae5c1740d No mas require 2025-04-29 23:19:05 -04:00
f5f1482b7a Autoload para pruebas 2025-04-29 23:18:55 -04:00
4bd5fe16df Comandos para correr pruebas y consola 2025-04-29 23:18:18 -04:00
61845fbd05 Ignorar datos de pruebas 2025-04-29 22:26:26 -04:00
f8ac0f14f0 Abstracts 2025-04-29 22:25:32 -04:00
acb7a1336d Coverage lento e innecesario 2025-04-29 22:25:11 -04:00
8af56137a8 Seeds al migrar 2025-04-29 21:51:19 -04:00
c3247838b3 Namespace test Servicio Valor 2025-04-29 21:43:21 -04:00
dd82ac6bb7 Tests Home 2025-04-29 21:42:57 -04:00
2acf0362fa Ambiente de testeo 2025-04-29 21:41:49 -04:00
e6892ee085 Valor de PU cuando unidad no tiene valor 2025-04-29 13:01:57 -04:00
86b8d6b3c7 Limpieza 2025-04-29 13:01:21 -04:00
53115b085f Asegurarse que el valor entregado a Pago es en pesos. 2025-04-29 11:29:23 -04:00
c3b7427f60 Cambio en nombre de metodo y uso de valor maximo para UF 2025-04-29 11:20:49 -04:00
5d939f970b Valor con pruebas 2025-04-28 20:20:43 -04:00
4845801b27 Uso de script central de rut 2025-04-28 19:00:40 -04:00
d5bf9a7660 Digito verificador 2025-04-28 18:59:37 -04:00
795dda868b Ya no se incluye UF/m² y se transforman en numeros las UF 2025-04-25 20:03:11 -04:00
53a3633dc7 Menu -> Agregar Venta separado 2025-04-25 20:02:24 -04:00
0143fd11ac Se pasan datos a EmptyResult en base- 2025-04-25 19:41:42 -04:00
55745a8d0a EmptyResult ahora puede llevar los datos. 2025-04-25 19:41:23 -04:00
2a1930c5f7 FIX: Propiedad con unidad_principal 2025-04-25 19:25:16 -04:00
31f49dddb6 FIX: unidad_principal no tiene valor por defecto. 2025-04-25 17:36:12 -04:00
b4ca59fb6d Optimizacion de obtencion de datos. 2025-04-24 19:23:39 -04:00
d910f3eb69 FIX: Propiedad sin unidad_principal 2025-04-24 18:54:54 -04:00
555cdb7138 Promociones en misma tabla para tipo 2025-04-24 18:50:04 -04:00
65088da2f5 Promociones en misma tabla para tipo 2025-04-23 16:49:52 -04:00
966b341b65 Listado de promociones 2025-04-22 18:34:23 -04:00
90b05ca25c Se elimina la comision del excel 2025-04-22 16:28:13 -04:00
bb3a2fffa1 Cuando no existen promociones 2025-04-22 15:38:30 -04:00
8a5e41a722 Normalizacion con profundidad 2025-04-22 15:31:55 -04:00
5736a346e7 Valor debiese ser el último precio. 2025-04-22 15:24:11 -04:00
4f4e69f0c3 FIX: no tiene precio ahora, solo valor 2025-04-22 15:19:25 -04:00
00deebeaa8 FIX: faltaba valor 2025-04-22 15:19:08 -04:00
aee0754b5a Simplificacion de retorno de ventas por unidades 2025-04-22 15:18:59 -04:00
eabdab23c3 Simplificacion de retorno de ventas por unidades 2025-04-22 13:08:15 -04:00
5147450ed6 Manejo de excepciones 2025-04-22 13:07:52 -04:00
ed96f25475 Mayor orden 2025-04-22 11:49:34 -04:00
d5a3512852 Barras de progreso 2025-04-22 11:35:56 -04:00
d6730cd020 Cambio en link 2025-04-22 09:29:14 -04:00
c7dddc818c Definicion de variables una sola vez 2025-04-22 09:28:45 -04:00
33b4182bd3 Optimizacion de queries a cargar de una sola vez 2025-04-22 09:28:12 -04:00
fc776e6cec Ruta para Ventas por unidades 2025-04-21 19:43:20 -04:00
5d79ea83c3 Mostrar valor de venta para unidades vendidas 2025-04-21 19:43:01 -04:00
c34048a53a Ventas por unidades 2025-04-21 19:41:20 -04:00
f7af93b815 Throw Read 2025-04-21 19:40:26 -04:00
993e4ff3b8 Merge branch 'develop' into feature/cierres 2025-04-11 13:35:13 -04:00
ba57cad514 feature/editar-bono-pie (#24)
Rutas y controladores para editar bono

Formulario para editar bono pie

Filtro de columnas

Uso de nuevas estructuras y editar Bono Pie

Uso de nuevas estructuras.

Capacidad de pasar a pesos o a UF en Servicio Valor

FIX: botón incorrecto

Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl>
Reviewed-on: #24
2025-04-11 17:34:40 +00:00
bc49ba7629 FIX: Busqueda no funcionaba 2025-04-09 09:29:53 -04:00
3c2b486083 Se agregan columnas y el calculo de promociones de tipo fijo 2025-04-08 19:04:46 -04:00
76f69f3bda Optimizacion simple 2025-04-08 18:38:18 -04:00
8ba3c456b6 Link a contrato en vez del proyecto 2025-04-08 18:35:07 -04:00
98b18fab3e Cambios solicitados 2025-04-08 18:30:14 -04:00
12a4831887 Merge branch 'develop' into feature/cierres 2025-04-04 13:23:00 -03:00
86d030bb71 Merge pull request 'FIX: no permite escriturar cuando se reajusta si no existe pie' (#23) from fix/no-escritura into develop
Reviewed-on: #23
2025-04-04 16:20:39 +00:00
3b38b5d349 Si no existe Pie no muestra reajuste.
Mostrar loading mientras se guarda
2025-04-04 13:19:20 -03:00
da46914de4 Promociones en Contrato 2025-04-04 12:56:49 -03:00
596bc71cf8 Mejoras UI 2025-04-04 12:54:51 -03:00
7f8e4ea943 FIX: query fallaba 2025-04-04 12:36:03 -03:00
5456485f71 FIX: ya no existe relacion con contratos 2025-04-04 12:08:46 -03:00
836503a71b Menus nuevos 2025-04-04 12:08:24 -03:00
4df0cca675 Filtro en excel 2025-04-04 11:53:25 -03:00
00a0adb4ac Espacio mas ajustado 2025-04-04 11:53:11 -03:00
037fcd60f3 Orden de queries 2025-04-04 11:52:50 -03:00
7a97fc9dfe Precios con promociones para listado brokers 2025-04-03 17:22:38 -03:00
7b2df74e4d Promociones para cada subdivicion 2025-04-03 17:22:11 -03:00
b5d6d0acb9 Mostrar porcentajes en venta 2025-04-03 13:56:11 -03:00
28fb96db6a Merge pull request 'feature/porcentajes-pie-y-bono' (#22) from feature/porcentajes-pie-y-bono into develop
Reviewed-on: #22
2025-04-03 16:51:15 +00:00
af4dec77d1 Merge remote-tracking branch 'origin/feature/porcentajes-pie-y-bono' into feature/porcentajes-pie-y-bono 2025-04-03 13:49:10 -03:00
df7f462ead Mostrar porcentajes en venta 2025-04-03 13:49:00 -03:00
68e436cd67 Mostrar porcentajes en venta 2025-04-03 13:43:46 -03:00
6d1782cac6 mejora en UX de busqueda 2025-04-03 13:38:11 -03:00
74a2cf7303 Actualizaciones en Format 2025-04-03 13:37:41 -03:00
4d6a1827a3 FIX: calculo de UF nula o 0 2025-04-03 13:37:17 -03:00
8a1e6a7761 Conecciones de Promociones 2025-04-03 13:15:56 -03:00
ced673e452 Correcto nombre de tabla 2025-04-03 13:12:57 -03:00
8a7a1d4e64 Merge branch 'develop' into feature/cierres 2025-03-27 11:44:54 -03:00
fd6577c984 Remove Drone CI 2025-03-26 18:32:09 -03:00
62ccdc9518 Drone CI 2025-03-26 18:24:52 -03:00
9be20ab1cd UF 0 o nula actualizadas para Pago y Pie 2025-03-26 16:54:53 -03:00
1c40f18624 Pagos sin uf retornan 0 2025-03-26 16:49:27 -03:00
db36549699 Agregar Pie 2025-03-26 16:41:54 -03:00
4ce83fb270 Merge branch 'develop' into feature/cierres 2025-03-26 15:42:47 -03:00
e7da0d5d00 Limpieza 2025-03-26 11:37:52 -03:00
e445298159 Json error 2025-03-26 11:37:38 -03:00
5740c0e47f Logs simplificados en dev 2025-03-26 11:37:16 -03:00
b191a01313 Promociones 2025-03-25 19:22:38 -03:00
d3b0026ca4 Agregar, editar y eliminar promociones 2025-03-18 19:13:47 -03:00
2b3f476df7 Agregar, editar y eliminar promociones 2025-03-18 19:12:59 -03:00
39c148b7b3 Cambio nombre archivo 2025-03-17 23:03:06 -03:00
bae0f1f555 Separacion de Promocion de Contrato y Precio
"Simplificacion" de datos en listado de precios
2025-03-17 22:49:48 -03:00
2e49e2c947 Listados separados por hojas (tabs) 2025-03-13 13:16:20 -03:00
68aebdb4fe Listado de Precios para Contrato Broker 2025-03-13 12:18:08 -03:00
346001db8e SearchBuilder configuration centralizada
FIX: CentroCosto TipoCuenta
2025-03-13 09:33:42 -03:00
8b04eb262f FIX: Editar datos Broker 2025-03-12 18:31:21 -03:00
7c7c8315e2 Editar Brokers y sus contratos 2025-03-11 17:41:11 -03:00
510e05e5ca FIX: rut con otros caracteres y maximo largo 2025-03-07 17:26:36 -03:00
5055d2703c Broker Contact 2025-03-07 17:11:59 -03:00
2bc30ab9e8 Formatear porcentajes menores a 1 2025-03-07 17:11:15 -03:00
c7ee440e03 Listado de brokers 2025-03-06 20:34:43 -03:00
18dd8c4ec0 Merge branch 'develop' into feature/cierres 2025-03-06 16:23:58 -03:00
61244f783a Merge pull request 'FIX: ServiceActions' (#21) from hotfix/exceptions into develop
Reviewed-on: #21
2025-03-04 16:52:44 +00:00
621da92b68 FIX: ServiceActions 2025-03-04 13:52:01 -03:00
5914176b8f Merge pull request 'FIX: casos en que PDO::execute retorna falso, pero sin tirar PDOException' (#20) from hotfix/cleaunp into develop
Reviewed-on: #20
2025-03-04 14:54:15 +00:00
5054d8f19b FIX: casos en que PDO::execute retorna falso, pero sin tirar PDOException
DateTime con parametro pasado DateTime
Model::jsonComplement
2025-03-04 11:53:14 -03:00
8ea4995f6b Contratos desde proyectos 2025-03-03 21:46:53 -03:00
aeeca65d94 Correcciones 2025-03-03 21:41:43 -03:00
5f69069aa0 Rutas Reservations 2025-03-03 16:53:36 -03:00
095a65a643 Cleanup por recomendaciones 2025-03-03 16:37:40 -03:00
928d2e57be Merge branch 'develop' into feature/cierres 2025-03-03 15:32:25 -03:00
e4e952e842 Merge pull request 'Cleanup' (#19) from hotfix/cleanup into develop
Reviewed-on: #19

Probado localmente
2025-03-03 18:28:52 +00:00
2a0335f834 Reservation Controller 2025-03-03 15:21:18 -03:00
9ccf53fa4e Reservation Service 2025-03-03 15:21:12 -03:00
8f16f33a1e Cleanup 2025-03-03 14:57:22 -03:00
ef54c36edc Cleanup 2025-03-03 14:56:18 -03:00
4aa88d5164 Rutas API Contratos 2025-03-03 11:26:45 -03:00
8ea13c3efd API Contratos 2025-03-03 10:47:48 -03:00
12e3d7ed3b Servicio Contratos 2025-03-01 13:26:55 -03:00
d165440483 Merge pull request 'hotfix/actualizacion-factura-al-cambio-de-unidad' (#18) from hotfix/actualizacion-factura-al-cambio-de-unidad into develop
Reviewed-on: #18
2025-03-01 15:40:41 +00:00
1720f6854b FIX: recargar facturas despues de cambiar precios 2025-03-01 11:29:17 -03:00
3e6452a44d Icono factura 2025-03-01 11:28:52 -03:00
a7fc89ac29 Merge branch 'develop' into feature/cierres 2025-02-24 21:36:35 -03:00
d02732b0dd NotAllowed exception catch 2025-02-24 21:36:03 -03:00
ecec1dd8df Merge pull request 'Poder editar la direccion de un proyecto' (#17) from feature/editar-direccion-proyecto into develop
Reviewed-on: #17
2025-02-24 21:16:00 +00:00
c1528d667a Poder editar la direccion de un proyecto 2025-02-24 18:15:16 -03:00
894d09ea6f Merge pull request 'FIX: Escritura no grababa valor' (#16) from hotfix/editar-propietario-no-guarda into develop
Reviewed-on: #16
2025-02-24 19:54:21 +00:00
ab3c8da4f6 FIX: Escritura no grababa valor 2025-02-24 16:53:12 -03:00
760e1782d0 Merge pull request 'FIX: Indice de Repo/Propietario:rut' (#15) from hotfix/editar-propietario-no-guarda into develop
Reviewed-on: #15
2025-02-24 19:12:29 +00:00
b8af053c43 FIX: Indice de Repo/Propietario:rut 2025-02-24 16:11:51 -03:00
fd6d61ec21 Merge pull request 'FIX: Calculos corregidos en factura' (#14) from hotfix/factura-mostrando-valor-terreno-incorrecto into develop
Reviewed-on: #14
2025-02-24 19:01:46 +00:00
0c0fbab585 FIX: Proporcion recuperada 2025-02-24 16:00:42 -03:00
2c3f2d3f92 Merge branch 'hotfix/factura-mostrando-valor-terreno-incorrecto' of git.provm.cl:Incoviba/oficial into hotfix/factura-mostrando-valor-terreno-incorrecto 2025-02-24 15:59:13 -03:00
15e0ff80f3 FIX: Calculos corregidos en factura 2025-02-24 15:56:55 -03:00
8116e012e7 FIX: Calculos corregidos en factura 2025-02-24 15:47:58 -03:00
38e1b00971 Merge pull request 'FIX: Fechas revisadas.' (#13) from fix/escriturar-fallando-cuando-existe-abono-o-reajuste-anterior into develop
Reviewed-on: #13
2025-02-24 17:04:40 +00:00
7b63cbc757 FIX: Fechas revisadas. 2025-02-24 14:02:12 -03:00
a71df4e70d Controlador y ruta de operadores para API 2025-02-24 12:41:50 -03:00
f17b7a758a withJson con error 2025-02-24 12:41:34 -03:00
7fb28cd44c Servicio operadores 2025-02-24 12:41:13 -03:00
a44bd610ad Excepciones de servicios 2025-02-24 12:41:00 -03:00
28bba8a438 Actualizacion de Modelos 2025-02-24 12:40:40 -03:00
0ec6ebdafe Actualizacion de Repos 2025-02-24 12:39:42 -03:00
3ebe256a66 Actualizacion de migraciones 2025-02-24 12:39:25 -03:00
9d135e2c26 Base de Datos 2025-02-18 16:02:10 -03:00
8b386b8b44 Merge pull request 'FIX: Banco vacio o con espacio' (#12) from fix/pago-sin-banco into develop
Reviewed-on: #12
2025-02-04 16:09:36 +00:00
9f56604917 FIX: Banco vacio o con espacio 2025-02-04 12:09:34 -03:00
4073b96796 Merge pull request 'feature/grabar-factura' (#11) from feature/grabar-factura into develop
Reviewed-on: #11
2025-02-04 13:37:32 +00:00
59a28a353b Guardar factura 2025-02-03 22:17:57 -03:00
71615050f3 Agregando o buscando el cliente primero 2025-01-17 16:56:47 -03:00
5f31b6857e Limpieza 2025-01-17 16:56:27 -03:00
ef46558040 Fix de index 2025-01-17 16:56:13 -03:00
079fd3bc74 Mapeo de JSONs 2025-01-17 16:56:03 -03:00
a5572e7c6a Ruta para editar 2025-01-17 16:55:46 -03:00
e031fd22d3 Separacion de objetos 2025-01-17 16:55:34 -03:00
d74beb5518 Separacion de objetos 2025-01-17 00:07:45 -03:00
055bf6ab20 Cambios en formato 2025-01-17 00:06:27 -03:00
45e9487b5c Dropdown de Comunas 2025-01-17 00:04:55 -03:00
bf054c22c2 Usar success 2025-01-17 00:04:34 -03:00
16100f622e Se agrega $statusCode 2025-01-17 00:04:11 -03:00
5f31bff6e5 Nueva estructura 2025-01-16 19:39:46 -03:00
7578775fed Migraciones 2025-01-16 19:39:45 -03:00
2579b0aa06 Merge pull request 'FIX: Fecha terreno' (#10) from fix/factura into develop
Reviewed-on: #10
2025-01-16 22:39:13 +00:00
3262ef9a62 FIX: Fecha terreno 2025-01-16 19:30:11 -03:00
44ea8acd39 Merge pull request 'FIX: En movimientos ahora se muestran las categorias y otros detalles faltantes.' (#9) from fix/movimientos-categorias into develop
Reviewed-on: #9
2025-01-13 20:59:26 +00:00
0870623236 FIX: En movimientos ahora se muestran las categorias y otros detalles faltantes. 2025-01-13 17:53:30 -03:00
87bd89d223 Merge pull request 'Validaciones' (#8) from feature/validacion-nueva-venta into develop
Reviewed-on: #8
2025-01-10 14:54:03 +00:00
728207d63d Validaciones 2025-01-10 11:39:36 -03:00
604c49c99d FIX: If pendiente 2025-01-10 11:10:30 -03:00
ce9078328a FIX: Validacion de RUT 2025-01-08 14:53:49 -03:00
713fcc6ab8 FIX: Rut retornado al agregar nuevo propietario 2025-01-08 14:53:22 -03:00
dfbfbd2908 FIX: Depreciado 2025-01-07 22:13:41 -03:00
8b8aa79b6d FIX: Mapeo de columnas faltante 2025-01-07 22:10:52 -03:00
e2d670a38c FIX: Index Respository 2025-01-07 21:44:23 -03:00
4d85b39cab FIX: Detalle movimiento->id 2025-01-07 21:43:00 -03:00
33c90f06dd FIX: Index Respository 2025-01-07 21:42:40 -03:00
3771af0282 FIX: Index Respository 2025-01-07 21:29:48 -03:00
574918f1cc Merge branch 'develop' of git.provm.cl:Incoviba/oficial into develop 2025-01-07 20:46:51 -03:00
e128152b5f FIX: Missing properties. 2025-01-07 20:46:28 -03:00
fc1371f0ed Merge pull request 'Se agrega el boton de terraza' (#7) from feature/agregar-terraza-con-venta into develop
Reviewed-on: #7
2024-12-30 23:48:54 +00:00
ec36c4a7a3 Merge branch 'develop' into feature/agregar-terraza-con-venta 2024-12-30 23:47:32 +00:00
2c1be63257 Se agrega el boton de terraza 2024-12-30 20:45:39 -03:00
6aca90c02f Merge pull request 'FIX: valor cuota al agregar usa . en formato para miles. Ahora limpia los . antes de agregar cuotas.' (#6) from hotfix/agregar-cuota-divido-1000 into develop
Reviewed-on: #6
2024-12-30 20:44:37 +00:00
a8bab175a2 FIX: valor cuota al agregar usa . en formato para miles. Ahora limpia los . antes de agregar cuotas. 2024-12-30 17:41:59 -03:00
95f9f4ef05 Merge pull request 'feature/migrations' (#5) from feature/migrations into develop
Reviewed-on: #5
2024-12-18 23:44:25 +00:00
2d868cb119 Remove seeds 2024-12-18 20:43:24 -03:00
d3df35daff Seeds corregidas 2024-12-18 20:33:16 -03:00
fdb9dcf9be Seeds corregidas 2024-12-18 20:33:16 -03:00
2ab3c25e96 Fix: nulls 2024-12-18 20:33:16 -03:00
46cdf74c52 Mejoras 2024-12-18 20:33:16 -03:00
d6b735f2aa Migrations and seeds 2024-12-18 20:33:15 -03:00
70710b24c5 Migration generator per table. 2024-12-18 20:33:15 -03:00
57fc6fa46e Migraciones 2024-12-18 20:33:15 -03:00
dafabdbbdb Merge pull request 'feature/colores-importar-movimientos' (#4) from feature/colores-importar-movimientos into develop
Reviewed-on: #4
2024-12-17 03:08:11 +00:00
34cb8bf0be Mostrar colores y posibilidad de eliminar movimientos obsoletos 2024-12-17 00:06:00 -03:00
0e049adc98 Id y fecha en texto para movimientos 2024-12-17 00:05:18 -03:00
e2284314bd Identificar movimientos nuevos y obsoletos 2024-12-16 23:05:38 -03:00
c4b9ca5ab7 FIX: Multiples condiciones en Select 2024-12-16 23:05:15 -03:00
e1b6fc7394 Merge pull request 'feature/Proveedores' (#3) from feature/Proveedores into develop
Reviewed-on: #3
2024-12-03 23:36:57 +00:00
fe74619482 Proveedores en movimientos 2024-12-03 20:32:29 -03:00
0766cf7e94 FIX: apellidos no existentes 2024-12-03 19:08:43 -03:00
fc575c3078 Menu incluye proveedores 2024-12-03 17:39:30 -03:00
187b6f6f05 Edit Proveedores 2024-12-03 17:35:29 -03:00
42e1dcdff7 Agregar Proveedor 2024-12-03 16:45:42 -03:00
5b44260245 Separacion logs 2024-12-03 16:45:04 -03:00
b2c55c08ce Servicio y vista 2024-12-03 11:55:06 -03:00
1f0f25bbde Migraciones 2024-12-03 11:55:06 -03:00
9f302e712c FIX: Desisitimiento no encontrado 2024-12-03 11:46:18 -03:00
2b1190202a FIX: Desisitimiento no encontrado 2024-12-03 11:39:25 -03:00
acb1081190 Logs diferentes para desarrollo 2024-12-03 11:39:11 -03:00
606b99a0f9 FIX: Key de prorrateo 2024-11-29 18:22:08 -03:00
44f32d9e5f FIX: Edit Pago sin "valor" 2024-11-29 18:09:55 -03:00
f5add0b4c5 FIX: No existe valor de terreno en BD 2024-11-29 16:15:15 -03:00
1d20d63294 Merge pull request 'feature/cuotas-abono-escritura' (#2) from feature/cuotas-abono-escritura into develop
Reviewed-on: #2
2024-11-29 17:24:16 +00:00
39da754d8b FIX: Cuotas se agregan sin UF, desface en la tabla 2024-11-29 14:22:05 -03:00
02fc372610 Merge branch 'develop' into feature/cuotas-abono-escritura 2024-11-29 14:13:42 -03:00
8aa1c787f4 Merge pull request 'feature/cuotas-abono-escritura' (#1) from feature/cuotas-abono-escritura into develop
Reviewed-on: #1
2024-11-28 22:24:48 +00:00
8028b673fb FIX: Editar cuotas 2024-11-28 19:14:14 -03:00
52de72b507 Sumar cuotas. 2024-11-28 17:38:21 -03:00
f4b8634cb4 Agregar y editar abono cuotas. 2024-11-28 17:12:35 -03:00
4f0a56c711 FIX: migracion 2024-11-28 15:12:30 -03:00
3ff5f3f1a6 Vistas 2024-11-28 14:07:07 -03:00
151d1d0209 Rutoa 2024-11-28 14:06:58 -03:00
b13f8a5b20 Numero de cuota 2024-11-28 14:06:44 -03:00
1d268f9a94 Controlador 2024-11-28 14:06:12 -03:00
a844589d7f Creacion de tabla 2024-11-28 14:06:00 -03:00
83ea955d89 Cuota abono en venta 2024-11-28 12:02:49 -03:00
4392f61db9 Cuota abono a escritura 2024-11-28 12:02:02 -03:00
a2352d79f9 Testing conectado a adminer 2024-11-28 11:41:19 -03:00
56d3a26cff Datos Persona 2024-11-28 11:41:03 -03:00
cc5c90e2c0 Cleanup tests 2024-11-28 11:40:53 -03:00
f9e079cc42 Migraciones 2024-11-20 21:26:03 -03:00
3f65a5dbd9 Composer mas libre 2024-11-20 20:49:32 -03:00
28036fdd05 FIX: Si no conecta con Nubox solo se reajusta el terreno. 2024-11-20 20:49:05 -03:00
54f3b95b88 FIX: Fecha comparación para terreno a fin de diciembre 2024-11-20 17:11:03 -03:00
1e2bd617fa FIX: Fecha comparación para terreno 2024-11-20 12:19:04 -03:00
62e7001fba FIX: Problemas de curl 2024-11-20 11:51:06 -03:00
bc8aa02236 FIX: Problemas de curl 2024-11-20 11:29:02 -03:00
5b30c0e36c FIX: Revert 2024-11-20 10:59:21 -03:00
da1fb26647 FIX: SSL Nubox mas antiguo 2024-11-20 10:52:55 -03:00
b1609465a9 FIX: Search venta 2024-11-19 15:54:14 -03:00
cb2edb1543 Agregar Bono Pie 2024-11-18 23:25:20 -03:00
1e1994264e Search con resumen de tipologias 2024-11-18 22:25:42 -03:00
f2cc0a8c47 Actualizacion de PHP 2024-11-12 21:52:43 -03:00
e474123699 Merge remote-tracking branch 'origin/develop' into develop 2024-11-12 21:52:25 -03:00
c3a99d5939 Migraciones y testeo 2024-11-12 21:52:10 -03:00
0212b3e405 Migraciones y testeo 2024-11-12 21:51:56 -03:00
e4ffcb52d8 FIX: eventos no se actualizaban con cambio de pagina en DataTables 2024-11-12 21:27:33 -03:00
37c28c3080 Editar estado cuota 2024-11-06 21:28:36 -03:00
d154212732 FIX: Editar pago 2024-11-06 19:55:49 -03:00
be410daa8b Datos para manejar mejor los requests externos. 2024-11-01 17:04:24 -03:00
38202d1382 FIX: UF despues de obtener estado. 2024-10-31 17:15:51 -03:00
1b99358597 Eliminar log innecesario 2024-10-31 17:15:38 -03:00
6107861381 Login log independiente 2024-10-31 17:15:23 -03:00
3d5799ae58 HTTPS 2024-10-31 16:31:42 -03:00
d649e03684 Logout en valod uris 2024-10-28 13:10:49 -03:00
fc3d25dd18 FIX: Cuotas hoy y pendientes. 2024-10-25 21:48:19 -03:00
532e0ec601 FIX: Reorden CORS 2024-10-25 18:56:14 -03:00
3e9f9a3fef FIX: CORS other requests 2024-10-25 18:40:59 -03:00
d1b255aa8b FIX: CORS headers 2024-10-25 18:38:23 -03:00
93a0832800 CORS authorization 2024-10-25 18:37:05 -03:00
4894809105 No usar schema para revision de url 2024-10-25 18:33:50 -03:00
389e60980e Editar cuota 2024-10-23 08:39:11 -03:00
fe6a01b2fb Redis options 2024-10-18 21:21:35 -03:00
2b6a8b35a5 Redis parameters 2024-10-18 21:15:13 -03:00
30a4d66be5 Redis username 2024-10-18 21:01:41 -03:00
089579f39f Redis password 2024-10-18 20:57:48 -03:00
63ea21f105 Comparar glosa en 75% 2024-10-10 18:48:44 -03:00
33409a18e3 Comparar glosa en mismo tamaño 2024-10-08 18:57:19 -03:00
2592794a49 Alertas 2024-10-03 21:11:06 -03:00
196c5b947f Modernizacion de repo Cuota 2024-10-03 20:38:35 -03:00
b9c2972fe9 Cuando existen cuotas asociadas a algun pie distintas al pie asociado 2024-10-01 17:35:23 -03:00
37015f7e95 PHP 8 2024-10-01 17:34:43 -03:00
c3b36dcdf7 Optimizacion 2024-10-01 17:34:27 -03:00
c68b773cbb FIX: Banco vacio 2024-10-01 17:33:29 -03:00
933e652dac FIX: centro_costo undefined 2024-10-01 13:20:23 -03:00
ff1e9ebb53 Optimizaciones 2024-10-01 13:11:46 -03:00
599880ae27 Editar movimientos 2024-10-01 13:11:15 -03:00
a4da8d8624 FIX: mes se ve raro 2024-09-24 21:10:57 -03:00
87dfb0ae6e Listar movimientos y exportar
TODO: editar
2024-09-24 21:02:28 -03:00
afbac7259a FIX: evitar correr funcion con valor vacio en Mapper 2024-09-24 13:26:41 -03:00
e2573f35d1 FIX: Officebanking mensual 2024-09-18 13:43:23 -03:00
b8d4b260b6 Timezone 2024-09-16 22:20:22 -03:00
ff06e70869 OfficeBanking usando isExcel y correccion en procesamiento de valores. 2024-09-16 22:13:38 -03:00
5e7326a4b6 Limpieza 2024-09-16 22:12:30 -03:00
26a227c8ae Itau funcionando para ByV BCI 2024-09-12 18:08:48 -03:00
5defd2b564 Itau funcionando para ByV y Vialcorp 2024-09-12 16:41:57 -03:00
74b15add36 Cartolas Security 2024-09-03 00:10:46 -04:00
d8d2cba308 Excel functions for Cartola Banco Service 2024-09-03 00:07:52 -04:00
5983a4b20f Parse rut and 0 centro_costo 2024-09-03 00:07:06 -04:00
6e4dd8180e FIX: Cartola::import string date 2024-08-27 18:17:59 -04:00
7447579ef0 Try Token 2024-08-27 14:51:54 -04:00
ccd5b296f3 Descriptions 2024-08-27 14:51:06 -04:00
095c33e8aa Command ContainerLoader 2024-08-27 14:50:45 -04:00
4604a9af48 Update Cartolas 2024-08-27 14:50:11 -04:00
55d879274c Try Tokens rout 2024-08-27 14:49:27 -04:00
85b529c22d Try Token 2024-08-27 14:49:15 -04:00
3ba45c48f5 Update Cartolas 2024-08-27 14:48:47 -04:00
552a4c7aca Update Cartolas 2024-08-27 14:48:21 -04:00
2070987403 Fetch by Cuenta 2024-08-27 14:47:21 -04:00
d9dab9c88d Configuracion de API 2024-08-27 14:46:57 -04:00
f9f133d3a9 Se extra getKey y configuraciones the paths 2024-08-27 14:46:03 -04:00
f85af642d2 API Service para manejo de token 2024-08-27 14:45:21 -04:00
f3d9b58ffb Agregar Cartolas al importar, y chequeo de Cartolas faltantes 2024-08-27 14:44:40 -04:00
8f682f7f13 Se agrega chequeo para cartola diaria 2024-08-27 14:43:17 -04:00
26e626074a Add sub Bancos to BCI and Santander 2024-08-26 15:26:10 -04:00
478b407646 Sub Banco for the Cartola Services 2024-08-26 15:25:45 -04:00
7d210601da Clean up 2024-08-26 15:25:13 -04:00
9563876b36 Process errors 2024-08-26 15:25:02 -04:00
d9e27d5af7 Move Cartola::import into the Service and added errors 2024-08-26 15:24:42 -04:00
936830ae64 Separate Banco::process pipe to be able to intervene in the middle 2024-08-26 15:23:22 -04:00
e93149456a FIX: API not added by git 2024-07-26 23:57:04 -04:00
93a15ef1e4 Add UF Update 2024-07-26 23:33:40 -04:00
6950413eec FIX: logger in API Middleware 2024-07-26 23:31:08 -04:00
9162ed240e FIX: testing 2024-07-26 23:20:17 -04:00
84861b5e57 Cli user 2024-07-26 23:15:48 -04:00
43bb7a83c8 FIX: tesoreria no cargaba datos 2024-07-25 12:52:48 -04:00
081187e3d3 Mensaje de error 2024-07-25 12:51:25 -04:00
b2f1bd5ba0 FIX: Importar cartolas correctamente. 2024-07-18 21:25:10 -04:00
a471a1083e Merge branch 'temp' into develop 2024-07-17 22:34:20 -04:00
8e7f43e487 Subir cartolas procesadas 2024-07-17 22:33:33 -04:00
390e79ad6d 2024-06-18 2024-07-16 16:17:24 -04:00
6169089475 FIX: Cambio fecha factura 2024-07-10 15:40:59 -04:00
a7ce78a3fb FIX: IPC asociado a fecha de UF 2024-07-10 15:32:05 -04:00
6f023928e8 FIX: Actualizacion de IPC al cambiar fecha facturas 2024-07-09 19:52:39 -04:00
a4b7183de1 FIX: UF para Pago actualizado 2024-07-09 11:58:49 -04:00
a428aeebe1 Agregar, editar y borrar comentarios 2024-07-04 18:09:25 -04:00
fc543729d2 FIX: Propietario no tomaba en consideracion comuna para direccion 2024-07-04 16:28:01 -04:00
8cec046d66 FIX 2024-07-04 16:23:39 -04:00
1f730fb7f3 FIX: comentario en redirect y cleanup 2024-07-04 16:19:54 -04:00
964d8d4237 Poder editar propietario de ventas, cambiando el propietario en si 2024-07-04 15:42:10 -04:00
0d5c9efd68 FIX: Mostrar unidad principal en busqueda 2024-07-03 17:20:26 -04:00
d68eba5697 Limpieza de input de valor y filtro de datos a nivel Repo 2024-07-03 15:13:13 -04:00
d5b9be0196 FIX: Division por 0 2024-07-03 12:19:44 -04:00
d0d99eaa81 FIX: IPC terreno hasta 2 meses antes de factura 2024-06-27 12:33:02 -04:00
15e9a54c7e FIX: venta sin departamentos 2024-06-11 18:16:34 -04:00
b7e9a17586 Se cambia el total de acuerdo a informacion de Contador 2024-06-11 18:07:12 -04:00
61533b5a4c Cambio en diseño de inicio 2024-06-11 13:21:50 -04:00
5864e7ee94 Mapper default null 2024-06-11 12:07:57 -04:00
3fc7aa88dc FIX: IPC en factura 2024-06-10 21:41:11 -04:00
1caa62500a FIX: unidadService -> propiedadUnidadService 2024-06-10 15:53:05 -04:00
27e88761e0 Mysql log retain 2024-06-07 17:18:20 -04:00
b27a6fab33 Propiedad con unidad_principal 2024-06-07 17:16:58 -04:00
fa978728ce Optimizacion de monedas 2024-05-16 21:23:24 -04:00
256a3d2459 Fechas 2024-05-14 19:43:14 -04:00
f8f5796a66 FIX: columnas al exportar 2024-05-14 13:09:59 -04:00
0e0b783a80 Sigla sociedad 2024-05-13 16:58:33 -04:00
a5125aff74 Movimientos filtrados y editables 2024-05-13 16:54:59 -04:00
71bbe7f2d7 Cuotas compactas 2024-05-10 10:48:19 -04:00
e2c68a14d1 FIX: removed self in asociados 2024-05-09 21:04:51 -04:00
5e51562aec FIX: proporcion pie pagado 2024-05-09 21:00:49 -04:00
7719a5c614 Una fecha para facturas por venta 2024-04-30 20:27:05 -04:00
05b9a3ad8a FIX: valor vacio 2024-04-30 11:35:04 -04:00
665bed8553 Propiedad principal 2024-04-30 11:28:18 -04:00
9c024d1ef7 Matriz facturacion 2024-04-29 18:35:44 -04:00
94d618b2a1 Factura con fecha de UF 2024-04-29 10:45:19 -04:00
4786ee2552 Factura multiple con cambio de fecha 2024-04-28 23:01:55 -04:00
39d8d4943e FIX: No estaban todas las disponibles 2024-04-25 21:00:14 -04:00
e63a3d0077 Disable submit button 2024-04-25 19:56:35 -04:00
d580cc1a11 Favicon 2024-04-25 19:07:21 -04:00
86034a6349 FIX: objeto ->array 2024-04-23 15:35:51 -04:00
97ab5acf3e Agregar usuario a log 2024-04-23 14:35:04 -04:00
435180ebaf Ids de ventas 2024-04-23 14:22:32 -04:00
d2511901ec Facturacion 2024-04-19 23:19:35 -04:00
9388dc17fc Facturacion y Terreno 2024-04-18 20:30:26 -04:00
a33dd341cd Facturacion 2024-04-15 20:13:15 -04:00
8e4b5eaaf8 Listado de Movimientos 2024-04-10 21:18:33 -04:00
91679b164f DAP y saldo anterior 2024-04-05 20:23:58 -03:00
3c7e4b9ef4 Orden sociedades 2024-04-05 17:13:21 -03:00
20045c9a64 Formatos 2024-04-05 16:35:18 -03:00
47d43f504d Informes anteriores y siguientes 2024-04-05 14:48:17 -03:00
0502b8e735 agentes -> proveedores 2024-04-05 14:45:54 -03:00
905e8263bc Login redirect 307 (temporary) 2024-04-03 13:26:12 -03:00
8710c8a111 Agentes 2024-04-02 23:02:52 -03:00
5d9ac2bc51 Tests results in cache 2024-04-02 20:19:59 -03:00
062e0543e4 Ignore app/bin 2024-04-02 19:58:58 -03:00
b97916cfc4 Menu 2024-04-02 19:04:57 -03:00
7af9cafdb6 Moderno 2024-04-02 19:04:26 -03:00
84a2fbd119 Log DB 2024-04-02 13:50:08 -03:00
bc9c71870c No remove nocache 2024-03-26 17:09:43 -03:00
912e8624b2 Nocache after ready 2024-03-26 16:57:07 -03:00
86406bf027 Fecha cuota 2024-03-26 16:41:33 -03:00
7b8d44e8c8 Reordenar 2024-03-26 13:59:18 -03:00
c10f2e5912 Cuotas con detalle de UF y de Pies asociados 2024-03-26 13:21:47 -03:00
bef0a22758 Bin folder 2024-03-26 13:17:08 -03:00
092eb95f06 Cache phpunit 2024-03-26 09:38:35 -03:00
5f56022109 Restructura contabilidad 2024-03-26 09:38:20 -03:00
4b3397dd63 Estado cuenta 2024-03-21 23:10:18 -03:00
529f9e32a1 Inmobiliarias por razon y cuadratura 2024-03-21 22:09:15 -03:00
939adf126f FIX: multiples cartolas 2024-03-21 22:08:30 -03:00
63400af1db Cartola diaria adds all cartolas 2024-03-21 21:57:32 -03:00
019974614c FIX: Saldos cartola diaria 2024-03-21 21:18:40 -03:00
735c341729 FIX: Login, change in separator defined 2024-03-20 23:29:09 -03:00
444ff687fc Base API, and more solid key and check 2024-03-20 23:07:49 -03:00
f3a5fa2cdc Tests 2024-03-20 23:06:38 -03:00
2ed265dcf1 Merge branch 'testing' into develop 2024-03-20 21:11:32 -03:00
dbae630fdd Bold footer 2024-03-20 21:04:43 -03:00
d69976d015 FIX: Remove cache from login when redirecting 2024-03-20 20:55:34 -03:00
2ccbc31ae0 FIX: Auth had all paths starting with slash as valid 2024-03-20 20:48:05 -03:00
e50d80560c FIX: Auth missing from some routes 2024-03-20 20:43:53 -03:00
7cc0333876 Informe tesoreria busca ultima cartola ingresada 2024-03-20 20:22:54 -03:00
eb38236926 FIX: cartola BCI 2024-03-20 17:52:34 -03:00
85ef4dd60e Ignore testing cache 2024-03-20 15:00:54 -03:00
f1e29e3b0b Ignore testing results 2024-03-20 13:50:04 -03:00
6617a92f5f Tests 2024-03-20 13:49:58 -03:00
ca958b8a88 Testing dependencies 2024-03-20 13:45:53 -03:00
dc2e2c7f71 Cartola BCI 2024-03-18 17:54:27 -03:00
936fd2d1e1 Cuota vacia 2024-03-18 18:06:32 +00:00
7c6a397e31 CORS 2024-03-18 14:58:54 -03:00
7385225a2e FIX: Venta cargada sin formaPago 2024-03-15 13:09:58 -03:00
9c335fd350 FIX: Venta 2024-03-13 22:43:37 -03:00
57f9169cc7 Encriptar clave 2024-03-13 21:24:52 -03:00
8caa80459e Accelerar listado ventas 2024-03-13 16:17:14 -03:00
98953cce42 FormaPago Service 2024-03-13 14:38:44 -03:00
c7dd309185 Movimiento + Detalles 2024-03-04 19:55:49 -03:00
48bfe5d8ab Mejora en velocidad de busqueda 2024-02-28 21:44:37 -03:00
d9b5bc6507 Procesar otras cartolas Santander 2024-02-28 17:02:04 -03:00
21d1ef653f FIX: Saldo actual informe tesoreria 2024-02-28 13:53:53 -03:00
e8d43e43ff FIX: fecha saldo consolidado 2024-02-28 13:45:20 -03:00
fc9788a1cd FIX: Mostrar pie con cuotas vigentes 2024-02-28 10:37:51 -03:00
02dcc950f4 FIX: Editar credito, valor mandaba fecha 2024-02-28 10:33:34 -03:00
370b6714bc Excel button in datatables 2024-02-27 16:49:39 -03:00
dc7a9f9e7a Buscar por rut 2024-02-27 16:11:48 -03:00
cfe18c1909 Informe tesoreria en excel 2024-02-23 22:37:09 -03:00
5156858205 Update Fomantic-UI 2024-02-23 10:20:58 -03:00
415ba31270 Cartola Diaria Manual 2024-02-23 10:20:44 -03:00
c784d1bee9 Fix informes 2024-02-21 21:22:04 +00:00
a1ade5c2c7 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-20 01:54:05 +00:00
879b612493 Cartola Diaria 2024-02-19 22:39:22 -03:00
b4cdd2d5f7 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-15 21:59:47 +00:00
51cabee824 Editar credito 2024-02-15 18:57:56 -03:00
d2e51e76f8 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-14 16:54:10 +00:00
1621d6fe30 Implementacion agregar abono a escritura 2024-02-14 13:54:01 -03:00
0e32512adc Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 21:18:11 +00:00
338f290539 FIX: logged en debug 2024-02-13 18:13:53 -03:00
2aad7e1152 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 21:00:02 +00:00
e542615128 FIX: Venta nueva no se ingresaba 2024-02-13 17:59:46 -03:00
1c7797b1b1 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 15:13:06 +00:00
ba0d4073d7 FIX: All sociedades 2024-02-13 12:12:54 -03:00
faac3874a8 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 15:11:33 +00:00
ade107ab3c Stackable grid 2024-02-13 12:11:26 -03:00
c192cf1883 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 15:08:31 +00:00
4fb75b11c4 Mejora en look de depositos y vencidos 2024-02-13 12:08:25 -03:00
ccbb71d875 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 14:26:36 +00:00
7f25b4b5e1 FIX: all sociedades & allActive depositos 2024-02-13 11:26:28 -03:00
f0b26a251b Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 14:17:08 +00:00
ea068d95d0 FIX: DAPs -> Depositos routes 2024-02-13 11:17:01 -03:00
1ccc9ab3d4 Cambio a proyectos:activos 2024-02-13 14:12:19 +00:00
5cd19bcdce Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-13 14:11:45 +00:00
712c70b34d FIX: DAPs -> Depositos 2024-02-13 11:11:30 -03:00
35ab7e7e8b Depositos vencidos no suman ni restan 2024-02-13 11:10:26 -03:00
4b39f93f30 Update permissions for cli 2024-02-13 04:30:54 +00:00
d3f188684a Increase update of proyectos 2024-02-13 04:30:29 +00:00
82647a171d Merge branch 'feature/DAPs' into develop 2024-02-13 01:16:58 -03:00
e44ab30665 Informe Tesoreria 2024-02-13 01:16:17 -03:00
19333bc338 Merge branch 'feature/dap' into develop 2024-02-12 10:00:42 -03:00
4738dae7c8 DAPs API 2024-02-12 10:00:17 -03:00
a370ffff43 Cleanup 2024-02-12 09:59:47 -03:00
88f9e539f7 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-12 09:53:52 -03:00
671b26f038 Merge branch 'feature/Movimientos' into develop 2024-02-12 09:53:18 -03:00
e133bd36cf Cartola diaria 2024-02-12 09:52:48 -03:00
251dbbe0f0 FIX: cron ENV vars 2024-02-10 10:37:45 -03:00
e1eb2c4c56 Cleanup 2024-02-08 13:04:05 -03:00
1078f4c188 Simplificacion de Cartola diaria 2024-02-08 00:06:29 -03:00
38962cb9cf API Movimientos y cartola diaria 2024-02-07 23:48:31 -03:00
3cd699d2e2 Merge branch 'develop' of http://git.provm.cl/Incoviba/oficial into develop 2024-02-07 18:37:13 -03:00
d8b8787be9 FIX: Find Pago 2024-02-07 18:35:28 -03:00
62edca5335 Simplify set post or query 2024-01-23 20:41:52 -03:00
ac6c5b7d3d FIX: activar busqueda cuando tiene query definido 2024-01-23 20:18:02 -03:00
5b5a0ed1f5 FIX: Link a buscar propietario 2024-01-23 20:07:34 -03:00
795 changed files with 62837 additions and 2617 deletions

3
.gitignore vendored
View File

@ -9,3 +9,6 @@
**/modules/
**/.idea/
**/upload?/
**/informe?/
**/.phpunit.cache/
**/coverage/

View File

@ -1,16 +1,22 @@
FROM php:8.2-fpm
FROM php:8.4-cli
ENV TZ "America/Santiago"
ENV TZ "${TZ}"
ENV APP_NAME "${APP_NAME}"
RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends cron rsyslog nano beanstalkd \
&& rm -r /var/lib/apt/lists/*
RUN pecl install xdebug-3.2.2 \
&& docker-php-ext-enable xdebug
RUN pecl install xdebug-3.4.2 \
&& docker-php-ext-enable xdebug \
&& echo $TZ > /etc/timezone
COPY --chmod=550 ./cli/start_command /root/start_command
COPY ./php-errors.ini /usr/local/etc/php/conf.d/docker-php-errors.ini
COPY ./php-timezone.ini /usr/local/etc/php/conf.d/docker-php-timezone.ini
WORKDIR /code/bin
COPY ./cli/crontab /var/spool/cron/crontabs/root
COPY --chmod=644 ./cli/crontab /var/spool/cron/crontabs/root
CMD ["cron", "-f"]
CMD [ "/root/start_command" ]

View File

@ -1,14 +1,19 @@
FROM php:8.1-fpm
FROM php:8.4-fpm
RUN apt-get update && apt-get install -y --no-install-recommends libzip-dev libicu-dev git libpng-dev unzip tzdata \
&& rm -r /var/lib/apt/lists/*
ENV TZ=America/Santiago
RUN docker-php-ext-install pdo pdo_mysql zip intl gd bcmath
RUN pecl install xdebug-3.1.3 \
&& docker-php-ext-enable xdebug
RUN apt-get update && apt-get install -y --no-install-recommends libzip-dev libicu-dev git \
libpng-dev unzip tzdata libxml2-dev beanstalkd \
&& rm -r /var/lib/apt/lists/* \
&& docker-php-ext-install pdo pdo_mysql zip intl gd bcmath dom \
&& pecl install xdebug-3.4.2 \
&& docker-php-ext-enable xdebug \
&& echo $TZ > /etc/timezone
COPY ./php-errors.ini /usr/local/etc/php/conf.d/docker-php-errors.ini
COPY ./php-xdebug.ini /usr/local/etc/php/conf.d/docker-php-xdebug.ini
COPY ./php-memory.ini /usr/local/etc/php/conf.d/docker-php-memory.ini
COPY ./php-timezone.ini /usr/local/etc/php/conf.d/docker-php-timezone.ini
COPY --from=composer /usr/bin/composer /usr/bin/composer

9
api.compose.yml Normal file
View File

@ -0,0 +1,9 @@
services:
httpclient:
profiles:
- testing
container_name: incoviba_client
image: flawiddsouza/restfox
restart: unless-stopped
ports:
- "${HTTPCLIENT_PORT:-4004}:4004"

View File

@ -1,11 +1,19 @@
APP_URL=
#ENVIRONMENT=
MYSQL_HOST=db
APP_URL=
COOKIE_NAME=
COOKIE_DOMAIN=
COOKIE_PATH=/
MAX_LOGIN_HOURS=120
REDIS_HOST=redis
REDIS_PORT=6379
#REDIS_HOST=redis
#REDIS_PORT=6379
DB_HOST=db
DB_DATABASE=incoviba
DB_USER=incoviba
DB_PASSWORD=
TOKU_URL=
TOKU_TOKEN=

2
app/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
**/bin
**/public/tests

14
app/.phpunit-watcher.yml Normal file
View File

@ -0,0 +1,14 @@
watch:
directories:
- src
- tests
- common
- resources
fileMask: '*.php'
notifications:
passingTests: false
failingTests: false
hideManual: true
phpunit:
arguments: '--testsuite unit --log-events-text /logs/output.txt --stop-on-failure'
timeout: 180

3
app/bin/console Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
php -d auto_prepend_file=test.bootstrap.php -a

3
app/bin/integration_tests Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
bin/phpunit --testsuite acceptance $@

3
app/bin/performance_tests Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
bin/phpunit --testsuite performance $@

3
app/bin/unit_tests Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
./bin/phpunit --testsuite unit $@

View File

@ -1,9 +1,6 @@
<?php
namespace Incoviba\Common\Alias;
use Illuminate\Events\Dispatcher;
use Slim\Views\Blade;
class View extends Blade
{
}
class View extends Blade {}

View File

@ -5,6 +5,11 @@ use Psr\Http\Message\UploadedFileInterface;
interface Banco
{
/**
* Process bank movements for database inserts
* @param UploadedFileInterface $file
* @return array
*/
public function process(UploadedFileInterface $file): array;
}

View File

@ -3,13 +3,42 @@ namespace Incoviba\Common\Define;
use PDO;
use PDOStatement;
use PDOException;
interface Connection
{
/**
* @return Connection
* @throws PDOException
*/
public function connect(): Connection;
/**
* @param string $query
* @return PDOStatement
* @throws PDOException
*/
public function query(string $query): PDOStatement;
/**
* @param string $query
* @return PDOStatement
* @throws PDOException
*/
public function prepare(string $query): PDOStatement;
/**
* @param string $query
* @param array|null $data
* @return PDOStatement
* @throws PDOException
*/
public function execute(string $query, ?array $data = null): PDOStatement;
/**
* @return PDO
* @throws PDOException
*/
public function getPDO(): PDO;
public function getQueryBuilder(): Query\Builder;
}

View File

@ -6,5 +6,5 @@ use Incoviba\Model;
interface Exporter
{
public function export(Model\Inmobiliaria $inmobiliaria, Model\Banco $banco, DateTimeInterface $mes, array $movimientos): string;
public function export(Model\Inmobiliaria $inmobiliaria, Model\Contabilidad\Banco $banco, DateTimeInterface $mes, array $movimientos): string;
}

View File

@ -0,0 +1,10 @@
<?php
namespace Incoviba\Common\Define;
interface Informe
{
public function setTitle(string $title): Informe;
public function setFilename(string $filename): Informe;
public function addData(array $rows): Informe;
public function build(): void;
}

View File

@ -2,8 +2,15 @@
namespace Incoviba\Common\Define\Money;
use DateTimeInterface;
use Incoviba\Common\Implement\Exception\EmptyResponse;
interface Provider
{
public function get(string $money_symbol, DateTimeInterface $dateTime): float;
/**
* @param string $money_symbol
* @param ?DateTimeInterface $dateTime = null
* @return float
* @throws EmptyResponse
*/
public function get(string $money_symbol, ?DateTimeInterface $dateTime = null): float;
}

View File

@ -1,11 +1,42 @@
<?php
namespace Incoviba\Common\Define;
use Incoviba\Common\Implement\Exception\EmptyResult;
use PDOException;
interface Repository
{
/**
* @param array|null $data
* @return Model
*/
public function create(?array $data = null): Model;
/**
* @param Model $model
* @return Model
* @throws PDOException
*/
public function save(Model $model): Model;
/**
* @param array $data_row
* @return Model
*/
public function load(array $data_row): Model;
/**
* @param Model $model
* @param array $new_data
* @return Model
* @throws EmptyResult
*/
public function edit(Model $model, array $new_data): Model;
/**
* @param Model $model
* @return void
* @throws PDOException
*/
public function remove(Model $model): void;
}

View File

@ -2,18 +2,68 @@
namespace Incoviba\Common\Ideal\Cartola;
use Incoviba\Common\Define;
use Incoviba\Common\Ideal\Service;
use Psr\Http\Message\UploadedFileInterface;
abstract class Banco implements Define\Cartola\Banco
abstract class Banco extends Service implements Define\Cartola\Banco
{
public function process(UploadedFileInterface $file): array
{
$data = $this->parseFile($file);
$filename = $this->processUploadedFile($file);
$data = $this->processFile($filename);
return $this->mapColumns($data);
}
/**
* There are banks that need some post-processing
* @param array $movimientos
* @return array
*/
public function processMovimientosDiarios(array $movimientos): array
{
return $movimientos;
}
/**
* Move the UploadedFile into a temp file from getFilename
* @param UploadedFileInterface $uploadedFile
* @return string
*/
protected function processUploadedFile(UploadedFileInterface $uploadedFile): string
{
$filename = $this->getFilename($uploadedFile);
$uploadedFile->moveTo($filename);
return $filename;
}
/**
* Process the temp file from getFilename and remove it
* @param string $filename
* @return array
*/
protected function processFile(string $filename): array
{
$data = $this->parseFile($filename);
unlink($filename);
return $data;
}
/**
* Map columns from uploaded file data to database columns
* @param array $data
* @return array
*/
protected function mapColumns(array $data): array
{
$temp = [];
$columns = $this->columnMap();
foreach ($data as $row) {
$r = [];
foreach ($columns as $old => $new) {
if (!isset($row[$old])) {
continue;
}
$r[$new] = $row[$old];
}
$temp []= $r;
@ -21,6 +71,23 @@ abstract class Banco implements Define\Cartola\Banco
return $temp;
}
/**
* Get filename where to move UploadedFile
* @param UploadedFileInterface $uploadedFile
* @return string
*/
abstract protected function getFilename(UploadedFileInterface $uploadedFile): string;
/**
* Mapping of uploaded file data columns to database columns
* @return array
*/
abstract protected function columnMap(): array;
abstract protected function parseFile(UploadedFileInterface $uploadedFile): array;
/**
* Translate uploaded file data to database data
* @param string $filename
* @return array
*/
abstract protected function parseFile(string $filename): array;
}

View File

@ -0,0 +1,18 @@
<?php
namespace Incoviba\Common\Ideal;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
abstract class LoggerEnabled implements LoggerAwareInterface
{
public LoggerInterface $logger;
public function setLogger(LoggerInterface $logger): void
{
$this->logger = $logger;
}
public function getLogger(): LoggerInterface
{
return $this->logger;
}
}

View File

@ -26,7 +26,13 @@ abstract class Model implements Define\Model
public function jsonSerialize(): mixed
{
return [
'id' => $this->id
'id' => $this->id,
...$this->jsonComplement()
];
}
protected function jsonComplement(): array
{
return [];
}
}

View File

@ -2,7 +2,9 @@
namespace Incoviba\Common\Ideal;
use PDO;
use PDOException;
use ReflectionProperty;
use ReflectionException;
use Incoviba\Common\Define;
use Incoviba\Common\Implement;
use Incoviba\Common\Implement\Exception\EmptyResult;
@ -22,10 +24,15 @@ abstract class Repository implements Define\Repository
return $this;
}
public function getConnection(): Define\Connection
{
return $this->connection;
}
public function load(array $data_row): Define\Model
{
$model = $this->create($data_row);
$model->{$this->getKey()} = $data_row[$this->getKey()];
$this->setIndex($model, $data_row[$this->getKey()]);
return $model;
}
@ -34,9 +41,12 @@ abstract class Repository implements Define\Repository
$query = $this->connection->getQueryBuilder()
->delete()->from($this->getTable())
->where("{$this->getKey()} = ?");
$this->connection->execute($query, [$model->id]);
$this->connection->execute($query, [$this->getIndex($model)]);
}
/**
* @throws EmptyResult
*/
public function fetchById(int $id): Define\Model
{
$query = $this->connection->getQueryBuilder()
@ -45,6 +55,10 @@ abstract class Repository implements Define\Repository
->where("{$this->getKey()} = ?");
return $this->fetchOne($query, [$id]);
}
/**
* @throws EmptyResult
*/
public function fetchAll(null|string|array $ordering = null): array
{
$query = $this->connection->getQueryBuilder()
@ -56,10 +70,27 @@ abstract class Repository implements Define\Repository
return $this->fetchMany($query);
}
protected string $key = 'id';
public function setKey(string $key): Repository
{
$this->key = $key;
return $this;
}
protected function getKey(): string
{
return 'id';
return $this->key;
}
protected function setIndex(Define\Model &$model, mixed $value): Repository
{
$model->{$this->getKey()} = $value;
return $this;
}
protected function getIndex(Define\Model $model): mixed
{
return $model->id;
}
protected function parseData(Define\Model $model, ?array $data, Implement\Repository\MapperParser $data_map): Define\Model
{
if ($data === null) {
@ -92,9 +123,20 @@ abstract class Repository implements Define\Repository
}
$this->setDefault($model, $property);
}
/**
* @param Define\Model $model
* @param string $property
* @return void
*/
protected function setDefault(Define\Model &$model, string $property): void
{
$prop = new ReflectionProperty($model, $property);
try {
$prop = new ReflectionProperty($model, $property);
} catch (ReflectionException) {
$model->{$property} = null;
return;
}
$type = $prop->getType()->getName();
$value = match ($type) {
'int' => 0,
@ -104,6 +146,13 @@ abstract class Repository implements Define\Repository
};
$model->{$property} = $value;
}
/**
* @param array $columns
* @param array $values
* @return int
* @throws PDOException
*/
protected function saveNew(array $columns, array $values): int
{
$query = $this->connection->getQueryBuilder()
@ -114,6 +163,14 @@ abstract class Repository implements Define\Repository
$this->connection->execute($query, $values);
return $this->connection->getPDO()->lastInsertId();
}
/**
* @param Define\Model $model
* @param array $columns
* @param array $data
* @return Define\Model
* @throws EmptyResult
*/
protected function update(Define\Model $model, array $columns, array $data): Define\Model
{
$changes = [];
@ -133,32 +190,68 @@ abstract class Repository implements Define\Repository
->update($this->getTable())
->set($columns_string)
->where("{$this->getKey()} = ?");
$values []= $model->{$this->getKey()};
$this->connection->execute($query, $values);
return $this->fetchById($model->{$this->getKey()});
$values []= $this->getIndex($model);
try {
$this->connection->execute($query, $values);
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception, $data);
}
return $this->fetchById($this->getIndex($model));
}
/**
* @param string $query
* @param array|null $data
* @return Define\Model
* @throws EmptyResult
*/
protected function fetchOne(string $query, ?array $data = null): Define\Model
{
$result = $this->connection->execute($query, $data)->fetch(PDO::FETCH_ASSOC);
if ($result === false) {
throw new EmptyResult($query);
try {
$result = $this->connection->execute($query, $data)->fetch(PDO::FETCH_ASSOC);
if ($result === false) {
throw new EmptyResult($query, null, $data);
}
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception, $data);
}
return $this->load($result);
}
/**
* @param string $query
* @param array|null $data
* @return array
* @throws EmptyResult
*/
protected function fetchMany(string $query, ?array $data = null): array
{
$results = $this->connection->execute($query, $data)->fetchAll(PDO::FETCH_ASSOC);
if ($results === false) {
throw new EmptyResult($query);
try {
$results = $this->connection->execute($query, $data)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception, $data);
}
return array_map([$this, 'load'], $results);
}
/**
* @param string $query
* @param array|null $data
* @return array
* @throws EmptyResult
*/
protected function fetchAsArray(string $query, ?array $data = null): array
{
$results = $this->connection->execute($query, $data)->fetchAll(PDO::FETCH_ASSOC);
if ($results === false) {
throw new EmptyResult($query);
try {
$results = $this->connection->execute($query, $data)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception, $data);
}
return $results;
}
public function filterData(array $data): array
{
return $data;
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace Incoviba\Common\Ideal\Service;
use Psr\Log\LoggerInterface;
use Incoviba\Common\Define;
use Incoviba\Common\Ideal;
use Incoviba\Exception\ServiceAction;
abstract class API extends Ideal\Service
{
public function __construct(LoggerInterface $logger)
{
parent::__construct($logger);
}
/**
* @param string|array|null $order
* @return array
*/
abstract public function getAll(null|string|array $order = null): array;
/**
* @param int $id
* @return Define\Model
* @throws ServiceAction\Read
*/
abstract public function get(int $id): Define\Model;
/**
* @param array $data
* @return Define\Model
* @throws ServiceAction\Create
*/
abstract public function add(array $data): Define\Model;
/**
* @param Define\Model $model
* @param array $new_data
* @return Define\Model
* @throws ServiceAction\Update
*/
abstract public function edit(Define\Model $model, array $new_data): Define\Model;
/**
* @param int $id
* @return Define\Model
* @throws ServiceAction\Delete
*/
abstract public function delete(int $id): Define\Model;
/**
* @param Define\Model $model
* @return Define\Model
*/
abstract protected function process(Define\Model $model): Define\Model;
}

View File

@ -0,0 +1,10 @@
<?php
namespace Incoviba\Common\Ideal\Service;
use Incoviba\Common\Define;
use Incoviba\Common\Ideal;
abstract class Repository extends Ideal\Service
{
abstract public function getRepository(): Define\Repository;
}

View File

@ -22,6 +22,7 @@ class Connection implements Define\Connection
}
return $this;
}
public function getPDO(): PDO
{
$this->connect();

View File

@ -81,6 +81,9 @@ class Insert extends Ideal\Query implements Define\Query\Insert
if ($value === (int) $value) {
return $value;
}
if (str_starts_with($value, ':')) {
return $value;
}
return "'{$value}'";
}, $this->values)) . ')';
}

View File

@ -64,10 +64,10 @@ class Select extends Ideal\Query implements Define\Query\Select
public function having(array|string $conditions): Select
{
if (is_string($conditions)) {
return $this->addCondition($conditions);
return $this->addHaving($conditions);
}
foreach ($conditions as $condition) {
$this->addCondition($condition);
$this->addHaving($condition);
}
return $this;
}
@ -126,7 +126,7 @@ class Select extends Ideal\Query implements Define\Query\Select
}
protected function addCondition(string $condition): Select
{
if (!isset($this->coditions)) {
if (!isset($this->conditions)) {
$this->conditions = [];
}
$this->conditions []= $condition;

View File

@ -6,10 +6,15 @@ use Throwable;
class EmptyResult extends Exception
{
public function __construct(string $query, ?Throwable $previous = null)
public function __construct(public string $query, ?Throwable $previous = null, protected ?array $data = null)
{
$message = "Empty results for {$query}";
$code = 700;
parent::__construct($message, $code, $previous);
}
public function getData(): ?array
{
return $this->data;
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Incoviba\Common\Implement\Exception;
use Throwable;
use Exception;
class HttpException extends Exception
{
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace Incoviba\Common\Implement\Exception;
use Throwable;
use Exception;
class HttpResponse extends Exception
{
public function __construct($reason = "", $message = "", $code = 0, Throwable $previous = null)
{
$this->reason = "HTTP Reason: {$reason}";
parent::__construct($message, $code, $previous);
}
protected string $reason;
public function getReason(): string
{
return $this->reason;
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace Incoviba\Common\Implement\Log\Formatter;
use Throwable;
use Monolog\Formatter\JsonFormatter;
use Monolog\LogRecord;
class PDO extends JsonFormatter
{
public function __construct(int $batchMode = self::BATCH_MODE_JSON, bool $appendNewline = false, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = true)
{
parent::__construct($batchMode, $appendNewline, $ignoreEmptyContextAndExtra, $includeStacktraces);
}
public function format(LogRecord $record): string
{
if (is_a($record->message, Throwable::class)) {
$exception = $record->message;
$message = $this->normalizeException($exception);
$context = $record->context;
$context['exception'] = $exception;
if ($exception->getPrevious()) {
$context['previous'] = $this->walkException($exception);
}
$new_record = new LogRecord(
$record->datetime,
$record->channel,
$record->level,
json_encode($message),
$context,
$record->extra
);
$record = $new_record;
}
$normalized = $this->normalize($record, $this->maxNormalizeDepth);
return $normalized['message'];
}
protected function walkException(Throwable $exception, int $depth = 0): array
{
$output = [];
$currentDepth = $depth;
while ($previous = $exception->getPrevious() and $currentDepth < $this->maxNormalizeDepth) {
$output []= $this->normalizeException($previous);
}
return $output;
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace Incoviba\Common\Implement\Log\Handler;
use Incoviba\Common\Define\Connection;
use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Level;
use Monolog\LogRecord;
use PDOStatement;
class MySQL extends AbstractProcessingHandler
{
private bool $initialized = false;
private PDOStatement $statement;
public function __construct(protected Connection $connection, protected int $retainDays = 90, int|string|Level $level = Level::Debug, bool $bubble = true)
{
parent::__construct($level, $bubble);
}
public function write(LogRecord $record): void
{
if (!$this->initialized) {
if (!$this->checkTableExists()) {
$this->createTable();
}
$this->cleanup();
$this->initialized();
}
$this->statement->execute([
'channel' => $record->channel,
'level' => $record->level->getName(),
'message' => $record->formatted,
'time' => $record->datetime->format('Y-m-d H:i:s.u'),
'context' => (count($record->context) > 0) ? json_encode($record->context, JSON_UNESCAPED_SLASHES) : '',
'extra' => (count($record->extra) > 0) ? json_encode($record->extra, JSON_UNESCAPED_SLASHES) : ''
]);
}
private function initialized(): void
{
$query = <<<QUERY
INSERT INTO monolog (channel, level, message, time, context, extra)
VALUES (:channel, :level, :message, :time, :context, :extra)
QUERY;
$this->statement = $this->connection->getPDO()->prepare($query);
$this->initialized = true;
}
private function checkTableExists(): bool
{
$query = "SHOW TABLES LIKE 'monolog'";
$result = $this->connection->query($query);
return $result->rowCount() > 0;
}
private function createTable(): void
{
$query = <<<QUERY
CREATE TABLE IF NOT EXISTS monolog (
channel VARCHAR(255),
level VARCHAR(100),
message LONGTEXT,
time DATETIME,
context LONGTEXT,
extra LONGTEXT
)
QUERY;
$this->connection->getPDO()->exec($query);
}
private function cleanup(): void
{
$query = "DELETE FROM monolog WHERE time < DATE_SUB(CURDATE(), INTERVAL {$this->retainDays} DAY)";
$this->connection->query($query);
}
}

View File

@ -0,0 +1,139 @@
<?php
namespace Incoviba\Common\Implement\Log\Processor;
use DateInvalidTimeZoneException;
use DateMalformedStringException;
use DateTimeImmutable;
use DateTimeZone;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Monolog\Formatter;
use Monolog\Handler;
use Monolog\Level;
use Predis;
use Incoviba;
use Throwable;
class ArrayBuilder
{
public function __construct(protected ContainerInterface $container) {}
public function build(array $data): array
{
$handlers = [];
foreach ($data as $handlerData) {
if (in_array($handlerData['handler'], [Handler\StreamHandler::class, Handler\RotatingFileHandler::class,])) {
$params = [
"/logs/{$handlerData['filename']}",
];
if ($handlerData['handler'] === Handler\RotatingFileHandler::class) {
$params []= 10;
}
try {
$formatter = Formatter\LineFormatter::class;
if (array_key_exists('formatter', $handlerData)) {
$formatter = $handlerData['formatter'];
}
$handler = new $handlerData['handler'](...$params)
->setFormatter($this->container->get($formatter));
} catch (NotFoundExceptionInterface | ContainerExceptionInterface $exception) {
$this->log($exception, ['handlerData' => $handlerData]);
continue;
}
} elseif ($handlerData['handler'] === Incoviba\Common\Implement\Log\Handler\MySQL::class) {
try {
$params = [
$this->container->get(Incoviba\Common\Define\Connection::class)
];
$formatter = Incoviba\Common\Implement\Log\Formatter\PDO::class;
if (array_key_exists('formatter', $handlerData)) {
$formatter = $handlerData['formatter'];
}
$handler = new $handlerData['handler'](...$params)
->setFormatter($this->container->get($formatter));
} catch (NotFoundExceptionInterface | ContainerExceptionInterface $exception) {
$this->log($exception, ['handlerData' => $handlerData]);
continue;
}
} elseif ($handlerData['handler'] === Handler\RedisHandler::class) {
try {
$params = [
$this->container->get(Predis\ClientInterface::class),
"logs:{$handlerData['name']}"
];
} catch (NotFoundExceptionInterface | ContainerExceptionInterface $exception) {
$this->log($exception, ['handlerData' => $handlerData]);
continue;
}
$handler = new $handlerData['handler'](...$params);
}
if (!isset($handler)) {
$this->log("Invalid handler", ['handlerData' => $handlerData]);
continue;
}
$params = [
$handler,
];
if (is_array($handlerData['levels'])) {
foreach ($handlerData['levels'] as $level) {
$params []= $level;
}
} else {
$params []= $handlerData['levels'];
$params []= Level::Emergency;
}
$params []= false;
$handlers []= new Handler\FilterHandler(...$params);
}
return $handlers;
}
protected function log(string|Throwable $message, array $context = []): void
{
try {
$dateTime = new DateTimeImmutable('now', new DateTimeZone($_ENV['TZ'] ?? 'America/Santiago'));
} catch (DateMalformedStringException | DateInvalidTimeZoneException $exception) {
$dateTime = new DateTimeImmutable();
}
if (is_a($message, Throwable::class)) {
$exception = $message;
$message = $exception->getMessage();
}
$context = json_encode($context, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
if ($context === false) {
$context = '[]';
}
$extra = [];
$extra['from'] = __FILE__;
if (isset($exception)) {
$extra['file'] = $exception->getFile();
$extra['line'] = $exception->getLine();
$extra['trace'] = $exception->getTrace();
}
$extra = json_encode($extra, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$code = 0;
if (isset($exception)) {
$code = $exception->getCode();
}
if ($extra === false) {
$extra = '[]';
}
$output = "[{$dateTime->format('Y-m-d H:i:s P')}] [{$code}] {$message} {$context} {$extra}";
$filename = '/logs/error.json';
$fileContents = [];
if (file_exists($filename)) {
$fileContents = file_get_contents($filename);
$fileContents = json_decode($fileContents, true);
if ($fileContents === false) {
$fileContents = [];
}
}
$fileContents[$dateTime->getTimestamp()] = $output;
$fileContents = json_encode($fileContents, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
if ($fileContents === false) {
$fileContents = '[]';
}
file_put_contents($filename, $fileContents);
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Incoviba\Common\Implement\Log\Processor;
use Incoviba\Service;
use Monolog\LogRecord;
use Monolog\Processor\ProcessorInterface;
class User implements ProcessorInterface
{
public function __construct(protected Service\Login $loginService) {}
public function __invoke(LogRecord $record): LogRecord
{
if ($this->loginService->isIn()) {
$record->extra['user'] = $this->loginService->getUser()->name;
}
return $record;
}
}

View File

@ -2,7 +2,9 @@
namespace Incoviba\Common\Implement\Repository;
use Closure;
use Exception;
use Incoviba\Common\Define;
use Incoviba\Common\Implement\Exception\EmptyResult;
class Factory implements Define\Repository\Factory
{
@ -20,8 +22,16 @@ class Factory implements Define\Repository\Factory
return $this;
}
/**
* @return mixed
* @throws EmptyResult
*/
public function run(): mixed
{
return call_user_func_array($this->callable, $this->args);
try {
return call_user_func_array($this->callable, $this->args);
} catch (Exception $exception) {
throw new EmptyResult($exception->getMessage(), $exception);
}
}
}

View File

@ -1,8 +1,10 @@
<?php
namespace Incoviba\Common\Implement\Repository;
use Error;
use Closure;
use Incoviba\Common\Define;
use Incoviba\Common\Implement\Exception\EmptyResult;
class Mapper implements Define\Repository\Mapper
{
@ -46,7 +48,11 @@ class Mapper implements Define\Repository\Mapper
}
public function hasDefault(): bool
{
return isset($this->default);
try {
return isset($this->default) or $this->default === null;
} catch (Error) {
return false;
}
}
public function parse(Define\Model &$model, string $column, ?array $data): bool
@ -62,10 +68,14 @@ class Mapper implements Define\Repository\Mapper
}
$value = $data[$column];
if ($this->hasFunction()) {
if ($value !== null) {
try {
$value = ($this->function)($data);
} elseif ($this->hasDefault()) {
$value = $this->default;
} catch (EmptyResult $exception) {
if ($this->hasDefault()) {
$value = $this->default;
} else {
throw $exception;
}
}
}
$model->{$property} = $value;

View File

@ -2,6 +2,7 @@
namespace Incoviba\Common\Implement\Repository\Mapper;
use DateTimeImmutable;
use DateMalformedStringException;
use Incoviba\Common\Implement\Repository\Mapper;
class DateTime extends Mapper
@ -9,7 +10,17 @@ class DateTime extends Mapper
public function __construct(string $column, ?string $property = null)
{
$this->setFunction(function($data) use ($column) {
return new DateTimeImmutable($data[$column] ?? '');
if (!isset($data[$column])) {
return null;
}
if (is_a($data[$column], DateTimeImmutable::class)) {
return $data[$column];
}
try {
return new DateTimeImmutable($data[$column] ?? '');
} catch (DateMalformedStringException) {
return new DateTimeImmutable();
}
});
if ($property !== null) {
$this->setProperty($property);

View File

@ -1,21 +1,35 @@
{
"name": "incoviba/web",
"version": "2.0.0",
"type": "project",
"require": {
"berrnd/slim-blade-view": "^1.0",
"guzzlehttp/guzzle": "^7.8",
"monolog/monolog": "^3.4",
"nyholm/psr7": "^1.8",
"nyholm/psr7-server": "^1.0",
"php-di/php-di": "^7.0",
"php-di/slim-bridge": "^3.4",
"phpoffice/phpspreadsheet": "^1.29",
"predis/predis": "^2.2",
"slim/slim": "^4.11"
"ext-curl": "*",
"ext-dom": "*",
"ext-gd": "*",
"ext-openssl": "*",
"ext-pdo": "*",
"ext-sockets": "*",
"berrnd/slim-blade-view": "^1",
"guzzlehttp/guzzle": "^7",
"monolog/monolog": "^3",
"nyholm/psr7": "^1",
"nyholm/psr7-server": "^1",
"pda/pheanstalk": "^7.0",
"php-di/php-di": "^7",
"php-di/slim-bridge": "^3",
"phpoffice/phpspreadsheet": "^3",
"predis/predis": "^2",
"robmorgan/phinx": "^0.16",
"slim/slim": "^4",
"symfony/string": "^7.2",
"tedivm/jshrink": "^1.7"
},
"require-dev": {
"kint-php/kint": "^5.1",
"phpunit/phpunit": "^10.2"
"fakerphp/faker": "^1",
"kint-php/kint": "^5",
"odan/phinx-migrations-generator": "^6",
"phpunit/phpunit": "^11",
"spatie/phpunit-watcher": "^1"
},
"authors": [
{
@ -30,6 +44,8 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"process-timeout": 0,
"bin-dir": "bin"
}
}

496
app/fcgi.conf Normal file
View File

@ -0,0 +1,496 @@
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[fcgi]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or NONE) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of the child processes. This can be used only if the master
; process running user is root. It is set after the child process is created.
; The user and group can be specified either by their name or by their numeric
; IDs.
; Note: If the user is root, the executable needs to be started with
; --allow-to-run-as-root option to work.
; Default Values: The user is set to master process running user by default.
; If the group is not set, the user's group is used.
user = www-data
group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
;listen = 127.0.0.1:9000
listen = 9090
; Set listen(2) backlog.
; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD)
;listen.backlog = 511
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions. The owner
; and group can be specified either by name or by their numeric IDs.
; Default Values: Owner is set to the master process running user. If the group
; is not set, the owner's group is used. Mode is set to 0660.
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
;listen.allowed_clients = 127.0.0.1
; Set the associated the route table (FIB). FreeBSD only
; Default Value: -1
;listen.setfib = 1
; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool processes will inherit the master process priority
; unless it specified otherwise
; Default Value: no set
; process.priority = -19
; Set the process dumpable flag (PR_SET_DUMPABLE prctl for Linux or
; PROC_TRACE_CTL procctl for FreeBSD) even if the process user
; or group is different than the master process user. It allows to create process
; core dump and ptrace the process for the pool user.
; Default Value: no
; process.dumpable = yes
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; pm.max_spawn_rate - the maximum number of rate to spawn child
; processes at once.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 2
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: (min_spare_servers + max_spare_servers) / 2
;pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
;pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
;pm.max_spare_servers = 3
; The number of rate to spawn child processes at once.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
; Default Value: 32
;pm.max_spawn_rate = 32
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;
pm.process_idle_timeout = 10s
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following information:
; pool - the name of the pool;
; process manager - static, dynamic or ondemand;
; start time - the date and time FPM has started;
; start since - number of seconds since FPM has started;
; accepted conn - the number of request accepted by the pool;
; listen queue - the number of request in the queue of pending
; connections (see backlog in listen(2));
; max listen queue - the maximum number of requests in the queue
; of pending connections since FPM has started;
; listen queue len - the size of the socket queue of pending connections;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes;
; max active processes - the maximum number of active processes since FPM
; has started;
; max children reached - number of times, the process limit has been reached,
; when pm tries to start more children (works only for
; pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
; pool: www
; process manager: static
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 62636
; accepted conn: 190460
; listen queue: 0
; max listen queue: 1
; listen queue len: 42
; idle processes: 4
; active processes: 11
; total processes: 15
; max active processes: 12
; max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
; http://www.foo.bar/status?xml&full
; The Full status returns for each process:
; pid - the PID of the process;
; state - the state of the process (Idle, Running, ...);
; start time - the date and time the process has started;
; start since - the number of seconds since the process has started;
; requests - the number of requests the process has served;
; request duration - the duration in µs of the requests;
; request method - the request method (GET, POST, ...);
; request URI - the request URI with the query string;
; content length - the content length of the request (only with POST);
; user - the user (PHP_AUTH_USER) (or '-' if not set);
; script - the main script called (or '-' if not set);
; last request cpu - the %cpu the last request consumed
; it's always 0 if the process is not in Idle state
; because CPU calculation is done when the request
; processing has terminated;
; last request memory - the max amount of memory the last request consumed
; it's always 0 if the process is not in Idle state
; because memory calculation is done when the request
; processing has terminated;
; If the process is in Idle state, then information is related to the
; last request the process has served. Otherwise information is related to
; the current request being served.
; Example output:
; ************************
; pid: 31330
; state: Running
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 63087
; requests: 12808
; request duration: 1250261
; request method: GET
; request URI: /test_mem.php?N=10000
; content length: 0
; user: -
; script: /home/fat/web/docs/php/test_mem.php
; last request cpu: 0.00
; last request memory: 0
;
; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: /usr/local/share/php/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status
; The address on which to accept FastCGI status request. This creates a new
; invisible pool that can handle requests independently. This is useful
; if the main pool is busy with long running requests because it is still possible
; to get the status before finishing the long running requests.
;
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Default Value: value of the listen option
;pm.status_listen = 127.0.0.1:9001
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong
; The access log file
; Default: not set
;access.log = log/$pool.access.log
access.log = /proc/self/fd/2
; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{milliseconds}d
; - %{milli}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some examples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: output header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsulated in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %u: basic auth user if specified in Authorization header
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{milli}d %{kilo}M %C%%"
; A list of request_uri values which should be filtered from the access log.
;
; As a security precaution, this setting will be ignored if:
; - the request method is not GET or HEAD; or
; - there is a request body; or
; - there are query parameters; or
; - the response code is outwith the successful range of 200 to 299
;
; Note: The paths are matched against the output of the access.format tag "%r".
; On common configurations, this may look more like SCRIPT_NAME than the
; expected pre-rewrite URI.
;
; Default Value: not set
;access.suppress_path[] = /ping
;access.suppress_path[] = /health_check.php
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
;slowlog = log/$pool.log.slow
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0
; Depth of slow log stack trace.
; Default Value: 20
;request_slowlog_trace_depth = 20
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; The timeout set by 'request_terminate_timeout' ini option is not engaged after
; application calls 'fastcgi_finish_request' or when application has finished and
; shutdown functions are being called (registered via register_shutdown_function).
; This option will enable timeout limit to be applied unconditionally
; even in such cases.
; Default Value: no
;request_terminate_timeout_track_finished = no
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
;chdir = /var/www
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environment, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes
catch_workers_output = yes
; Decorate worker output with prefix and suffix containing information about
; the child that writes to the log and if stdout or stderr is used as well as
; log level and time. This options is used only if catch_workers_output is yes.
; Settings to "no" will output data as written to the stdout or stderr.
; Default value: yes
;decorate_workers_output = no
decorate_workers_output = no
; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
;clear_env = no
clear_env = no
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; execute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5 .php7
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local)
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

730
app/generate-migrations.php Normal file
View File

@ -0,0 +1,730 @@
<?php
require_once implode(DIRECTORY_SEPARATOR, [__DIR__, 'vendor', 'autoload.php']);
class TableRepository
{
public function __construct(protected Incoviba\Common\Define\Connection $connection, protected string $database) {}
public function getTables(): array
{
if (!isset($this->tables)) {
$results = $this->connection->query("SHOW TABLES");
$rows = $results->fetchAll(PDO::FETCH_ASSOC);
$this->tables = array_map(function($row) {
return $row["Tables_in_{$this->database}"];
}, $rows);
}
return $this->tables;
}
public function getTableDefinition(string $table): string
{
if (!isset($this->definitions[$table])) {
$results = $this->connection->query("SHOW CREATE TABLE {$table}");
$row = $results->fetch(PDO::FETCH_ASSOC);
$this->definitions[$table] = $row['Create Table'];
}
return $this->definitions[$table];
}
public function parseTableDefinition(string $table, int $offset = 2): string
{
$this->extractLines($table);
$tableLine = "\$this->table('{$table}'";
if (count($this->primary) === 1) {
$tableLine .= ", ['id' => '{$this->primary[0]}']";
} elseif (count($this->primary) > 1) {
$primaryString = implode(', ', array_map(function($key) {return "'{$key}'";}, $this->primary));
$tableLine .= ", ['id' = false, 'primary_key' => [{$primaryString}]]";
}
$tableLine .= ')';
$output = [$this->prefixLine($tableLine, $offset)];
foreach ($this->columns as $column) {
$output []= $this->prefixLine($column, $offset + 1);
}
foreach ($this->constraints as $constraint) {
$output []= $this->prefixLine($constraint, $offset + 1);
}
$output []= $this->prefixLine('->create();', $offset + 1);
return implode(PHP_EOL, $output);
}
public function getTableIndex(string $table): int
{
return array_search($table, $this->getTables());
}
protected array $tables;
protected array $definitions;
protected array $primary;
protected array $columns;
protected array $constraints;
protected function extractLines(string $table): void
{
$this->primary = [];
$this->columns = [];
$this->constraints = [];
$lines = explode(PHP_EOL, $this->definitions[$table]);
array_shift($lines);
foreach ($lines as $line) {
if (str_starts_with(trim($line), ') ENGINE')) {
break;
}
if (str_starts_with(trim($line), '`id`') or str_starts_with(trim($line), 'KEY')) {
continue;
}
if (str_starts_with(trim($line), 'PRIMARY KEY')) {
if (!str_contains($line, '`id`')) {
$ini = strpos($line, '(') + 1;
$end = strpos($line, ')', $ini);
$this->primary []= substr($line, $ini, $end - $ini);
}
continue;
}
if (str_starts_with(trim($line), 'CONSTRAINT')) {
$this->constraints []= (new ConstraintParser($line))->parse();
continue;
}
$this->columns []= (new ColumnParser($line))->parse();
}
}
protected function prefixLine(string $line, int $length, string $character = "\t"): string
{
if ($length === 0) {
return $line;
}
return implode('', array_fill(0, $length, $character)) . $line;
}
}
class DataRepository
{
public function __construct(protected Incoviba\Common\Define\Connection $connection) {}
public int $size;
public function getData(string $table): Generator
{
$query = $this->connection->getQueryBuilder()
->select()
->from($table);
$results = $this->connection->query($query);
$this->size = $results->rowCount();
while ($row = $results->fetch(PDO::FETCH_ASSOC)) {
yield $row;
}
}
}
class ColumnParser
{
public function __construct(protected string $line) {}
public function parse(): string
{
return "->addColumn('{$this->getName()}', '{$this->getType()}'{$this->getOptions()})";
}
protected int $ini;
protected int $end;
protected array $parts;
protected array $options;
protected function getName(): string
{
$ini = $this->getIni();
$end = $this->getEnd();
return substr($this->line, $ini, $end - $ini);
}
protected function getType(): string
{
$parts = $this->getParts();
$type = array_shift($parts);
if (str_contains($type, '(')) {
list($type, $length) = explode('(', $type);
$this->options []= "'length' => " . rtrim($length, ')');
}
return match($type) {
'int' => 'integer',
'tinyint' => 'boolean',
'varchar' => 'string',
default => $type
};
}
protected function getOptions(): string
{
$parts = $this->getParts();
array_shift($parts);
$validOptions = [
'default' => function($parts) {
$i = array_search('default', array_map(function($part) {return strtolower($part);}, $parts));
return ['default', $parts[$i + 1]];
},
'null' => function($parts) {
$value = true;
$i = array_search('null', array_map(function($part) {return strtolower($part);}, $parts));
if (key_exists($i - 1, $parts) and strtolower($parts[$i - 1]) === 'not') {
$value = false;
}
return ['null', $value];
},
'unsigned' => function($parts) {
return ['signed', false];
},
'auto_increment' => function($parts) {
return ['auto_increment', true];
}
];
foreach ($validOptions as $validOption => $callable) {
if (str_contains(strtolower($this->line), $validOption)) {
list($option, $value) = $callable($parts);
if (strtolower($value) === 'null') {
$value = 'null';
}
if ($value !== 'null' and !is_bool($value) and !ctype_digit($value)) {
$value = trim($value, "'");
$value = "'{$value}'";
}
if (is_bool($value)) {
$value = $value ? 'true' : 'false';
}
$this->options []= "'{$option}' => {$value}";
}
}
if (count($this->options) === 0) {
return '';
}
return ', [' . implode(', ', $this->options) . ']';
}
protected function getIni(): int
{
if (!isset($this->ini)) {
$this->ini = strpos($this->line, '`') + 1;
}
return $this->ini;
}
protected function getEnd(): int
{
if (!isset($this->end)) {
$this->end = strpos($this->line, '`', $this->getIni());
}
return $this->end;
}
protected function getParts(): array
{
if (!isset($this->parts)) {
$this->parts = explode(' ', trim(substr($this->line, $this->getEnd() + 1), ' ,'));
}
return $this->parts;
}
}
class ConstraintParser
{
public function __construct(protected string $line) {}
public function parse(): string
{
return "->addForeignKey({$this->getColumns()}, '{$this->getTable()}', {$this->getReferences()}, ['delete' => 'cascade', 'update' => 'cascade'])";
}
protected function getColumns(): string
{
$ini = strpos(strtolower($this->line), 'foreign key') + strlen('FOREIGN KEY ');
$ini = strpos($this->line, '(', $ini) + 1;
$end = strpos(strtolower($this->line), ' references', $ini + 1) - strlen(')');
return $this->getNames($ini, $end);
}
protected function getTable(): string
{
$ini = strpos(strtolower($this->line), 'references') + strlen('REFERENCES ') + 1;
$end = strpos($this->line, '`', $ini + 1);
return substr($this->line, $ini, $end - $ini);
}
protected function getReferences(): string
{
$ini = strpos($this->line, '(', strpos(strtolower($this->line), 'references')) + 1;
$end = strpos($this->line, ')', $ini);
return $this->getNames($ini, $end);
}
protected function getNames($ini, $end): string
{
$names = substr($this->line, $ini, $end - $ini);
if (!str_contains($names, ',')) {
return str_replace('`', "'", $names);
}
$names = explode(', ', $names);
$columns = array_map(function($name) {return str_replace('`', "'", $name);}, $names);
return '[' . implode(', ', $columns) . ']';
}
}
class MigrationGenerator
{
public function __construct(protected Config $settings)
{
$this->databaseName = $settings->getEnv('DB_DATABASE');
$this->migrationsPath = $settings->getMigrationsPath();
$this->startDate = $settings->getStartDate();
$this->database = new Incoviba\Common\Implement\Database\MySQL($settings->getEnv('DB_HOST'), $settings->getEnv('DB_DATABASE'), $settings->getEnv('DB_USER'), $settings->getEnv('DB_PASSWORD'));
$this->connection = new Incoviba\Common\Implement\Connection($this->database, new Incoviba\Common\Implement\Database\Query\Builder());
$this->tableRepository = new TableRepository($this->connection, $this->databaseName);
$this->logger = $settings->getLogger();
}
public function run(bool $execute = true): void
{
$this->logger->output('Running generate migrations' . (($execute) ? '' : ' [dry-run]'), 250);
foreach ($this->tableRepository->getTables() as $tableName) {
if (in_array($tableName, $this->settings->getSkip())) {
continue;
}
$this->logger->output("Table: {$tableName}");
$filename = $this->buildFilename($tableName);
if ($execute) {
$this->logger->debug("Filename: {$filename}");
} else {
$this->logger->output("Filename: {$filename}");
}
$content = $this->buildFile($tableName);
$this->logger->debug("Content: {$content}");
if ($execute) {
$status = file_put_contents($filename, $content);
$this->logger->debug("Saved: " . var_export($status, true));
try {
$this->registerMigration($tableName);
} catch (PDOException $exception) {
$this->logger->warning($exception);
}
}
}
$this->logger->output("Total tables migrated: " . count($this->tableRepository->getTables()), 250);
}
protected Incoviba\Common\Define\Database $database;
protected Incoviba\Common\Define\Connection $connection;
protected string $databaseName;
protected string $migrationsPath;
protected DateTimeInterface $startDate;
protected TableRepository $tableRepository;
protected Logger $logger;
protected function buildFilename(string $table): string
{
$i = $this->tableRepository->getTableIndex($table);
$time = $this->startDate->add(new DateInterval("PT{$i}S"));
return implode(DIRECTORY_SEPARATOR, [
$this->migrationsPath,
"{$time->format('YmdHis')}_create_{$table}.php"
]);
}
protected function buildClassName(string $table): string
{
return 'Create' . str_replace(' ', '', ucwords(str_replace('_', ' ', $table)));
}
protected function buildHeader(): string
{
return "<?php
use Phinx\Db\Adapter\MysqlAdapter;
";
}
protected function buildClass(string $table): string
{
return "class {$this->buildClassName($table)} extends Phinx\Migration\AbstractMigration";
}
protected function buildFunction(string $table): string
{
$output = ["{", "\tpublic function change(): void", "\t{"];
$output []= $this->buildInitialSetup();
$this->tableRepository->getTableDefinition($table);
$output []= $this->tableRepository->parseTableDefinition($table);
$output []= $this->buildFinalSetup();
$output []= "\t}";
return implode(PHP_EOL, $output);
}
protected function buildInitialSetup(): string
{
return implode(PHP_EOL, [
"\t\t\$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');",
"\t\t\$this->execute(\"ALTER DATABASE CHARACTER SET 'utf8mb4';\");",
"\t\t\$this->execute(\"ALTER DATABASE COLLATE='utf8mb4_general_ci';\");",
''
]);
}
protected function buildFinalSetup(): string
{
return "\t\t\$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');";
}
protected function buildFile(string $table): string
{
return implode(PHP_EOL, [
$this->buildHeader(),
$this->buildClass($table),
$this->buildFunction($table),
'}',
''
]);
}
protected function registerMigration(string $table): void
{
$i = $this->tableRepository->getTableIndex($table);
$time = $this->startDate->add(new DateInterval("PT{$i}S"));
$this->logger->output("Registering migration: {$time->format('Y-m-d H:i:s')}");
$migrationName = $this->buildClassName($table);
$query = $this->connection->getQueryBuilder()
->insert()
->into('phinxlog')
->columns(['version', 'migration_name', 'start_time', 'end_time', 'breakpoint'])
->values(['?', '?', '?', '?', 0]);
$this->connection->execute($query, [
$time->format('YmdHis'),
$migrationName,
$time->format('Y-m-d H:i:s'),
$time->format('Y-m-d H:i:s')
]);
}
}
class SeedGenerator
{
public function __construct(protected Config $settings)
{
$this->databaseName = $settings->getEnv('DB_DATABASE');
$this->seedsPath = $settings->getSeedsPath();
$this->startDate = $settings->getStartDate();
$this->database = new Incoviba\Common\Implement\Database\MySQL($settings->getEnv('DB_HOST'), $settings->getEnv('DB_DATABASE'), $settings->getEnv('DB_USER'), $settings->getEnv('DB_PASSWORD'));
$this->connection = new Incoviba\Common\Implement\Connection($this->database, new Incoviba\Common\Implement\Database\Query\Builder());
$this->tableRepository = new TableRepository($this->connection, $this->databaseName);
$this->dataRepository = new DataRepository($this->connection);
$this->logger = $settings->getLogger();
}
public function run(bool $execute = true): void
{
$this->logger->output('Running generate seeds' . (($execute) ? '' : ' [dry-run]'), 250);
$tables = $this->tableRepository->getTables();
foreach ($tables as $table) {
if (in_array($table, $this->settings->getSkip())) {
continue;
}
$this->logger->output("Table: {$table}");
$filename = $this->buildFilename($table);
if ($execute) {
$this->logger->debug("Filename: {$filename}");
} else {
$this->logger->output("Filename: {$filename}");
}
$content = $this->buildFile($table);
$this->logger->debug("Content: {$content}");
if ($execute) {
$status = file_put_contents($filename, $content);
$this->logger->debug("Saved: " . var_export($status, true));
}
}
$this->logger->output("Total tables seeded: " . count($this->tableRepository->getTables()), 250);
}
protected Incoviba\Common\Define\Database $database;
protected Incoviba\Common\Define\Connection $connection;
protected string $databaseName;
protected string $seedsPath;
protected DateTimeInterface $startDate;
protected TableRepository $tableRepository;
protected DataRepository $dataRepository;
protected Logger $logger;
protected function buildFilename(string $table): string
{
$i = $this->tableRepository->getTableIndex($table);
$time = $this->startDate->add(new DateInterval("PT{$i}S"));
return implode(DIRECTORY_SEPARATOR, [
$this->seedsPath,
"{$time->format('YmdHis')}_{$table}_seeder.php"
]);
}
protected function buildFile(string $table): string
{
return implode(PHP_EOL, [
$this->buildHeader(),
$this->buildClass($table),
"{",
$this->buildFunction($table),
'}',
''
]);
}
protected function buildHeader(): string
{
return "<?php
use Phinx\Seed\AbstractSeed;
";
}
protected function buildClass(string $table): string
{
return "class {$this->buildClassName($table)} extends AbstractSeed";
}
protected function buildClassName(string $table): string
{
return str_replace(' ', '', ucwords(str_replace('_', ' ', $table))) . 'Seeder';
}
protected function buildFunction(string $table): string
{
return implode(PHP_EOL, [
"\tpublic function run(): void",
"\t{",
$this->buildData($table),
"",
$this->buildInitialSetup(),
"\t\t\$this->table('{$table}')",
"\t\t\t->insert(\$data)",
"\t\t\t->saveData();",
$this->buildFinalSetup(),
"\t}"
]);
}
protected function buildData(string $table): string
{
$output = ["\t\t\$data = ["];
$dataGenerator = $this->dataRepository->getData($table);
foreach ($dataGenerator as $row) {
$output []= "\t\t\t[";
foreach ($row as $key => $value) {
if (is_bool($value)) {
$value = $value ? 1 : 0;
}
if (!ctype_digit("{$value}") and $value !== null) {
if (str_contains($value, "'")) {
$value = str_replace("'", "\'", $value);
}
$value = "'{$value}'";
}
if ($value === null) {
$value = 'null';
}
if (strlen($value) > 2 and str_starts_with($value, '0')) {
$value = "'{$value}'";
}
$output []= "\t\t\t\t'{$key}' => {$value},";
}
$output []= "\t\t\t],";
}
$output []= "\t\t];";
$this->logger->debug("Total data: {$this->dataRepository->size}");
return implode(PHP_EOL, $output);
}
protected function buildInitialSetup(): string
{
return "\t\t\$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');";
}
protected function buildFinalSetup(): string
{
return "\t\t\$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');";
}
}
class Logger
{
public function __construct(protected bool $verbose = false, protected $quiet = false) {}
protected array $loggers;
public function registerLog(Psr\Log\LoggerInterface $logger): Logger
{
$this->loggers['log'] = $logger;
return $this;
}
public function registerOutput(Psr\Log\LoggerInterface $logger): Logger
{
$this->loggers['output'] = $logger;
return $this;
}
public function log(string $message, int $level = 200): void
{
if ($this->canLogLevel($level)) {
$this->loggers['log']->log($level, $message);
}
}
public function output(string $message, int $level = 200): void
{
if ($this->canLogLevel($level)) {
$this->loggers['output']->log($level, $message);
$this->log($message, $level);
}
}
public function __call(string $name, array $arguments)
{
if (method_exists($this->loggers['log'], $name)) {
$levelMap = [
'debug' => 100,
'info' => 200,
'notice' => 250,
'warning' => 300,
'error' => 400,
'critical' => 500,
'alert' => 550,
'emergency' => 600
];
$level = $levelMap[strtolower($name)];
$this->log($arguments[0], $level);
}
}
protected function canLogLevel(int $level): bool
{
$minQuiet = 300;
$maxVerbose = 250;
if ($this->quiet) {
return $level >= $minQuiet;
}
if ($this->verbose) {
return true;
}
return $level >= $maxVerbose;
}
}
class Config
{
public function __construct()
{
$this->opts = getopt('d:m:s:r:vq', ['date:', 'migrations:', 'seeds:', 'run:', 'verbose', 'quiet']);
}
public function getStartDate(): DateTimeInterface
{
$dateString = '20141101080000';
if (isset($this->opts['d']) or isset($this->opts['date'])) {
$dateString = $this->opts['d'] ?? $this->opts['date'];
}
return new DateTimeImmutable($dateString);
}
public function getMigrationsPath(): string
{
$migrationsPath = implode(DIRECTORY_SEPARATOR, [__DIR__, 'resources', 'database', 'migrations']);
if (isset($this->opts['m']) or isset($this->opts['migrations'])) {
$migrationsPath = $this->opts['m'] ?? $this->opts['migrations'];
}
return $migrationsPath;
}
public function getSeedsPath(): string
{
$seedsPath = implode(DIRECTORY_SEPARATOR, [__DIR__, 'resources', 'database', 'seeds']);
if (isset($this->opts['s']) or isset($this->opts['seeds'])) {
$seedsPath = $this->opts['s'] ?? $this->opts['seeds'];
}
return $seedsPath;
}
public function getRun(): int
{
$option = 0;
if (isset($this->opts['r']) or isset($this->opts['run'])) {
$option = $this->opts['r'] ?? $this->opts['run'];
}
if (ctype_digit("{$option}")) {
return (int) $option;
}
return match($option) {
'm', 'migrations' => 1,
's', 'seeds' => 2,
'a', 'all' => 3,
default => 0
};
}
public function getEnv(string $name): mixed
{
return $_ENV[$name];
}
public function getLogger(): Logger
{
return (new Logger($this->isVerbose(), $this->isQuiet()))
->registerLog($this->getPsrLogger())
->registerOutput(new Monolog\Logger('output', [
new Monolog\Handler\FilterHandler(
(new Monolog\Handler\StreamHandler(STDOUT))
->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, true)),
Monolog\Level::Info,
Monolog\Level::Notice
)
], [
new Monolog\Processor\ProcessIdProcessor(),
new Monolog\Processor\MemoryUsageProcessor(),
new Monolog\Processor\MemoryPeakUsageProcessor(),
new Monolog\Processor\PsrLogMessageProcessor()
]));
}
public function getPsrLogger(): Psr\Log\LoggerInterface
{
return new Monolog\Logger('migrations',
[
(new Monolog\Handler\RotatingFileHandler('/logs/migrations.log'))
->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true)),
], [
new Monolog\Processor\ProcessIdProcessor(),
new Monolog\Processor\MemoryUsageProcessor(),
new Monolog\Processor\MemoryPeakUsageProcessor(),
new Monolog\Processor\PsrLogMessageProcessor()
]
);
}
public function setSkip(string|array $skip): Config
{
if (is_string($skip)) {
$skip = [$skip];
}
$this->skip = [...$this->skip ?? [], ...$skip];
return $this;
}
public function getSkip(): array
{
return $this->skip;
}
public function isVerbose(): bool
{
return isset($this->opts['v']) or isset($this->opts['verbose']);
}
public function isQuiet(): bool
{
return isset($this->opts['q']) or isset($this->opts['quiet']);
}
protected array $opts;
protected array $skip;
}
$config = new Config();
$config->setSkip([
'monolog',
'phinxlog',
'personas',
'datos_personas',
'proveedores',
'datos_proveedores'
]);
Monolog\ErrorHandler::register($config->getPsrLogger());
try {
$generator = new MigrationGenerator($config);
$seeder = new SeedGenerator($config);
switch ($config->getRun()) {
case 0:
$generator->run(false);
$seeder->run(false);
break;
case 3:
$generator->run();
$seeder->run();
break;
case 1:
$generator->run();
break;
case 2:
$seeder->run();
break;
}
} catch (Exception $exception) {
$config->getLogger()->warning($exception);
} catch (Error $error) {
$config->getLogger()->error($error);
}

46
app/phinx.php Normal file
View File

@ -0,0 +1,46 @@
<?php
return
[
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/resources/database/migrations',
'seeds' => '%%PHINX_CONFIG_DIR%%/resources/database/seeds'
],
'environments' => [
'default_migration_table' => 'phinxlog',
'default_environment' => 'development',
'production' => [
'adapter' => 'mysql',
'host' => $_ENV['DB_HOST'] ?? 'localhost',
'name' => $_ENV['DB_DATABASE'],
'user' => $_ENV['DB_USER'],
'pass' => $_ENV['DB_PASSWORD'],
'port' => '3306',
'charset' => 'utf8',
],
'development' => [
'adapter' => 'mysql',
'host' => $_ENV['DB_HOST'] ?? 'localhost',
'name' => $_ENV['DB_DATABASE'],
'user' => $_ENV['DB_USER'],
'pass' => $_ENV['DB_PASSWORD'],
'port' => '3306',
'charset' => 'utf8',
],
'testing' => [
'adapter' => 'mysql',
'host' => $_ENV['DB_HOST'] ?? 'localhost',
'name' => $_ENV['DB_DATABASE'],
'user' => $_ENV['DB_USER'],
'pass' => $_ENV['DB_PASSWORD'],
'port' => '3306',
'charset' => 'utf8',
]
],
'version_order' => 'creation',
'schema_file' => '%%PHINX_CONFIG_DIR%%/resources/database/schema.php',
'foreign_keys' => true,
'generate_migration_name' => true,
'default_migration_prefix' => 'incoviba_',
'mark_generated_migration' => true
];

42
app/phpunit.xml Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.4/phpunit.xsd"
bootstrap="test.bootstrap.php"
cacheDirectory="/code/cache/tests"
executionOrder="depends,defects"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="false"
beStrictAboutOutputDuringTests="true"
colors="true"
failOnRisky="false"
failOnWarning="false">
<testsuites>
<testsuite name="unit">
<directory>tests/unit</directory>
</testsuite>
<testsuite name="acceptance">
<directory>tests/integration</directory>
</testsuite>
<testsuite name="performance">
<directory>tests/performance</directory>
</testsuite>
</testsuites>
<source restrictNotices="true" restrictWarnings="true" ignoreIndirectDeprecations="true">
<include>
<directory>src</directory>
<directory>common</directory>
</include>
</source>
<!--<coverage pathCoverage="false" ignoreDeprecatedCodeUnits="true" disableCodeCoverageIgnore="true">
<report>
<html outputDirectory="/code/public/coverage/html"/>
</report>
</coverage>-->
<logging>
<junit outputFile="/code/cache/tests/junit.xml"/>
<teamcity outputFile="/code/cache/tests/teamcity.txt"/>
<!--<testdoxHtml outputFile="/code/public/tests/testdox.html"/>-->
<testdoxText outputFile="/code/cache/tests/testdox.txt"/>
</logging>
</phpunit>

BIN
app/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

View File

@ -13,3 +13,12 @@ try {
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->notice($exception);
header('Location: /construccion');
}
register_shutdown_function(function() {
$error = error_get_last();
$fatal_errors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
if ($error !== null and in_array($error['type'], $fatal_errors, true)) {
error_log(json_encode($error).PHP_EOL,3, '/logs/fatal.log');
}
error_clear_last();
});

View File

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAction extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('action')
->addColumn('description', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAgente extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('agente')
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('rut', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('descripcion', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('representante', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('telefono', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('correo', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('direccion', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('giro', 'text', ['default' => null, 'null' => true])
->addColumn('abreviacion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAgenteTipo extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('agente_tipo')
->addColumn('agente', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('agente', 'agente', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipo', 'tipo_agente', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAvanceConstruccion extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('avance_construccion')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('numero', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('avance', 'double', ['null' => false, 'signed' => false])
->addColumn('estado_pago', 'double', ['null' => false, 'signed' => false])
->addColumn('pagado', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('uf', 'double', ['default' => null, 'null' => true, 'signed' => false])
->addColumn('fecha_pagado', 'date', ['default' => null, 'null' => true])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateBackup extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('backup')
->addColumn('date', 'datetime', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateBanco extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('banco')
->addColumn('nombre', 'string', ['length' => 20, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateBonoPie extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('bono_pie')
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->addColumn('pago', 'integer', ['length' => 11, 'default' => null, 'null' => true, 'signed' => false])
->addForeignKey('pago', 'pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCartolas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cartolas')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('cargos', 'biginteger', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('abonos', 'biginteger', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('saldo', 'biginteger', ['length' => 20, 'default' => 0, 'null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCategoriasCentrosCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('categorias_centros_costos')
->addColumn('descripcion', 'string', ['length' => 255, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCentrosCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('centros_costos')
->addColumn('tipo_centro_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('categoria_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo_cuenta_id', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('cuenta_contable', 'string', ['length' => 100, 'null' => false])
->addColumn('descripcion', 'text', ['null' => false, 'limit' => MysqlAdapter::TEXT_MEDIUM])
->addForeignKey('tipo_centro_id', 'tipos_centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('categoria_id', 'categorias_centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cierre')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('precio', 'double', ['null' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('relacionado', 'integer', ['length' => 1, 'default' => 0])
->addColumn('propietario', 'integer', ['length' => 10, 'default' => 0, 'signed' => false])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCobro extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cobro')
->addColumn('proyecto', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('agente', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->addColumn('iva', 'float', ['default' => 0])
->addColumn('uf', 'float', ['default' => null, 'null' => true])
->addColumn('identificador', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('glosa', 'text', ['default' => null, 'null' => true, 'limit' => MysqlAdapter::TEXT_MEDIUM])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateComentario extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('comentario')
->addColumn('venta', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('fecha', 'datetime', ['default' => null, 'null' => true])
->addColumn('texto', 'blob', ['default' => null, 'null' => true])
->addColumn('estado', 'integer', ['length' => 11, 'default' => 1])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateComuna extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('comuna')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('provincia', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('provincia', 'provincia', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateConfigurations extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('configurations')
->addColumn('name', 'string', ['length' => 30, 'null' => false])
->addColumn('value', 'string', ['length' => 255, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCosto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('costo')
->addColumn('proyecto', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCredito extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('credito')
->addColumn('banco', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('uf', 'float', ['default' => null, 'null' => true])
->addColumn('abonado', 'integer', ['length' => 1, 'default' => 0])
->addColumn('fecha_abono', 'date', ['default' => null, 'null' => true])
->addColumn('pago', 'integer', ['length' => 11, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCuenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cuenta')
->addColumn('inmobiliaria', 'integer', ['length' => 8, 'null' => false, 'signed' => false])
->addColumn('banco', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('cuenta', 'string', ['length' => 50, 'null' => false])
->addForeignKey('inmobiliaria', 'inmobiliaria', 'rut', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('banco', 'banco', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,30 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCuota extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cuota')
->addColumn('pie', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('valor_$', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estado', 'boolean', ['length' => 1, 'default' => 0])
->addColumn('banco', 'string', ['length' => 20, 'null' => false])
->addColumn('fecha_pago', 'date', ['default' => null, 'null' => true])
->addColumn('abonado', 'boolean', ['length' => 1, 'default' => 0])
->addColumn('fecha_abono', 'date', ['default' => null, 'null' => true])
->addColumn('uf', 'double', ['default' => 0])
->addColumn('pago', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('numero', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addForeignKey('pago', 'pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('pie', 'pie', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateDepositos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('depositos')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('capital', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('futuro', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('inicio', 'date', ['null' => false])
->addColumn('termino', 'date', ['null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateDireccion extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('direccion')
->addColumn('calle', 'string', ['length' => 255, 'null' => false])
->addColumn('numero', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('extra', 'string', ['length' => 255, 'null' => false])
->addColumn('comuna', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('comuna', 'comuna', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEntrega extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('entrega')
->addColumn('fecha', 'date', ['null' => false])
->addColumn('fondo_operacion', 'integer', ['length' => 11, 'default' => 0])
->addColumn('fondo_reserva', 'integer', ['length' => 11, 'default' => 0])
->addColumn('fecha_fondo_operacion', 'date', ['default' => null, 'null' => true])
->addColumn('fecha_fondo_reserva', 'date', ['default' => null, 'null' => true])
->addColumn('pago_operacion', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('pago_reserva', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEscritura extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('escritura')
->addColumn('valor', 'biginteger', ['length' => 20, 'null' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('uf', 'float', ['default' => null, 'null' => true])
->addColumn('abonado', 'integer', ['length' => 11, 'default' => 0])
->addColumn('fecha_abono', 'date', ['default' => null, 'null' => true])
->addColumn('pago', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_cierre')
->addColumn('cierre', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addForeignKey('cierre', 'cierre', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipo', 'tipo_estado_cierre', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoCobro extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_cobro')
->addColumn('cobro', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('estado', 'integer', ['length' => 11, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoPago extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_pago')
->addColumn('pago', 'integer', ['length' => 11, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('estado', 'integer', ['length' => 11, 'null' => false])
->addForeignKey('estado', 'tipo_estado_pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoPrecio extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_precio')
->addColumn('precio', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('estado', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('precio', 'precio', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('estado', 'tipo_estado_precio', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoProblema extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_problema')
->addColumn('problema', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('estado', 'enum', ['values' => ['ingreso','revision','correccion','ok'], 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoProyecto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_proyecto')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estado', 'integer', ['length' => 11, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('estado', 'tipo_estado_proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoProyectoAgente extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_proyecto_agente')
->addColumn('agente', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoUnidadBloqueada extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_unidad_bloqueada')
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoVenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_venta')
->addColumn('venta', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estado', 'integer', ['length' => 11, 'default' => 1, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addForeignKey('estado', 'tipo_estado_venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('venta', 'venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadosCuentas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estados_cuentas')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('active', 'boolean', ['length' => 1, 'null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEtapaProyecto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('etapa_proyecto')
->addColumn('descripcion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('orden', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateFacturaProyectoOperador extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('factura_proyecto_operador')
->addColumn('proyecto_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('operador_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('factura', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor_uf', 'double', ['null' => false, 'signed' => false])
->addColumn('valor_neto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('iva', 'integer', ['length' => 10, 'default' => 0, 'signed' => false])
->addForeignKey('proyecto_id', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('operador_id', 'agente', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateVentaDatosFacturas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('venta_datos_facturas')
->addColumn('venta_id', 'integer', ['length' => 10, 'signed' => false])
->addColumn('fecha', 'date')
->addColumn('uf', 'string', ['length' => 50]) // fecha, valor
->addColumn('ipc', 'string', ['length' => 50]) // fecha, valor
->addColumn('terreno', 'integer', ['signed' => false])
->addColumn('unidades', 'text') // id, precios, prorrateo
->addForeignKey('venta_id', 'venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateFacturas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('facturas')
->addColumn('venta_id', 'integer', ['length' => 10, 'signed' => false])
->addColumn('index', 'integer', ['signed' => false])
->addColumn('proporcion', 'double', ['signed' => false]) // %
->addColumn('cliente_rut', 'integer', ['length' => 10, 'signed' => false])
->addForeignKey('venta_id', 'venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('cliente_rut', 'personas', 'rut', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateInmobiliaria extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('inmobiliaria', ['id' => '`rut`'])
->addColumn('rut', 'integer', ['length' => 8, 'null' => false, 'signed' => false])
->addColumn('dv', 'char', ['length' => 1, 'default' => null, 'null' => true])
->addColumn('razon', 'string', ['length' => 255, 'default' => null, 'null' => true])
->addColumn('abreviacion', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('cuenta', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('banco', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('sociedad', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('sigla', 'string', ['length' => 4, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateInmobiliariasNubox extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('inmobiliarias_nubox')
->addColumn('inmobiliaria_rut', 'integer', ['length' => 8, 'null' => false, 'signed' => false])
->addColumn('alias', 'string', ['length' => 100, 'null' => false])
->addColumn('usuario', 'string', ['length' => 100, 'null' => false])
->addColumn('contraseña', 'string', ['length' => 100, 'null' => false])
#->addForeignKey('inmobiliaria_rut', 'inmobiliaria', 'rut', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateLocations extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('locations')
->addColumn('controller', 'string', ['length' => 50, 'null' => false])
->addColumn('action', 'string', ['length' => 100, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateLogins extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('logins')
->addColumn('user_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('time', 'datetime', ['null' => false])
->addColumn('selector', 'string', ['length' => 255, 'null' => false])
->addColumn('token', 'string', ['length' => 255, 'null' => false])
->addColumn('status', 'integer', ['length' => 1, 'default' => 1, 'null' => false])
->addForeignKey('user_id', 'users', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateMovimientos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('movimientos')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('glosa', 'text', ['null' => false])
->addColumn('documento', 'string', ['length' => 50, 'null' => false])
->addColumn('cargo', 'biginteger', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('abono', 'biginteger', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('saldo', 'biginteger', ['length' => 20, 'default' => 0, 'null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,27 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateMovimientosDetalles extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('movimientos_detalles')
->addColumn('movimiento_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('centro_costo_id', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('categoria', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('detalle', 'text', ['default' => null, 'null' => true])
->addColumn('rut', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('digito', 'string', ['length' => 1, 'default' => null, 'null' => true])
->addColumn('nombres', 'string', ['length' => 255, 'default' => null, 'null' => true])
->addColumn('identificador', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addForeignKey('movimiento_id', 'movimientos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('centro_costo_id', 'centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,29 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePagare extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pagare')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('moneda', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('capital', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('tasa', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('fecha_banco', 'date', ['default' => '0000-00-00', 'null' => false])
->addColumn('duracion', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('uf', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('abonado', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('estado_pago', 'integer', ['length' => 10, 'default' => 99999999, 'null' => false, 'signed' => false])
->addForeignKey('moneda', 'tipo_moneda_pagare', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePago extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pago')
->addColumn('valor', 'double', ['null' => false])
->addColumn('banco', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('identificador', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('uf', 'double', ['default' => null, 'null' => true])
->addColumn('pagador', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('asociado', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePagosCentrosCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pagos_centros_costos')
->addColumn('pago_id', 'integer', ['length' => 11, 'null' => false, 'signed' => false])
->addColumn('centro_costo_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('pago_id', 'pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('centro_costo_id', 'centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePermissions extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('permissions')
->addColumn('type', 'integer', ['length' => 1, 'null' => false, 'signed' => false])
->addColumn('ext_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('action_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('status', 'integer', ['length' => 1, 'default' => 1, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePie extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pie')
->addColumn('fecha', 'date', ['null' => false])
->addColumn('valor', 'double', ['null' => false, 'signed' => false])
->addColumn('uf', 'double', ['default' => null, 'null' => true, 'signed' => false])
->addColumn('cuotas', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('asociado', 'integer', ['length' => 11, 'default' => 0])
->addColumn('reajuste', 'integer', ['length' => 11, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePrecio extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('precio')
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['null' => false])
->addForeignKey('unidad', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProblema extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('problema')
->addColumn('venta', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('descripcion', 'text', ['default' => null, 'null' => true, 'limit' => MysqlAdapter::TEXT_MEDIUM])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePromocion extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('promocion')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('titulo', 'string', ['length' => 20, 'null' => false])
->addColumn('fecha_inicio', 'date', ['null' => false])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePromocionVenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('promocion_venta', ['id' => '`promocion`,`venta`'])
->addColumn('promocion', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('venta', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['null' => false, 'signed' => false])
->addForeignKey('promocion', 'promocion', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePropiedad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('propiedad')
->addColumn('unidad_principal', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estacionamientos', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('bodegas', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('estado', 'integer', ['length' => 11, 'default' => 1])
->addForeignKey('unidad_principal', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePropiedadUnidad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('propiedad_unidad')
->addColumn('propiedad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('principal', 'integer', ['length' => 1, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addForeignKey('unidad', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('propiedad', 'propiedad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,30 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePropietario extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('propietario', ['id' => '`rut`'])
->addColumn('rut', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('dv', 'char', ['length' => 1, 'null' => false])
->addColumn('nombres', 'string', ['length' => 255, 'null' => false])
->addColumn('apellido_paterno', 'string', ['length' => 50, 'null' => false])
->addColumn('apellido_materno', 'string', ['length' => 50, 'null' => false])
->addColumn('sexo', 'string', ['length' => 1, 'default' => null, 'null' => true])
->addColumn('estado_civil', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('profesion', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('direccion', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('telefono', 'integer', ['length' => 10, 'default' => 0, 'signed' => false])
->addColumn('email', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('representante', 'integer', ['length' => 10, 'default' => 0])
->addColumn('otro', 'integer', ['length' => 11, 'default' => 0])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

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