The table I had trouble with was accountingperiod I needed accountingperiodfiscalcalendars to get the query to run. My query is different to the link but I used it as a starting point.
SELECT A.fullname AS AccountName, A.acctnumber AS AccountNumber,
CD.entityid AS CostCentre,
SUM(-TAL.amount) as GLAmount
FROM transactionaccountingline TAL
LEFT JOIN transaction T ON T.id = TAL.transaction
LEFT JOIN account A ON TAL.account = A.id
LEFT JOIN transactionline TL ON TL.transaction = TAL.transaction
LEFT JOIN accountingperiodfiscalcalendars AP ON T.postingperiod = AP.accountingperiod
LEFT JOIN job CD ON TL.entity = CD.id
LEFT JOIN subsidiary S ON S.id = TL.subsidiary
WHERE TL.subsidiary = 2
AND TAL.posting = 'T'
AND AP.accountingperiod = 147
AND TL.id = TAL.TransactionLine
group by A.fullname, A.acctnumber, CD.entityid
order by A.acctnumber