Skip to content

feat(reminders): rappels fiscaux J-15 par e-mail (Resend) pour SASU simple#42

Open
antonymarion wants to merge 2 commits into
romainsimon:masterfrom
antonymarion:feat/fiscal-reminders-resend
Open

feat(reminders): rappels fiscaux J-15 par e-mail (Resend) pour SASU simple#42
antonymarion wants to merge 2 commits into
romainsimon:masterfrom
antonymarion:feat/fiscal-reminders-resend

Conversation

@antonymarion
Copy link
Copy Markdown

@antonymarion antonymarion commented May 20, 2026

Summary

  • Rappels fiscaux J-15 par e-mail (Resend) pour profil SASU / IS au réel + TVA réelle normale : TVA, acomptes et solde IS, liasse, AG, greffe, CFE, DAS2, rappel IR perso — montants estimés et justification quand le calcul est déterministe.
  • Pipeline journal:qonto : synchronisation Qonto puis catégorisation PCG/TVA → data/journal-entries.json (indispensable pour des montants CA3 non nuls dans les e-mails).
  • journal:an : à-nouveaux depuis bilan N-1 + affectation du résultat + fusion des écritures banque.
  • integrations/core : chargement .env et company.json pour les scripts CLI et PM2.
  • Données locales (journal, bilans, company.json) gitignored ; retrait du journal d’exemple versionné dans le dépôt.

Calendrier des rappels (profil sasu_is_tva_normal)

Obligation Échéance type Montant dans l’e-mail
TVA (CA3) 25 du mois Oui (journal ou TVA_OVERRIDE_EUR)
Acomptes IS (×4) 15 mars, juin, sept., déc. Oui (25 % × IS N-1)
Solde IS 15 mai Oui
Liasse IS (2065) 2e jour ouvré après le 1er mai Non (déclaration)
AG / approbation 6 mois après clôture Non
Dépôt greffe 30 jours après l’AG Oui (frais greffe / override)
CFE 15 décembre Si override, sinon rappel sans montant fiable
DAS2 31 mars Non (procédure)
IR perso (2042) 20 mai Non (rappel déclaration)

Un e-mail par obligation, 15 jours avant l’échéance (remind_on), via npm run reminders:send ou PM2 (cron 08:00 Europe/Paris). Les envois déjà faits sont journalisés dans data/reminders-sent.json.

Contenu du PR

Zone Fichiers / rôle
Rappels lib/reminders/*, config/reminders.json, scripts/send-reminders.js, ecosystem.config.cjs
Journal Qonto scripts/journal-qonto.js, scripts/qonto-to-journal.js, scripts/prepare-opening-entries.js
Core integrations/core/load-env.js, integrations/core/provider.js
Config package.json, .env.example, company.example.json
Doc README.md (workflow, overrides, PM2 Windows)
Exemple data/examples/bilan-closing.sample.json
Optionnel config/qonto-label-rules.example.json → règles libellés en .local.json (gitignored)

Commandes

npm run journal:qonto   # fetch Qonto + journal BQ (TVA 44571/44566)
npm run journal:an      # AN + affectation AG + BQ (bilan N-1 requis)
npm run reminders:preview
npm run reminders:send
npm run pm2:reminders   # cron 08:00 Paris ; pm2 save (+ pm2-windows-startup sur Windows)

Configuration locale (non versionnée)

  • company.json, .env (Resend, Qonto, IS_N1_EUR, TVA_OVERRIDE_EUR, etc.)
  • data/journal-entries.json, data/bilan-closing.json, data/transactions/

Test plan

  • npm run journal:qontodata/transactions/*.json + journal-entries.json avec lignes TVA
  • npm run journal:an avec data/bilan-closing.json + fiscal_affectation_* dans company.json
  • npm run reminders:preview -- --date 2026-02-28 → acompte IS avec montant + justification
  • npm run reminders:preview -- --date 2026-05-10 → TVA CA3 du 25/05 (période M−1) ≠ 0 si journal à jour
  • npm run reminders:preview -- --date 2026-06-16 → AG / liasse / DAS2 selon calendrier
  • Solde IS : libellé dérivé de due_date (config reminders.json)
  • npm run reminders:dry-run → pas d’envoi Resend
  • PM2 : pm2:reminders + pm2 save (+ pm2-windows-startup si Windows)

Notes

  • Crédit TVA (44567) non imputé en v1.
  • qonto-to-journal.js : règles PCG génériques ; clients récurrents via config/qonto-label-rules.local.json.
  • Greffe : date d’échéance = AG + 30 jours, même date d’AG que AG_APPROBATION (clôture N−1 + 6 mois ou fiscal_affectation_YYYY / ag_date dans company.json).

@antonymarion antonymarion force-pushed the feat/fiscal-reminders-resend branch 2 times, most recently from b0e38f2 to 35bd3d9 Compare May 20, 2026 17:49
Rappels e-mail Resend (cron PM2), calendrier SASU IS+TVA, montants depuis journal/bilan.

Pipeline journal:qonto (fetch + qonto-to-journal), journal:an (bilan N-1), integrations/core.

Journal et bilans locaux gitignored.

Co-authored-by: Cursor <cursoragent@cursor.com>
@antonymarion antonymarion force-pushed the feat/fiscal-reminders-resend branch from c384755 to d5b303a Compare May 21, 2026 16:25
agDateForYear utilise la clôture N-1 (+6 mois), comme AG_APPROBATION, et lit fiscal_affectation_YYYY. Le dépôt greffe est calculé à AG + 30 jours au lieu d'une date décalée d'un an.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant