Arreglo para cambio de año

This commit is contained in:
David Arranz 2026-01-02 12:27:15 +01:00
parent 99c02db1b2
commit 80e88e98a0
4 changed files with 10 additions and 9 deletions

View File

@ -49,7 +49,8 @@ INSERT_INVOICE = (
"FROM customer_invoices "
"WHERE company_id = %s "
"AND is_proforma = %s "
"AND deleted_at is null"
"AND deleted_at is null "
"AND series = %s"
)
INSERT_VERIFACTU_RECORD = (

View File

@ -361,6 +361,7 @@ def insert_invoice_header(
hif.get("factuges_id"),
hif.get("company_id"),
hif.get("is_proforma"),
hif.get("series"),
),
)
return invoice_id

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_VERSION="2.3"
SCRIPT_VERSION="2.4"
# ================================================
# FACTUGES SYNC - Docker Build Script (Simplificado)
@ -102,13 +102,12 @@ FACTUGES_TAR_LATEST="${FACTUGES_OUT##*|}"
VERIFACTU_OUT=$(build_image "verifactu")
VERIFACTU_TAR_V="${VERIFACTU_OUT%%|*}"
VERIFACTU_TAR_LATEST="${VERIFACTU_OUT##*|}"
VERIFACTU_TAR_LATEST=$(build_image "verifactu" | sed -n '2p')
# ---------- 6. Manifest ----------
MANIFEST_FILE="${OUT_DIR}/manifest-${IMAGE_VERSION}-${DATE}.json"
cat > "${MANIFEST_FILE}" <<EOF
{
"type": "script",
"company": "${COMPANY}",
"version": "${IMAGE_VERSION}",
"build_time": "${ISO_DATE}",
@ -132,7 +131,7 @@ echo ""
# ---------- 7. LOAD opcional ----------
if [[ "$LOAD" == true ]]; then
echo "📥 Subiendo imágenes al servidor ${SSH_HOST}..."
echo "📥 Cargando imágenes en producción ${SSH_HOST}..."
ssh -p "${SSH_PORT}" "${SSH_USER}@${SSH_HOST}" \
"mkdir -p /opt/factuges/${COMPANY}/sync"
@ -143,11 +142,11 @@ if [[ "$LOAD" == true ]]; then
echo "📥 Cargando imágenes en Docker remoto..."
ssh -p "${SSH_PORT}" "${SSH_USER}@${SSH_HOST}" <<EOF
docker load -i /opt/factuges/${COMPANY}/sync/$(basename "${FACTUGES_TAR_V}")
docker load -i /opt/factuges/${COMPANY}/sync/$(basename "${VERIFACTU_TAR_V}")
docker load -i /opt/factuges/${COMPANY}/sync/$(basename "${FACTUGES_TAR_LATEST}")
docker load -i /opt/factuges/${COMPANY}/sync/$(basename "${VERIFACTU_TAR_LATEST}")
EOF
echo "✔ Imágenes cargadas correctamente"
echo "✅ Imágenes cargada en producción"
fi

View File

@ -1,6 +1,6 @@
[metadata]
name = factuges-sync
version = 0.1.6
version = 0.1.7
description = ETL job to sync data from legacy DB to MariaDB
author = Rodax Software
author_email = info@rodax-software.com