Hi, I'm just a user and I had this query programmed by a friend and seems to have stop working.

The error message I get says that the error is near the CASE WHEN statement at line 8. Any comments are welcomed and if possible suggestions to correct the error.
Code:
Select vendor,F.airline_code,F.invoice_nmr invoice_vendor,F.booking_nmr,
sum(amount) total_factura  , IF(tipo = 'CH',facturado,pagado) monto_pagado,tipo,
concat(b_month,'-',b_year)
...