SELECT SUM("bill_details"."quantity") AS sum_id FROM "bill_details" WHERE (reference_1 = $1 and narration ilike $2)