The SQL query was not gathering the correct data from the
acq.lineitem_detail and acq.lineitem tables. We needed to add
acq.cancel_reason to the query and test for the presence of no cancel
reasons or the presence of cancel reasons with
acq.cancel_reason.fund_debits of true because we do not want to mark a
lineitem as canceled if it has a cancel reason with fund_debits on it.