я бы просто поменял r.amount на ri.real_amount(сумма позиции со всеми скидками) или на ri.total(без скидок)
ну и немного правок от себя
т.е.:
Код:
select c.classifclient,r.client,r.type,sum(ri.real_amount) _sum,sum(rd.increment) _inc
from receipt r -- логичней идти от чека
left join receipt_item ri on r.id=ri.receipt_header and r.cash_id=ri.cash_id
left join receipt_item_discount rd on rd.receipt_item=ri.id and rd.cash_id=ri.cash_id
inner join clients c on c.id=r.client -- клиент в чеке может быть только один
where r.date between '2015-10-15 00:00:00' AND '2015-10-15 23:59:59' -- дата-время итак в таком формате
and ri.classif not like '.51%'
and r.client is not null
and r.type in (0,1,4)
and r.result=0
group by c.classifclient,r.client,r.type;