SELECT "bills".* FROM "bills" WHERE (date(bill_date) >= $1 and date(bill_date) <= $2) AND (narration != $3) AND (is_discount_approved = $4) AND (bills.location_id = $5)