Use the standardized approach in order to get the invoicename.
You can look at the form of ledgerjournaltrans, how its getting populated with the cumulative of amount from that settlement form
Just try to debug the VendOpentrans and related class, putting debugger in ledgerjournaltrans > Update will let you know when, what & from where it is fetching the record when you select the mark…just try you would get it!!
while select s
where s.SpecRecId == 10736794008173252
{
select firstonly vp
where vp.RecId == s.RefRecId;
if (vp)
{
select firstonly v
where v.RecId == vp.RefRecId;
if (v)
{
info(v.Invoice);
}
}
}