partially implementing credit_memo for queries