Aller au contenu principal

4. Paramétrer la comptabilité et les modèles

Observé — enchaînement UI /admin/accounting → opérations → /admin/accounting/invoice-configs.

Pourquoi

Sans plan comptable + opérations + modèle de facture, les loyers de lots et la facturation des dossiers de location ne peuvent pas être correctement branchés.

4.1 Plan comptable (createOrUpdateAccountingConfig)

remarque

Dans l’UI admin, le document GraphQL peut s’appeler autrement.

mutation createOrUpdateAccountingConfig($accountingConfig: AccountingConfigInput!) {
createOrUpdateAccountingConfig(accountingConfig: $accountingConfig) {
openingDate
accounts {
id
accountNumber
label
category
}
}
}
{
"accountingConfig": {
"openingDate": "2026-07-27",
"accounts": [
{
"accountNumber": "165",
"label": "Dépôt de garantie",
"category": "warranty_deposits_account"
},
{
"accountNumber": "411",
"label": "Compte locataires",
"category": "tenant_account"
},
{
"accountNumber": "512",
"label": "Banque",
"category": "bank"
},
{
"accountNumber": "708",
"label": "Charges",
"category": "rental_charges_account"
},
{
"accountNumber": "622",
"label": "Honoraires",
"category": "fee_account"
},
{
"accountNumber": "706",
"label": "Loyer",
"category": "rent_account"
}
]
}
}

4.2 Opérations comptables

mutation createOrUpdateAccountingOperation(
$accountingOperations: [AccountingOperationInput!]!
) {
createOrUpdateAccountingOperation(
accountingOperations: $accountingOperations
) {
id
label
type
usage
destinationAccountId
}
}
{
"accountingOperations": [
{
"type": "credit",
"usage": "invoicing",
"label": "Loyer",
"destinationAccountId": "00000000-0000-4000-8000-000000000041",
"vatRate": 0,
"vatMention": "not_applicable",
"vatSpecific": "accounting",
"isProrated": false
},
{
"type": "credit",
"usage": "invoicing",
"label": "Charges",
"destinationAccountId": "00000000-0000-4000-8000-000000000042",
"vatRate": 0,
"vatMention": "not_applicable",
"vatSpecific": "accounting",
"isProrated": false
}
]
}
# payload.json = query GraphQL + variables ci-dessus
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @payload.json

Conservez les id renvoyés pour les rentItems.operationId du lot.

4.3 Modèle de facture / avis

mutation createOrUpdateAccountingInvoiceConfig($accountingInvoiceConfig: AccountingInvoiceConfigInput!) {
createOrUpdateAccountingInvoiceConfig(accountingInvoiceConfig: $accountingInvoiceConfig) {
id
name
type
state
referencePattern
}
}
{
"accountingInvoiceConfig": {
"name": "Modèle Facture Loyer",
"type": "invoice",
"referencePattern": "[invoice_number]",
"accountingAccountId": "00000000-0000-4000-8000-000000000041",
"noticeDisplayBalance": true,
"receiptDisplayBalance": true,
"noticeDisplayBanking": true,
"receiptDisplayBanking": true,
"noticeDisplayRepresentative": true,
"receiptDisplayRepresentative": true,
"noticeDisplayAgency": false,
"receiptDisplayAgency": false,
"noticeDisplayDocumentAsTitle": false,
"receiptDisplayDocumentAsTitle": false,
"noticeDisplayDebitDateInfo": false,
"receiptDisplayDebitDateInfo": false,
"signatureFile": null
}
}
# payload.json = query GraphQL + variables ci-dessus
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @payload.json

L’id du modèle pourra alimenter accountingInvoiceConfigId d’un dossier de location.

Suite

Compléter un lot