=== structure intake === rowid int entity int filename varchar(255) file_path varchar(500) file_hash varchar(64) file_size int mime_type varchar(100) doc_type varchar(30) confidence decimal(5,4) fk_target_type varchar(50) fk_target_id int status varchar(20) error_message text extracted_data longtext tokens_input int tokens_output int api_cost_eur decimal(8,4) date_intake datetime date_processed datetime date_validated datetime fk_user_validate int tms timestamp === lignes intake contenant COEUGNET === --- rowid = 71 entity = 1 filename = COEUGNET 07-31.pdf file_path = /home/teknipn/documents/agentcompta/processed/2026-08/COEUGNET 07-31.pdf file_hash = b6ac03842de03639d06797e78c6335cc088f13c1a3f0fcd66f5ca5470217a7d2 file_size = 384462 mime_type = application/pdf doc_type = invoice_supplier confidence = 0.8800 fk_target_type = invoice_supplier fk_target_id = 125 status = validated error_message = Brouillon facture fournisseur #125 créé — à contrôler puis valider dans Dolibarr. extracted_data = {"supplier":{"name":"Cœugnet Matériaux","siret":"50495101300011","vat_number":"FR74504951013","iban":"FR7630006000430000397052302","email":null,"address":"Z.I. du Grand Clos, 14320 SAINT-ANDRÉ-SUR-ORNE"},"invoice":{"ref":"42318","date":"2026-07-31","due_date":"2026-08-31","currency":"EUR","total_ tokens_input = 3765 tokens_output = 563 api_cost_eur = 0.0134 date_intake = 2026-08-08 08:31:55 date_processed = 2026-08-08 22:48:47 date_validated = 2026-08-09 05:04:11 fk_user_validate = 1 tms = 2026-08-09 05:04:11 --- rowid = 100 entity = 1 filename = COEUGNET 03-22.pdf file_path = /home/teknipn/documents/agentcompta/processed/2026-08/COEUGNET 03-22_1786246513.pdf file_hash = 263a5a661a0d8ba88c97896ffa8f55cb4dad994df6a060bc6e1f704c80850579 file_size = 397214 mime_type = application/pdf doc_type = invoice_supplier confidence = 1.0000 fk_target_id = 0 status = archived error_message = Achat deja comptabilise depuis le registre de l assistante — document conserve aux Archives. extracted_data = {"supplier":{"name":"Cœugnet Matériaux","siret":"50495101300011","vat_number":"FR74504951013","iban":"FR7608060300430004000025710092502","email":null,"address":"Z.I. du Grand Clos, 14320 SAINT-ANDRÉ-SUR-ORNE"},"invoice":{"ref":"40331","date":"2026-03-31","due_date":"2026-04-30","currency":"EUR"," tokens_input = 3765 tokens_output = 1290 api_cost_eur = 0.0234 date_intake = 2026-08-08 22:25:15 date_processed = 2026-08-09 04:31:46 date_validated = 2026-08-09 13:53:47 fk_user_validate = 1 tms = 2026-08-09 13:53:47 --- rowid = 101 entity = 1 filename = COEUGNET 05-19.pdf file_path = /home/teknipn/documents/agentcompta/processed/2026-08/COEUGNET 05-19_1786246496.pdf file_hash = c8e50ebe764c12f1ee0df1ac65d9965a16ef765ff082fcbc9ed86ccc01d8ff46 file_size = 363403 mime_type = application/pdf doc_type = invoice_supplier confidence = 1.0000 fk_target_id = 0 status = archived error_message = Achat deja comptabilise depuis le registre de l assistante — document conserve aux Archives. extracted_data = {"supplier":{"name":"Cœugnet Matériaux","siret":"50495101300911","vat_number":"FR15929591741","iban":"FR7650003000400030257100232","email":null,"address":"Z.I. du Grand Clos, 14320 SAINT-ANDRÉ-SUR-ORNE"},"invoice":{"ref":"41315","date":"2026-05-31","due_date":"2026-06-30","currency":"EUR","total_ tokens_input = 5387 tokens_output = 1983 api_cost_eur = 0.0378 date_intake = 2026-08-08 22:25:15 date_processed = 2026-08-09 07:33:27 date_validated = 2026-08-09 13:53:48 fk_user_validate = 1 tms = 2026-08-09 13:53:48 === structure log === rowid int entity int date_call datetime operation varchar(50) fk_intake int related_object varchar(50) related_id int model varchar(50) prompt_excerpt text response_excerpt text tokens_input int tokens_output int cost_eur decimal(8,4) duration_ms int status varchar(20) error_message text fk_user int === log 2026-08-10 === rowid=533 | entity=1 | date_call=2026-10-21 17:45:48 | operation=extract_invoice | fk_intake=433 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit le texte OCRisé d'une facture fournisseur française (TVA fran | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "SAS Tekni-pli", "siret": "92959174100012", "vat | tokens_input=14793 | tokens_output=993 | cost_eur=0.0549 | duration_ms=21162 | status=ok | rowid=532 | entity=1 | date_call=2026-10-21 17:45:27 | operation=classify_document | fk_intake=433 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "invoice_supplier", "confidence": 0.98, "reason": "Document contient 3 factures (FA2608-0352, FA | tokens_input=15473 | tokens_output=113 | cost_eur=0.0149 | duration_ms=2942 | status=ok | rowid=531 | entity=1 | date_call=2026-10-21 17:00:31 | operation=extract_purchase_order | fk_intake=432 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit un BON DE COMMANDE fournisseur ou sa confirmation : notre bon d | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "ArcelorMittal Distribution Solutions France", "sire | tokens_input=2589 | tokens_output=763 | cost_eur=0.0178 | duration_ms=15228 | status=ok | rowid=530 | entity=1 | date_call=2026-10-21 17:00:16 | operation=classify_document | fk_intake=432 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "purchase_order", "confidence": 0.98, "reason": "Document intitulé 'Confirmation de commande', | tokens_input=3275 | tokens_output=101 | cost_eur=0.0035 | duration_ms=1940 | status=ok | rowid=529 | entity=1 | date_call=2026-10-21 13:45:41 | operation=match_bank_line | fk_intake=0 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[user] Tu es un expert rapprochement bancaire français. On te donne UNE ligne d'extrait bancaire et une liste de factur | response_excerpt=```json { "best_match": { "target_type": "inconnu", "target_id": 0, "score": 0.35, "reason": "Montant | tokens_input=941 | tokens_output=270 | cost_eur=0.0021 | duration_ms=2986 | status=ok | rowid=528 | entity=1 | date_call=2026-10-21 12:00:19 | operation=classify_document | fk_intake=431 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "other", "confidence": 0.98, "reason": "Document non comptable : photo de chantier avec croquis | tokens_input=2305 | tokens_output=75 | cost_eur=0.0025 | duration_ms=1799 | status=ok | rowid=527 | entity=1 | date_call=2026-10-21 12:00:17 | operation=classify_document | fk_intake=430 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "other", "confidence": 0.98, "reason": "Rapport d'expertise technique bâtiment (AFF22857-2606-P | tokens_input=28393 | tokens_output=74 | cost_eur=0.0266 | duration_ms=2802 | status=ok | rowid=526 | entity=1 | date_call=2026-10-21 12:00:15 | operation=classify_document | fk_intake=429 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "other", "confidence": 0.98, "reason": "Document d'architecture/plans techniques (PCMI) pour pro | tokens_input=9923 | tokens_output=61 | cost_eur=0.0095 | duration_ms=2201 | status=ok | rowid=525 | entity=1 | date_call=2026-10-21 11:15:27 | operation=extract_invoice | fk_intake=428 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit le texte OCRisé d'une facture fournisseur française (TVA fran | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "PARIS FLUIDES SYSTEMES TECHNOLOGIES (Swagelok Paris)", | tokens_input=2459 | tokens_output=920 | cost_eur=0.0196 | duration_ms=17151 | status=ok | rowid=524 | entity=1 | date_call=2026-10-21 11:15:09 | operation=classify_document | fk_intake=428 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "quote_supplier", "confidence": 0.85, "reason": "Facture pro forma de Swagelok Paris avec n° 20 | tokens_input=3139 | tokens_output=90 | cost_eur=0.0033 | duration_ms=2087 | status=ok | rowid=523 | entity=1 | date_call=2026-10-21 08:15:26 | operation=extract_invoice | fk_intake=427 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit le texte OCRisé d'une facture fournisseur française (TVA fran | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "SARL THOMAS S.A.R.L", "siret": "32978887100021", | tokens_input=2213 | tokens_output=926 | cost_eur=0.0190 | duration_ms=17048 | status=ok | rowid=522 | entity=1 | date_call=2026-10-21 08:15:08 | operation=classify_document | fk_intake=427 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "invoice_supplier", "confidence": 0.98, "reason": "Document intitulé 'Facture', numéro F267440 | tokens_input=2891 | tokens_output=112 | cost_eur=0.0032 | duration_ms=2321 | status=ok | rowid=521 | entity=1 | date_call=2026-10-20 19:30:19 | operation=match_bank_line | fk_intake=0 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[user] Tu es un expert rapprochement bancaire français. On te donne UNE ligne d'extrait bancaire et une liste de factur | response_excerpt=```json { "best_match": { "target_type": "facture_fourn", "target_id": 509, "score": 0.78, "reason": " | tokens_input=777 | tokens_output=341 | cost_eur=0.0023 | duration_ms=3797 | status=ok | rowid=520 | entity=1 | date_call=2026-10-20 16:45:43 | operation=extract_invoice | fk_intake=426 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit le texte OCRisé d'une facture fournisseur française (TVA fran | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "SARL THOMAS S.A.R.L", "siret": "32978887100021", | tokens_input=2215 | tokens_output=794 | cost_eur=0.0172 | duration_ms=18404 | status=ok | rowid=519 | entity=1 | date_call=2026-10-20 16:45:25 | operation=classify_document | fk_intake=426 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "invoice_customer", "confidence": 0.98, "reason": "Document émis par SARL THOMAS (notre entrepr | tokens_input=2893 | tokens_output=101 | cost_eur=0.0031 | duration_ms=1930 | status=ok | rowid=518 | entity=1 | date_call=2026-10-20 16:45:23 | operation=extract_invoice | fk_intake=425 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit le texte OCRisé d'une facture fournisseur française (TVA fran | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "SARL THOMAS S.A.R.L", "siret": "32978887100021", | tokens_input=2215 | tokens_output=773 | cost_eur=0.0169 | duration_ms=12913 | status=ok | rowid=517 | entity=1 | date_call=2026-10-20 16:45:10 | operation=classify_document | fk_intake=425 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "invoice_customer", "confidence": 0.98, "reason": "Document émis par SARL THOMAS (notre entrepr | tokens_input=2893 | tokens_output=101 | cost_eur=0.0031 | duration_ms=2191 | status=ok | rowid=516 | entity=1 | date_call=2026-10-20 07:00:22 | operation=match_bank_line | fk_intake=0 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[user] Tu es un expert rapprochement bancaire français. On te donne UNE ligne d'extrait bancaire et une liste de factur | response_excerpt=```json { "best_match": { "target_type": "inconnu", "target_id": null, "score": 0.15, "reason": "Paiem | tokens_input=932 | tokens_output=152 | cost_eur=0.0016 | duration_ms=2297 | status=ok | rowid=515 | entity=1 | date_call=2026-10-20 00:45:10 | operation=classify_document | fk_intake=424 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "other", "confidence": 0.98, "reason": "Mandat de prélèvement SEPA (Direct Débit) - document | tokens_input=2477 | tokens_output=70 | cost_eur=0.0026 | duration_ms=1943 | status=ok | rowid=514 | entity=1 | date_call=2026-10-19 14:15:27 | operation=extract_purchase_order | fk_intake=423 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit un BON DE COMMANDE fournisseur ou sa confirmation : notre bon d | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "ArcelorMittal Distribution Solutions France", "sire | tokens_input=2590 | tokens_output=751 | cost_eur=0.0176 | duration_ms=17356 | status=ok | rowid=513 | entity=1 | date_call=2026-10-19 14:15:10 | operation=classify_document | fk_intake=423 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "purchase_order", "confidence": 0.98, "reason": "Document intitulé 'Confirmation de commande' Ã | tokens_input=3276 | tokens_output=131 | cost_eur=0.0036 | duration_ms=2295 | status=ok | rowid=512 | entity=1 | date_call=2026-10-19 12:00:25 | operation=extract_invoice | fk_intake=422 | model=claude-sonnet-4-6 | prompt_excerpt=[SYS] Tu es un assistant comptable expert. On te fournit le texte OCRisé d'une facture fournisseur française (TVA fran | response_excerpt=```json { "extraction_schema": 2, "supplier": { "name": "SARL THOMAS S.A.R.L", "siret": "32978887100021", | tokens_input=2187 | tokens_output=814 | cost_eur=0.0174 | duration_ms=15754 | status=ok | rowid=511 | entity=1 | date_call=2026-10-19 12:00:10 | operation=classify_document | fk_intake=422 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[SYS] Tu es un classifieur de documents comptables. Tu peux voir le document ci-dessous (PDF/image scanné(e) ou CSV tex | response_excerpt=```json { "type": "invoice_customer", "confidence": 0.95, "reason": "Document intitulé 'Facture' émis par SARL T | tokens_input=2865 | tokens_output=103 | cost_eur=0.0031 | duration_ms=2849 | status=ok | rowid=510 | entity=1 | date_call=2026-10-19 06:15:29 | operation=match_bank_line | fk_intake=0 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[user] Tu es un expert rapprochement bancaire français. On te donne UNE ligne d'extrait bancaire et une liste de factur | response_excerpt=```json { "best_match": { "target_type": "inconnu", "target_id": 0, "score": 0.35, "reason": "Paiement | tokens_input=611 | tokens_output=137 | cost_eur=0.0012 | duration_ms=2039 | status=ok | rowid=509 | entity=1 | date_call=2026-10-17 17:30:17 | operation=match_bank_line | fk_intake=0 | model=claude-haiku-4-5-20251001 | prompt_excerpt=[user] Tu es un expert rapprochement bancaire français. On te donne UNE ligne d'extrait bancaire et une liste de factur | response_excerpt=```json { "best_match": { "target_type": "facture_fourn", "target_id": 536, "score": 0.88, "reason": " | tokens_input=855 | tokens_output=385 | cost_eur=0.0026 | duration_ms=4123 | status=ok | === intake mentionnant SI2607-0126 ou 0004 === aucune