SELECT 
SUM(IFNULL(prt.montantApayer,0)) AS apresDecompte
FROM p_prestationactes prt INNER JOIN p_facture B ON (B.id=prt.idfacture)
INNER JOIN police C ON  (B.idPolice = C.id)
INNER JOIN gc_assureur G ON  (C.codeGcAssureur = G.codeGcAssureur)
INNER JOIN beneficiaireage_temp f ON (f.id=prt.idBeneficiaire )		
WHERE (LEFT(B.dateSysteme,10) BETWEEN '2022-01-01' AND '2022-03-31' )
AND G.id!='45' AND C.idClient!='49' AND (B.codeSociete="vitalis")
AND G.codeGcAssureur='GNA'  AND B.idPolice=168
AND B.codePrestataire NOT IN ('CE0416','PR1176','CE1215','CE1232','PR1175')

SELECT A.*
FROM p_reglement A
JOIN p_facture B ON (B.`numeroDecompte` = A.numeroDecompte)
AND B.`numeroDecompte`=423



SELECT *
FROM p_facture
WHERE montantApayer=43300

SELECT  *
FROM p_prestationactes
WHERE codePrestataire='CE0021'