Voici la requête (qui est formatée par rapport à nos exports vers Ciel compta...).
Il "suffit" de modifier la période en fin de requête par rapport à la période que vous souhaitez interroger.
Si une personne d'Openflyers peut tout de même valider/compléter... c'est "home made" !
Cordialement,
Emmanuel
SELECT
account_entry.flow_id as NUM_ECRITURE,
DATE_FORMAT(account_date,'%Y%m%d') as DATE_COMPTA,
account.export_account as CODE_COMPTE,
account.name as LIBELLE_COMPTE,
debit as DEBIT, credit as CREDIT,
LPAD(IF(credit = 0, debit, credit),13,"0"
as MONTANT,
IF(credit = 0,"D","C"
as DEBIT_CREDIT,
aircraft.callsign as AVION,
flight.comments as VOL_COMMENTAIRE,
authentication.first_name as PILOT_PRENOM, authentication.last_name as PILOT_NOM,
account_entry.payment_description as PAIEMENT_DESCRIPTION,
account_entry.comments as PAIEMENT_COMMENTAIRE
FROM
account,
account_entry LEFT JOIN flight_account_entry ON account_entry.flow_id = flight_account_entry.account_entry_id LEFT JOIN flight ON flight_account_entry.flight_id = flight.id LEFT JOIN aircraft ON flight.aircraft_id = aircraft.id LEFT JOIN flight_pilot ON flight_pilot.flight_id = flight.id LEFT JOIN authentication ON flight_pilot.pilot_id = authentication.id
WHERE
account.id = account_entry.account_id
AND account_entry.account_date >= '2010-08-01'
AND account_entry.account_date <= '2010-08-31'
AND (flight_pilot.function_id <> 3 OR flight_pilot.function_id IS NULL)
ORDER BY
flow_id, DEBIT_CREDIT desc