SELECT * FROM prestataire
WHERE codePrestataire='PR0533'

-- 0 -- EXISTANCE INFORMATION
SELECT * FROM p_facture
WHERE codePrestataire='PR0533'
AND (LEFT(dateSysteme,10) BETWEEN '2022-04-01' AND '2022-04-30' )


-- 1 -- RECHERCHE INFOS A REJETER
SELECT 
		B.valide AS Bvalide,B.okDecompte AS BokDecompte, 
		P.valide AS Pvalide,B.* 
FROM   p_facture B
INNER JOIN p_prestationactes P ON (B.id=P.idFacture)
WHERE (LEFT(B.dateSysteme,10) BETWEEN '2022-04-01' AND '2022-04-30' )
AND B.valide=0
AND B.montantApayer!=0
AND (B.tiersPayant="1") 
AND B.dateTransmission IS NULL
AND B.codePrestataire='PR0533'

-- 2-- rejet de la facture
CALL `sp_perso_rejetFacture_rp`('PR0533','2022-04-01','2022-04-30')