---
suivi: 1681
date: 2026-09-24
sujet: Projet Sage créé au niveau général, sans LOCATIONID
chantier: comptabilite / sage / projets
type: fix
statut: poussé
hash: 66926480
fichiers:
  - app/Services/IntacctService.php
  - app/Services/IntacctProjetCreationService.php
  - resources/js/Pages/Compta/ProgrammeParametresBancaires.vue
  - database/data/journal_mises_a_jour_post_2026_06_12.php
  - tests/Unit/IntacctCreerProjetXmlTest.php
  - public/build/manifest.json
  - public/build/assets/ProgrammeParametresBancaires-DDLSDatD.js
  - public/build/assets/app-BzZlfSJf.js
  - docs/suivi/SUIVI_1681_projet_sage_niveau_general.md
---

# SUIVI #1681 — projet Sage au niveau général

Annule le LOCATIONID du #1680. La session de création était déjà top-level.

## PARTIE A

`getSessionId` (`IntacctService.php:1632`) cache `intacct_session` et appelle
`obtainSessionIdFromLogin` (`:1661`). Le login (`buildGetApiSessionRequestXml`,
`:1719`) n'a pas de `locationid`. `getAPISession` est vide (`:1740`).
`creerFournisseur` (`:1312`), `creerProjet` et `lireProjetParProjectId`
(via `readByQueryPaginated` → `sendRequest`, `:153`) utilisent cette session.
La session entité est ailleurs : `sendComptabilisationRequest` (`:186`) avec
`getAPISession` + `locationid` (`:1687`). Elle n'est pas utilisée pour les projets.

Conclusion : session déjà niveau général. Aucune session nouvelle.

## SYNTHÈSE

XML de création sans LOCATIONID (`xmlCreerProjet`). Société non exigée.
Confirmation : « Entité : aucune — projet créé au niveau général ».
Journal `intacct` : `creerProjet debut` / `creerProjet fin` avec `duree_ms` et le XML.

## DÉPLOIEMENT-TEST

git pull, optimize:clear, view:clear, journal:sync. Pas de migration.

Après création de HEC34-011 et synchro :
SELECT projectid, project_type, project_category, location_id
FROM intacct_projects WHERE projectid = 'HEC34-011';
Attendu : AMENAGEMENT, Contract, location_id NULL.

## LEÇON

Ne pas envoyer LOCATIONID pour un projet au niveau général. La session
top-level existait déjà ; ne pas la remplacer par une session entité.
