diff --git a/.DS_Store b/.DS_Store index fb98025..4ef76c5 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app.py b/app.py index 1218f77..40e175b 100755 --- a/app.py +++ b/app.py @@ -801,7 +801,6 @@ def documentos_eliminar(doc_id): - # Ruta API que devuelve unidades según población @app.route('/api/unidades/') @login_required @@ -849,7 +848,8 @@ def itv_list(): SELECT id, m_oficial, m_reservada, marca, modelo, tipo, tipo, unidad, poblacion, itv FROM vehiculos - WHERE itv IS NOT NULL AND itv != '' + WHERE situacion !='BAJA' + AND itv IS NOT NULL AND itv != '' AND itv BETWEEN ? AND ? AND {where_q} ORDER BY itv ASC @@ -859,7 +859,8 @@ def itv_list(): SELECT id, m_oficial, m_reservada, marca, modelo, tipo, tipo, unidad, poblacion, itv FROM vehiculos - WHERE itv IS NOT NULL AND itv != '' + WHERE situacion !='BAJA' + AND itv IS NOT NULL AND itv != '' AND itv BETWEEN ? AND ? ORDER BY itv ASC ''', (desde_q, hasta_q)).fetchall() @@ -901,7 +902,8 @@ def itv_exportar(): SELECT m_oficial, m_reservada, marca, modelo, tipo, tipo, unidad, poblacion, itv FROM vehiculos - WHERE itv IS NOT NULL AND itv != '' + WHERE situacion !='BAJA' + AND itv IS NOT NULL AND itv != '' AND itv BETWEEN ? AND ? AND {where_q} ORDER BY itv ASC @@ -911,7 +913,8 @@ def itv_exportar(): SELECT m_oficial, m_reservada, marca, modelo, tipo, tipo, unidad, poblacion, itv FROM vehiculos - WHERE itv IS NOT NULL AND itv != '' + WHERE situacion !='BAJA' + AND itv IS NOT NULL AND itv != '' AND itv BETWEEN ? AND ? ORDER BY itv ASC ''', (desde_q, hasta_q)).fetchall() diff --git a/database/auto.db b/database/auto.db new file mode 100755 index 0000000..0981ba8 Binary files /dev/null and b/database/auto.db differ diff --git a/sentencias_sqlite_pyfleet.txt b/sentencias_sqlite_pyfleet.txt index 8d8262f..5611fe9 100755 --- a/sentencias_sqlite_pyfleet.txt +++ b/sentencias_sqlite_pyfleet.txt @@ -230,8 +230,9 @@ SET Después: 1- Poner id autoincremental en tabla vehículos 2. Poner id autoincremental en tabla historial +3. Importar las tablas cvv - poblaciones - tipo - unidades -3- Hacer el update: +4- Hacer el update: UPDATE historial SET vehiculo_id = ( SELECT id @@ -239,8 +240,58 @@ SET vehiculo_id = ( WHERE vehiculos.m_oficial = historial.matricula ); -4- Ordenar los campos de las tablas, con este orden: +5- Ordenar los campos de las tablas, con este orden: +CREATE TABLE "vehiculos" ( + "id" INTEGER, + "m_oficial" TEXT, + "m_reservada" TEXT, + "m_propia" TEXT, + "VIN" TEXT, + "poliza" TEXT, + "viat" TEXT, + "legajo" TEXT, + "marca" TEXT, + "modelo" TEXT, + "tipo" TEXT, + "color" REAL, + "combustible" TEXT, + "plazas" TEXT, + "lanzadestellos" INTEGER, + "situacion" TEXT, + "poblacion" TEXT, + "unidad" TEXT, + "grupo" TEXT, + "int_operacion" TEXT, + "int_grupo" TEXT, + "int_juzgado" TEXT, + "int_procedimiento" INTEGER, + "f_destino_situacion" INTEGER, + "f_alta" TEXT, + "f_baja" INTEGER, + "km" TEXT, + "km_1" TEXT, + "itv_ultima" INTEGER, + "itv" INTEGER, + "observaciones" TEXT, + "historial" TEXT, + "notas" TEXT, pdf TEXT, + PRIMARY KEY("id" AUTOINCREMENT) +) + +CREATE TABLE "historial" ( + "id" INTEGER, + "vehiculo_id" INTEGER, + "fecha" TEXT, + "matricula" TEXT, + "situacion" TEXT, + "poblacion" TEXT, + "unidad" TEXT, + "grupo" TEXT, + "observaciones" TEXT, + PRIMARY KEY("id" AUTOINCREMENT), + FOREIGN KEY("vehiculo_id") REFERENCES "vehiculos"("id") +) diff --git a/static/.DS_Store b/static/.DS_Store new file mode 100644 index 0000000..04ab814 Binary files /dev/null and b/static/.DS_Store differ diff --git a/static/img/logo_blanco.png b/static/img/logo_blanco.png new file mode 100755 index 0000000..1869e18 Binary files /dev/null and b/static/img/logo_blanco.png differ diff --git a/static/img/logo_gris.png b/static/img/logo_gris.png new file mode 100755 index 0000000..2c33421 Binary files /dev/null and b/static/img/logo_gris.png differ diff --git a/templates/.DS_Store b/templates/.DS_Store new file mode 100644 index 0000000..d1d1265 Binary files /dev/null and b/templates/.DS_Store differ diff --git a/templates/itv/list.html b/templates/itv/list.html index a11fd9a..cd79292 100755 --- a/templates/itv/list.html +++ b/templates/itv/list.html @@ -107,9 +107,15 @@ {% endif %} - {% if buscado and rows %} -
+ +
+ + Próxima (vencimiento - 1 de un mes) + Al día (vencimiento + 1 de un mes) +
+ +
diff --git a/uploads/.DS_Store b/uploads/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/uploads/.DS_Store differ diff --git a/uploads/base.html b/uploads/base.html deleted file mode 100755 index 3a82957..0000000 --- a/uploads/base.html +++ /dev/null @@ -1,880 +0,0 @@ - - - - - - {% block title %}App{% endblock %} · PyFleet - - - - - - - - - - - - - - - - -
- - -{# Mensajes solo en página de inicio #} -{% if page == 'inicio' %} - {% if mensajes %} -
-
-
- - - - {{ mensajes|length }} mensaje{{ 's' if mensajes|length != 1 }} -
-
- -
-
- {% for m in mensajes %} -
-
-
{{ m['fecha'] | fecha_es_hora }}
-
{{ m['texto'] }}
-
-
- -
-
- {% endfor %} -
- {% endif %} -{% endif %} - - {% with messages = get_flashed_messages(with_categories=true) %} - {% for category, message in messages %} -
{{ message }}
- {% endfor %} - {% endwith %} - - {% block content %}{% endblock %} - - - -
- - - - -