To query a Gift Total, use the field Invoice Detail Summary Information (ivd_summary)::Net Total as shown below. This is the same field as the Gift Amount that is viewable on a gift. This field takes into account cancellations and returns.
In SQL Server, the equivalent query is shown in the following code fragment:
SELECT[gift_amount]= ISNULL( ivd_summary.net_net_total ,0)
FROM dbo.np_gift WITH(nolock)
LEFTJOIN dbo.vw_ac_invoice_detail ivd_summary WITH(NOLOCK)
ON gft_ivd_key = ivd_summary.net_ivd_key