diff --git a/Dockerfile b/Dockerfile index 839ce364..e0c87087 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,15 @@ ENV CI=1 \ NODE_ENV=production RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate +# Librería para FastReport .NET CLI +RUN apt-get update && apt-get -y install libgdiplus + +# Instalación de Java & AutoFirma para Debian +RUN apt-get -y install curl unzip default-jre libnss3-tools +RUN curl https://firmaelectronica.gob.es/content/dam/firmaelectronica/descargas-software/autofirma19/Autofirma_Linux_Debian.zip --output /tmp/autofirma.zip +RUN unzip /tmp/autofirma.zip autofirma_*.deb -d /tmp +RUN dpkg -i /tmp/autofirma_*.deb + WORKDIR /repo ######################## @@ -43,11 +52,6 @@ FROM base AS builder COPY --from=pruner /repo/out/full/ ./ COPY --from=pruner /repo/out/pnpm-lock.yaml ./pnpm-lock.yaml -#COPY --from=pruner /repo/modules/customer-invoices/src/api/application/use-cases/proformas/report-proforma/reporter/templates ./templates - -# Reutilizamos la store prefetch -#COPY --from=installer /root/.local/share/pnpm/store /root/.local/share/pnpm/store - # Instalamos solo lo necesario para prod de los workspaces RUN pnpm install --frozen-lockfile --prefer-offline @@ -61,28 +65,31 @@ RUN pnpm -w turbo run build --filter=@erp/factuges-server... #FROM ${NODE_IMAGE} AS runner FROM base AS runner +# Puppeteer / Chrome dependencies - BEGIN +# # Configure default locale (important for chrome-headless-shell). -ENV NODE_ENV=production TZ=UTC LANG=es_ES.UTF-8 +#ENV NODE_ENV=production TZ=UTC LANG=es_ES.UTF-8 # Install Google Chrome Stable and fonts # Note: this installs the necessary libs to make the browser work with Puppeteer. # Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) # Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer # installs, work. -RUN apt-get update \ - && apt-get install -y wget gnupg \ - && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ - && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ - && apt-get update \ - && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ - --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* +#RUN apt-get update \ +# && apt-get install -y wget gnupg \ +# && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ +# && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ +# && apt-get update \ +# && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ +# --no-install-recommends \ +# && rm -rf /var/lib/apt/lists/* # PUPPETEER CONFIG -ENV PUPPETEER_SKIP_DOWNLOAD=true \ - PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome - +#ENV PUPPETEER_SKIP_DOWNLOAD=true \ +# PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome +# +# Puppeteer / Chrome dependencies - END # Don't run production as root #RUN addgroup --system --gid 1001 expressjs @@ -97,12 +104,14 @@ COPY --from=builder /repo/pnpm-lock.yaml ./pnpm-lock.yaml COPY --from=builder /repo/pnpm-workspace.yaml ./pnpm-workspace.yaml COPY --from=builder /repo/apps/server/dist ./apps/server/dist -COPY --from=builder /repo/apps/server/.env.${COMPANY} ./apps/server/dist/.env +#COPY --from=builder /repo/apps/server/.env.${COMPANY} ./apps/server/dist/.env COPY --from=builder /repo/apps/server/node_modules ./apps/server/node_modules COPY --from=builder /repo/apps/server/package.json ./apps/server/package.json -# Las plantillas estarán en un volumen apuntando a /repo/apps/server/templates -#COPY --from=builder /repo/templates ./apps/server/dist/templates +COPY tools/fastreport-cli/publish/linux/FastReportCliGenerator ./tools/FastReportCliGenerator +RUN chmod +x ./tools/FastReportCliGenerator + +# Las plantillas estarán en un volumen apuntando a /shared/templates # Salud del contenedor (ajusta puerto/endpoint) diff --git a/apps/server/package.json b/apps/server/package.json index ff64e428..2c980419 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "@erp/factuges-server", - "version": "0.1.1", + "version": "0.1.4", "private": true, "scripts": { "build": "tsup src/index.ts --config tsup.config.ts", diff --git a/apps/web/package.json b/apps/web/package.json index e0c428b8..9f30eccc 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,7 +1,7 @@ { "name": "@erp/factuges-web", "private": true, - "version": "0.1.1", + "version": "0.1.4", "type": "module", "scripts": { "dev": "vite --host --clearScreen false", diff --git a/modules/auth/package.json b/modules/auth/package.json index 3bbc19d2..db4a62d7 100644 --- a/modules/auth/package.json +++ b/modules/auth/package.json @@ -1,6 +1,6 @@ { "name": "@erp/auth", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/modules/core/package.json b/modules/core/package.json index 2b4c6e70..2c33fe65 100644 --- a/modules/core/package.json +++ b/modules/core/package.json @@ -1,6 +1,6 @@ { "name": "@erp/core", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/modules/customer-invoices/package.json b/modules/customer-invoices/package.json index e29c1802..7709163a 100644 --- a/modules/customer-invoices/package.json +++ b/modules/customer-invoices/package.json @@ -1,6 +1,6 @@ { "name": "@erp/customer-invoices", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/modules/customers/package.json b/modules/customers/package.json index 12113e04..0d93c55e 100644 --- a/modules/customers/package.json +++ b/modules/customers/package.json @@ -1,6 +1,6 @@ { "name": "@erp/customers", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/modules/doc-numbering/package.json b/modules/doc-numbering/package.json index 28e1df54..9b2f403b 100644 --- a/modules/doc-numbering/package.json +++ b/modules/doc-numbering/package.json @@ -1,6 +1,6 @@ { "name": "@erp/doc-numbering", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/packages/rdx-criteria/package.json b/packages/rdx-criteria/package.json index 480c41ab..df1a2108 100644 --- a/packages/rdx-criteria/package.json +++ b/packages/rdx-criteria/package.json @@ -1,6 +1,6 @@ { "name": "@repo/rdx-criteria", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/packages/rdx-ddd/package.json b/packages/rdx-ddd/package.json index ca3e2d34..c829e12c 100644 --- a/packages/rdx-ddd/package.json +++ b/packages/rdx-ddd/package.json @@ -1,6 +1,6 @@ { "name": "@repo/rdx-ddd", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/packages/rdx-logger/package.json b/packages/rdx-logger/package.json index 01246d7d..d24f07e4 100644 --- a/packages/rdx-logger/package.json +++ b/packages/rdx-logger/package.json @@ -1,6 +1,6 @@ { "name": "@repo/rdx-logger", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/packages/rdx-utils/package.json b/packages/rdx-utils/package.json index 4cae5361..d74a6765 100644 --- a/packages/rdx-utils/package.json +++ b/packages/rdx-utils/package.json @@ -1,6 +1,6 @@ { "name": "@repo/rdx-utils", - "version": "0.1.1", + "version": "0.1.4", "private": true, "type": "module", "sideEffects": false, diff --git a/scripts/build-factuges.sh b/scripts/build-factuges.sh index 0fefbb17..6b680756 100755 --- a/scripts/build-factuges.sh +++ b/scripts/build-factuges.sh @@ -238,7 +238,7 @@ if [[ "$LOAD" == true ]]; then [[ "$MODE" == "web" || "$MODE" == "all" ]] && scp -r -P "${SSH_PORT}" "${OUT_WEB_DIR}" "${SSH_USER}@${SSH_HOST}:/opt/factuges/${COMPANY}/" [[ "$MODE" == "api" || "$MODE" == "all" ]] && scp -r -P "${SSH_PORT}" "${OUT_API_DIR}" "${SSH_USER}@${SSH_HOST}:/opt/factuges/${COMPANY}/" - [[ "$MODE" == "api" || "$MODE" == "all" ]] && scp -r -P "${SSH_PORT}" "${TEMPLATES_DIR}" "${SSH_USER}@${SSH_HOST}:/opt/factuges/${COMPANY}/" + [[ "$MODE" == "api" || "$MODE" == "all" ]] && scp -r -P "${SSH_PORT}" "${TEMPLATES_DIR}" "${SSH_USER}@${SSH_HOST}:/opt/factuges/${COMPANY}/volumes/" if [[ "$MODE" == "api" || "$MODE" == "all" ]]; then RESULT=$(ssh -p "${SSH_PORT}" "${SSH_USER}@${SSH_HOST}" \ diff --git a/scripts/build-templates.sh b/scripts/build-templates.sh index 1d6bb4d4..53c4eac7 100755 --- a/scripts/build-templates.sh +++ b/scripts/build-templates.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -SCRIPT_VERSION="0.0.1" +SCRIPT_VERSION="0.0.2" # ===================================================== # TEMPLATES Build Script @@ -9,7 +9,7 @@ SCRIPT_VERSION="0.0.1" # Recopilas plantillas de los módulos (por compañía) # ===================================================== # Uso: -# ./build_templates.sh [--api|web|all] [--load] +# ./build_templates.sh # # Funcionalidades: # - diff --git a/scripts/stacks/rodax/docker-compose.yml b/scripts/stacks/rodax/docker-compose.yml index c1fd9e48..e052a07e 100644 --- a/scripts/stacks/rodax/docker-compose.yml +++ b/scripts/stacks/rodax/docker-compose.yml @@ -86,8 +86,12 @@ services: DB_PASS: ${DB_PASS} FRONTEND_URL: ${FRONTEND_URL} TEMPLATES_PATH: ${TEMPLATES_PATH} + DOCUMENTS_PATH: ${DOCUMENTS_PATH} + FASTREPORT_BIN: ${FASTREPORT_BIN} volumes: - - ./templates:/repo/apps/server/templates:ro + - ./volumes/templates:/shared/templates:ro + - ./volumes/certificates:/shared/certificates:ro + - ./volumes/documents:/shared/documents:rw networks: - internal - edge @@ -134,8 +138,8 @@ services: factuges_sync: - image: "factuges-sync:rodax-latest" - container_name: "factuges_rodax_sync" + image: "factuges-sync-factuges:rodax-latest" + container_name: "factuges_rodax_sync_factuges" restart: "no" environment: ENV: "production" @@ -178,6 +182,50 @@ services: - ./volumes/db_sync:/app/rodax + verifactu_sync: + image: "factuges-sync-verifactu:rodax-latest" + container_name: "factuges_rodax_sync_verifactu" + restart: "no" + environment: + ENV: "production" + LOCAL_TZ: "Europe/Madrid" + STATE_PATH: "${STATE_PATH}" + + FACTUGES_HOST: "${FACTUGES_HOST}" + FACTUGES_PORT: "${FACTUGES_PORT}" + FACTUGES_DATABASE: "${FACTUGES_DATABASE}" + FACTUGES_USER: "${FACTUGES_USER}" + FACTUGES_PASSWORD: "${FACTUGES_PASSWORD}" + + FWEB_MYSQL_HOST: "db" + FWEB_MYSQL_PORT: "${DB_PORT}" + FWEB_MYSQL_DATABASE: "${DB_NAME}" + FWEB_MYSQL_USER: "${DB_USER}" + FWEB_MYSQL_PASSWORD: "${DB_PASS}" + + CTE_COMPANY_ID: "${CTE_COMPANY_ID}" + CTE_SERIE: "${CTE_SERIE}" + CTE_STATUS_INVOICE: "${CTE_STATUS_INVOICE}" + CTE_IS_PROFORMA: "${CTE_IS_PROFORMA}" + CTE_STATUS_VERIFACTU: "${CTE_STATUS_VERIFACTU}" + CTE_LANGUAGE_CODE: "${CTE_LANGUAGE_CODE}" + CTE_COUNTRY_CODE: "${CTE_COUNTRY_CODE}" + CTE_IS_COMPANY: "${CTE_IS_COMPANY}" + CTE_SYNC_RESULT_OK: "${CTE_SYNC_RESULT_OK}" + CTE_SYNC_RESULT_FAIL: "${CTE_SYNC_RESULT_FAIL}" + + VERIFACTU_API_KEY: "${VERIFACTU_API_KEY}" + VERIFACTU_BASE_URL: "${VERIFACTU_BASE_URL}" + VERIFACTU_NIFS_API_KEY: "${VERIFACTU_NIFS_API_KEY}" + depends_on: + db: + condition: service_healthy + networks: + - internal + - edge + volumes: + - ./volumes/db_sync:/app/rodax + networks: edge: name: edge diff --git a/scripts/stacks/rodax/env.rodax b/scripts/stacks/rodax/env.rodax index d8fdcf06..36ae7d9b 100644 --- a/scripts/stacks/rodax/env.rodax +++ b/scripts/stacks/rodax/env.rodax @@ -14,9 +14,15 @@ DB_PORT=3306 # API API_PORT=3002 API_IMAGE=factuges-server:rodax-latest -TEMPLATES_PATH=/repo/apps/server/templates FRONTEND_URL=factuges.rodax-software.local +# Plantillas +TEMPLATES_PATH=/shared/templates + +# Documentos generados +FASTREPORT_BIN=/repo/tools/FastReportCliGenerator +DOCUMENTS_PATH=/shared/documents + # SYNC ENV = development @@ -37,7 +43,7 @@ FWEB_MYSQL_USER = acana # ${DB_USER} FWEB_MYSQL_PASSWORD = r@U8%GJ+2e/AWR # ${DB_PASS} CTE_COMPANY_ID = '5e4dc5b3-96b9-4968-9490-14bd032fec5f' -CTE_SERIE = 'F25' +CTE_SERIE = 'F26' CTE_STATUS_INVOICE = 'issued' CTE_IS_PROFORMA = 0 CTE_STATUS_VERIFACTU = 'Pendiente' @@ -47,6 +53,7 @@ CTE_IS_COMPANY = 1 CTE_SYNC_RESULT_OK = 1 CTE_SYNC_RESULT_FAIL = 2 +#VERIFACTU_API_KEY = vf_test_C03HL2F0X5OXSDRunjNFoMxD4IrRfK3kCC8PfcvCENI= VERIFACTU_API_KEY = vf_prod_yfjonNPv2E4Fij+5J0hct0zCgUeFYT2dZzb23UZlM+Q= VERIFACTU_BASE_URL = https://api.verifacti.com/ VERIFACTU_NIFS_API_KEY = vfn_osYpNdqSzAdTAHpazXG2anz4F3o0gfbSb5FFrCBZcno= diff --git a/tools/fastreport-cli/FastReportCliGenerator.csproj b/tools/fastreport-cli/FastReportCliGenerator.csproj index 9cee2cc7..a2b024b0 100644 --- a/tools/fastreport-cli/FastReportCliGenerator.csproj +++ b/tools/fastreport-cli/FastReportCliGenerator.csproj @@ -11,9 +11,9 @@ - 1.1 - 1.1.0.9 - 1.1.0.9 + 1.2 + 1.2.0.0 + 1.2.0.0 diff --git a/tools/fastreport-cli/Program.cs b/tools/fastreport-cli/Program.cs index 47afef97..b790a641 100644 --- a/tools/fastreport-cli/Program.cs +++ b/tools/fastreport-cli/Program.cs @@ -58,7 +58,6 @@ class Program foreach (var conn in report.Dictionary.Connections) { - Console.WriteLine($"Connection found: {conn.ToString()} ({conn.GetType().Name})"); if (conn is JsonDataSourceConnection jdc) { jsonConn = jdc; diff --git a/tools/fastreport-cli/publish/linux/FastReportCliGenerator b/tools/fastreport-cli/publish/linux/FastReportCliGenerator index 0481e244..43160784 100755 Binary files a/tools/fastreport-cli/publish/linux/FastReportCliGenerator and b/tools/fastreport-cli/publish/linux/FastReportCliGenerator differ diff --git a/tools/fastreport-cli/publish/windows/FastReportCliGenerator.exe b/tools/fastreport-cli/publish/windows/FastReportCliGenerator.exe index d708a866..0b7ce6f2 100755 Binary files a/tools/fastreport-cli/publish/windows/FastReportCliGenerator.exe and b/tools/fastreport-cli/publish/windows/FastReportCliGenerator.exe differ diff --git a/uecko-erp.sln b/uecko-erp.sln deleted file mode 100644 index e6369d30..00000000 --- a/uecko-erp.sln +++ /dev/null @@ -1,32 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.2.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{07C2787E-EAC7-C090-1BA3-A61EC2A24D84}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fastreport-cli", "fastreport-cli", "{1C34789F-0E1A-CA83-9858-BEAA929278B6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastReportCliGenerator", "tools\fastreport-cli\FastReportCliGenerator.csproj", "{A8ED47CA-7B74-F26D-058D-6D6FD981B253}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A8ED47CA-7B74-F26D-058D-6D6FD981B253}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A8ED47CA-7B74-F26D-058D-6D6FD981B253}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A8ED47CA-7B74-F26D-058D-6D6FD981B253}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A8ED47CA-7B74-F26D-058D-6D6FD981B253}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {1C34789F-0E1A-CA83-9858-BEAA929278B6} = {07C2787E-EAC7-C090-1BA3-A61EC2A24D84} - {A8ED47CA-7B74-F26D-058D-6D6FD981B253} = {1C34789F-0E1A-CA83-9858-BEAA929278B6} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AF858B63-A8CD-4661-B6E0-451742E4C40E} - EndGlobalSection -EndGlobal