6 Commits

7 changed files with 47 additions and 45 deletions

View File

@ -1,16 +1,20 @@
FROM php:8.2-fpm
FROM php:8.2-cli
ENV TZ "America/Santiago"
ENV TZ "${TZ}"
ENV APP_NAME "${APP_NAME}"
ENV API_URL "${API_URL}"
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 && rm -r /var/lib/apt/lists/*
RUN pecl install xdebug-3.2.2 \
&& docker-php-ext-enable xdebug
&& docker-php-ext-enable xdebug \
&& echo "#/bin/bash\nprintenv >> /etc/environment\ncron -f -L 11" > /root/entrypoint && chmod a+x /root/entrypoint
COPY ./php-errors.ini /usr/local/etc/php/conf.d/docker-php-errors.ini
WORKDIR /code/bin
COPY ./cli/crontab /var/spool/cron/crontabs/root
#COPY --chmod=644 ./cli/crontab /etc/cron.d/cronjob
COPY --chmod=644 ./cli/crontab /var/spool/cron/crontabs/root
CMD ["cron", "-f"]
CMD [ "/root/entrypoint" ]

View File

@ -6,7 +6,7 @@
<form id="search_form" class="ui form" action="{{$urls->base}}/search" method="post">
<div class="field">
<div class="ui fluid input" data-tooltip="Para buscar frases se deben encerrar entre comillas. ej, 'portal la viña' o &quot;portal la viña&quot;" data-position="bottom left">
<div class="ui fluid input" data-tooltip="Para buscar frases se deben encerrar entre comillas. ej, 'portal la viña' o &quot;portal la viña&quot;" data-position="top right">
<input type="text" name="query" />
</div>
</div>
@ -56,7 +56,7 @@
unidad.html(unidad.html() + ' (I)')
}
propietario = $('<a></a>')
.attr('href','{{$urls->base}}/search/' + encodeURIComponent(this.venta.propietario.nombre_completo) + '/propietario')
.attr('href','{{$urls->base}}/search/"' + encodeURIComponent(this.venta.propietario.nombre_completo) + '"/propietario')
.html(this.venta.propietario.nombre_completo)
fecha = dateFormatter.format(new Date(this.venta.fecha))
if (typeof this.venta.entrega !== 'undefined') {
@ -309,15 +309,23 @@
}
}
},
set: function() {
return {
query: value => {
$("[name='query']").val(value)
this.get().results()
}
}
},
setup: function(id) {
this.id = id
this.get().results()
$('#tipo').dropdown().dropdown('set selected', '*')
@if (trim($post) !== '')
$("[name='query']").val('{{$post}}')
this.set().query('{!! $post !!}')
@elseif (trim($query) !== '')
$("[name='query']").val('{{$query}}')
this.set().query('{!! $query !!}')
@endif
@if (trim($tipo) !== '')
$('#tipo').dropdown('set selected', '{{$tipo}}')

View File

@ -4,10 +4,10 @@ use Psr\Container\ContainerInterface;
return [
Incoviba\Common\Define\Database::class => function(ContainerInterface $container) {
return new Incoviba\Common\Implement\Database\MySQL(
$container->has('MYSQL_HOST') ? $container->get('MYSQL_HOST') : 'db',
$container->get('MYSQL_DATABASE'),
$container->get('MYSQL_USER'),
$container->get('MYSQL_PASSWORD')
$container->has('DB_HOST') ? $container->get('DB_HOST') : 'db',
$container->get('DB_DATABASE'),
$container->get('DB_USER'),
$container->get('DB_PASSWORD')
);
},
Incoviba\Common\Define\Connection::class => function(ContainerInterface $container) {

View File

@ -142,7 +142,7 @@ class Search
}
protected function findPago(string $query): array
{
if ($query != 0) {
if ((int) $query === 0) {
return [];
}
$methods = [
@ -156,6 +156,7 @@ class Search
$pagos = [];
try {
$pagos = $this->pagoRepository->fetchByValue((int) $valor);
error_log(var_export($pagos,true).PHP_EOL,3,'/logs/debug');
} catch (EmptyResult) {}
$results = [];
foreach ($methods as $method) {

5
cli/bin/incoviba Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
. /etc/profile
/usr/local/bin/php /code/bin/index.php "$@"

View File

@ -1,8 +1,8 @@
0 2 * * * php /code/bin/index.php ventas:cuotas:hoy 2>&1 >> /logs/commands
0 2 * * * php /code/bin/index.php ventas:cuotas:pendientes 2>&1 >> /logs/commands
0 2 * * * php /code/bin/index.php ventas:cuotas:vencer 2>&1 >> /logs/commands
0 2 * * * php /code/bin/index.php ventas:cierres:vigentes 2>&1 >> /logs/commands
0 2 * * * php /code/bin/index.php proyectos:activos 2>&1 >> /logs/commands
0 2 * * * php /code/bin/index.php comunas 2>&1 >> /logs/commands
0 2 * * * php /code/bin/index.php money:uf 2>&1 >> /logs/commands
0 2 1 * * php /code/bin/index.php money:ipc 2>&1 >> /logs/commands
0 2 * * * /code/bin/incoviba ventas:cuotas:hoy >> /logs/commands 2>&1
0 2 * * * /code/bin/incoviba ventas:cuotas:pendientes >> /logs/commands 2>&1
0 2 * * * /code/bin/incoviba ventas:cuotas:vencer >> /logs/commands 2>&1
0 2 * * * /code/bin/incoviba ventas:cierres:vigentes >> /logs/commands 2>&1
0 2 * * * /code/bin/incoviba proyectos:activos >> /logs/commands 2>&1
0 2 * * * /code/bin/incoviba comunas >> /logs/commands 2>&1
0 2 * * * /code/bin/incoviba money:uf >> /logs/commands 2>&1
0 2 1 * * /code/bin/incoviba money:ipc >> /logs/commands 2>&1

View File

@ -1,15 +1,10 @@
version: '3'
x-restart: &restart
restart: unless-stopped
services:
proxy:
profiles:
- app
image: nginx:alpine
container_name: incoviba_proxy
<<: *restart
restart: unless-stopped
ports:
- "${APP_PORT}:80"
volumes:
@ -22,12 +17,10 @@ services:
- app
build: .
container_name: incoviba_web
<<: *restart
restart: unless-stopped
env_file:
- ${APP_PATH:-.}/.env
- ${APP_PATH:-.}/.db.env
- ./.key.env
#- ${APP_PATH:-.}/.remote.env
volumes:
- ${APP_PATH:-.}/:/code
- ./logs/php:/logs
@ -37,7 +30,7 @@ services:
- db
image: mariadb:latest
container_name: incoviba_db
<<: *restart
restart: unless-stopped
env_file: ${APP_PATH:-.}/.db.env
volumes:
- dbdata:/var/lib/mysql
@ -53,22 +46,13 @@ services:
- cache
image: redis
container_name: incoviba_redis
<<: *restart
restart: unless-stopped
env_file: ${APP_PATH:-.}/.redis.env
volumes:
- incoviba_redis:/data
ports:
- "63790:6379"
python:
profiles:
- python
build:
context: .
dockerfile: Python.Dockerfile
container_name: incoviba_python
<<: *restart
logview:
profiles:
- log
@ -81,7 +65,7 @@ services:
WEB_URL: 'http://provm.cl:8084'
WEB_PORT: '8084'
volumes:
- "./logs:/logs"
- ./logs:/logs
ports:
- "8084:80"
cli:
@ -91,7 +75,7 @@ services:
context: .
dockerfile: CLI.Dockerfile
container_name: incoviba_cli
<<: *restart
restart: unless-stopped
env_file:
- ${CLI_PATH:-.}/.env
- ./.key.env