Before you get to spending money on this ...
1 the tmp table generated by your query has 23M rows, the table rowcounts are 350K and 800, ie there are 280M possible combinations so your join hits about 8% of all possible row combinations from the two tables, does that sound about right?
2 Let's see the actual result of ...
EXPLAIN select
w.weekend,
d2.code as family,
sum(ifnull(d2.amount, 0)) as owing
from weekendings w
join dr02 d2 on (w.weekend >= d2.date and d2.t1 <> "g")
or (w.weekend >= d2.weekend and d2.t1 = "g")
group by w.weekend, d2.code;
... and of ...
EXPLAIN select weekend, family, sum(amount) as owing
from (
select w.weekend, d2.code as family, d2.amount
from weekendings w
join dr02 d2 on (w.weekend >= d2.date and d2.t1 <> "g")
or (w.weekend >= d2.weekend and d2.t1 = "g")
where d2.code = "smi1" and d2.amount is not null
) x
group by weekend, family
order by weekend, family;
3 What proportion of dr02.amount values are null?