	SELECT
		B.id AS idFacture,
		B.dateSysteme AS dateFacture,
		pm.codePrestatairePrescription AS codePrescripteur,
		fn_libelle_prestataire(pm.codePrestatairePrescription) AS Prescripteur,
		B.codePrestataire AS codePrestataireExecutant,
		fn_libelle_prestataire(B.codePrestataire) AS Exécutant,
		pm.codeMedecin,
		B.idBeneficiaire,
		pm.numeroFeuilleMaladie,
		pm.numeroBonOrdonnance,
		pm.numeroPrescription,
		f.codeAffection,af.libelle AS affection, 		
		m.codeForme,
		m.codeMedicament,
		m.CIP1,
		m.libelle,L.libelle AS localitePrestataire,
		IFNULL(pm.valeurActeManuel,0) AS tarifMedicament,
		IFNULL(pm.quantite,0) AS quantite,
		IFNULL(pm.fraisReel,0) AS fraisReel,
		IFNULL(pm.montantTm,0) AS montantTm,
		IFNULL(pm.fraisExclu,0) AS fraisExclu,
		IFNULL(pm.montantArembourser,0) AS montantArembourser
	FROM p_prestationactes prt 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 adherent a ON ((C.id=a.idPolice) AND (C.codeSociete=a.codeSociete) AND ( a.id=B.idAdherent))
	INNER JOIN beneficiaire e ON (e.id=prt.idBeneficiaire)
	INNER JOIN prestataire pr ON (B.codePrestataire=pr.codePrestataire)
	INNER JOIN p_prestationmedicaments pm ON (pm.idPrestationactes = prt.id)
	INNER JOIN p_medicament m ON (pm.codeMedicament= m.codeMedicament)
	LEFT JOIN p_feuillemaladie f ON (f.numeroFeuilleMaladie =B.numeroFeuilleMaladie )
	LEFT JOIN `p_affection` af ON (f.codeAffection =af.codeAffection )
	LEFT JOIN localite AS L ON (L.codeLocalite = pr.codeLocalite)
	WHERE f.numeroBonOrdonnance IN (77735,72578)