You seem to want the sum of the stock after "stock taking", which I suspect is more normally called "doing inventory" in English.
select Firm, PartId, sum(StockCount) as StockCount, NULL as Date, NULL as Type
from table t
where Date >= (select max(Date)
from table t2
where t2.Firm = t.Firm and
t2.partid = t.partid and
t2.type = 'Stocktaking'
)
group by Firm, Partid;
If there may be no Stocktaking record, then go with a left join
approach:
select Firm, PartId, sum(StockCount) as StockCount, NULL as Date, NULL as Type
from table t left join
(select Firm, PartId, max(Date) as maxDate
from table t
where t2.type = 'Stocktaking'
group by Firm, PartId
) as tfp
on t.Firm = tfp.Firm and t.PartId = tfp.PartId and t.Date >= tfp.MaxDate
group by t.Firm, t.PartId;