===== 1. Preuve auditeur : SUM(b.amount+p.amount) ===== SELECT ROUND(SUM(b.amount+p.amount),2) AS somme_ecart, COUNT(*) AS nb FROM llx_paiementfourn p JOIN llx_bank b ON b.rowid=p.fk_bank WHERE p.entity=1 ----- somme_ecart=-0.03 | nb=204 (1 lignes) ===== 2b. (ignorer) ===== SELECT ROUND(SUM(b.amount),2) AS somme_bank, COUNT(*) AS nb FROM llx_bank b JOIN llx_bank_account ba ON ba.rowid=b.fk_account WHERE ba.entity=1 AND b.fk_type='PRE' ----- somme_bank=-44622.81 | nb=89 (1 lignes) ===== 2c. (ignorer) ===== SELECT b.label AS typ, ROUND(SUM(b.amount),2) AS s, COUNT(*) AS n FROM llx_bank b WHERE b.label LIKE '%payment_supplier%' GROUP BY b.label ----- (0 lignes) ===== 2. Somme lignes de banque type payment_supplier (via bank_url) ===== SELECT ROUND(SUM(b.amount),2) AS somme_bank_ps, COUNT(*) AS nb FROM llx_bank b JOIN llx_bank_url u ON u.fk_bank=b.rowid AND u.type='payment_supplier' ----- somme_bank_ps=-265115.9 | nb=204 (1 lignes) ===== 3. Somme llx_paiementfourn entity=1 ===== SELECT ROUND(SUM(p.amount),2) AS somme_paiementfourn, COUNT(*) AS nb FROM llx_paiementfourn p WHERE p.entity=1 ----- somme_paiementfourn=265115.87 | nb=204 (1 lignes) ===== 4. Detail des divergences (>0,005) ===== SELECT p.rowid AS p_rowid, p.ref AS p_ref, p.datep, p.amount AS p_amount, b.rowid AS b_rowid, b.amount AS b_amount, b.label AS b_label, b.dateo, b.rappro, b.num_releve FROM llx_paiementfourn p JOIN llx_bank b ON b.rowid=p.fk_bank WHERE p.entity=1 AND ABS(b.amount+p.amount)>0.005 ORDER BY p.rowid ----- p_rowid=59 | p_ref=SPAY2601-0014 | datep=2026-01-06 00:00:00 | p_amount=133.93000000 | b_rowid=173 | b_amount=-133.94000000 | b_label=(AgentCompta) PAIEMENT PAR CARTE X4074 AMAZON PAYMENTS PAYL 05/01 | dateo=2026-01-06 | rappro=1 | num_releve=202601 p_rowid=65 | p_ref=SPAY2601-0020 | datep=2026-01-30 00:00:00 | p_amount=107.24000000 | b_rowid=179 | b_amount=-107.25000000 | b_label=(AgentCompta) PAIEMENT PAR CARTE X4074 AMAZON BUSINESS PAYL 29/01 | dateo=2026-01-30 | rappro=1 | num_releve=202601 p_rowid=77 | p_ref=SPAY2605-0032 | datep=2026-05-04 00:00:00 | p_amount=13.99000000 | b_rowid=191 | b_amount=-14.00000000 | b_label=(AgentCompta) PAIEMENT PAR CARTE X4074 AMAZON PAYMENTS PAYL 02/05 | dateo=2026-05-04 | rappro=1 | num_releve=202605 (3 lignes) ===== 5. Factures rattachees aux paiements 59/65/77 ===== SELECT pf.fk_paiementfourn, pf.fk_facturefourn, pf.amount AS montant_ventile, f.rowid AS f_rowid, f.ref, f.ref_supplier, f.total_ttc, f.total_ht, f.tva, f.datef, f.paye, f.fk_statut, s.nom AS fournisseur FROM llx_paiementfourn_facturefourn pf JOIN llx_facture_fourn f ON f.rowid=pf.fk_facturefourn JOIN llx_societe s ON s.rowid=f.fk_soc WHERE pf.fk_paiementfourn IN (59,65,77) ----- fk_paiementfourn=59 | fk_facturefourn=120 | montant_ventile=133.93000000 | f_rowid=120 | ref=SI2601-0034 | ref_supplier=FR6GNUABEI | total_ttc=133.93000000 | total_ht=111.61000000 | tva=0.00000000 | datef=2026-01-05 | paye=1 | fk_statut=2 | fournisseur=Amazon Business EU S.à.r.l, Succursale Française fk_paiementfourn=65 | fk_facturefourn=181 | montant_ventile=107.24000000 | f_rowid=181 | ref=SI2601-0042 | ref_supplier=01/11 | total_ttc=107.24000000 | total_ht=89.37000000 | tva=0.00000000 | datef=2026-01-29 | paye=1 | fk_statut=2 | fournisseur=Amazon Business EU S.à.r.l, Succursale Française fk_paiementfourn=77 | fk_facturefourn=185 | montant_ventile=13.99000000 | f_rowid=185 | ref=SI2605-0046 | ref_supplier=05/08 | total_ttc=13.99000000 | total_ht=11.66000000 | tva=0.00000000 | datef=2026-05-03 | paye=1 | fk_statut=2 | fournisseur=Amazon Business EU S.à.r.l, Succursale Française (3 lignes) ===== 6. Factures 120/181/185 ===== SELECT f.rowid, f.ref, f.ref_supplier, f.total_ht, f.tva, f.total_ttc, f.datef, f.paye, f.fk_statut, s.nom FROM llx_facture_fourn f JOIN llx_societe s ON s.rowid=f.fk_soc WHERE f.rowid IN (120,181,185) ----- rowid=120 | ref=SI2601-0034 | ref_supplier=FR6GNUABEI | total_ht=111.61000000 | tva=0.00000000 | total_ttc=133.93000000 | datef=2026-01-05 | paye=1 | fk_statut=2 | nom=Amazon Business EU S.à.r.l, Succursale Française rowid=181 | ref=SI2601-0042 | ref_supplier=01/11 | total_ht=89.37000000 | tva=0.00000000 | total_ttc=107.24000000 | datef=2026-01-29 | paye=1 | fk_statut=2 | nom=Amazon Business EU S.à.r.l, Succursale Française rowid=185 | ref=SI2605-0046 | ref_supplier=05/08 | total_ht=11.66000000 | tva=0.00000000 | total_ttc=13.99000000 | datef=2026-05-03 | paye=1 | fk_statut=2 | nom=Amazon Business EU S.à.r.l, Succursale Française (3 lignes) ===== 7. Nb factures par paiement ===== SELECT fk_paiementfourn, COUNT(*) AS nb_factures, ROUND(SUM(amount),2) AS total_ventile FROM llx_paiementfourn_facturefourn WHERE fk_paiementfourn IN (59,65,77) GROUP BY fk_paiementfourn ----- fk_paiementfourn=59 | nb_factures=1 | total_ventile=133.93 fk_paiementfourn=65 | nb_factures=1 | total_ventile=107.24 fk_paiementfourn=77 | nb_factures=1 | total_ventile=13.99 (3 lignes) ===== 8. bank_url pour paiements 59/65/77 ===== SELECT u.fk_bank, u.type, u.url_id, b.amount, b.label, b.dateo FROM llx_bank_url u JOIN llx_bank b ON b.rowid=u.fk_bank WHERE u.type='payment_supplier' AND u.url_id IN (59,65,77) ----- fk_bank=173 | type=payment_supplier | url_id=59 | amount=-133.94000000 | label=(AgentCompta) PAIEMENT PAR CARTE X4074 AMAZON PAYMENTS PAYL 05/01 | dateo=2026-01-06 fk_bank=179 | type=payment_supplier | url_id=65 | amount=-107.25000000 | label=(AgentCompta) PAIEMENT PAR CARTE X4074 AMAZON BUSINESS PAYL 29/01 | dateo=2026-01-30 fk_bank=191 | type=payment_supplier | url_id=77 | amount=-14.00000000 | label=(AgentCompta) PAIEMENT PAR CARTE X4074 AMAZON PAYMENTS PAYL 02/05 | dateo=2026-05-04 (3 lignes) ===== 9. Paiements fourn sans ligne de banque ===== SELECT COUNT(*) AS nb_sans_bank FROM llx_paiementfourn p WHERE p.entity=1 AND (p.fk_bank IS NULL OR p.fk_bank=0) ----- nb_sans_bank=0 (1 lignes) ===== 10. Nb total paiementfourn ===== SELECT COUNT(*) AS nb_total FROM llx_paiementfourn WHERE entity=1 ----- nb_total=204 (1 lignes)