The data on the screen in the Summary tab for sure is calc'd when the tab itself is clicked and most of it coming from AR_CustomerSalesHistory. I researched this doing a non-scripting project awhile back where they wanted the Sales, Cogs, Profit % for PTD, YTD, PYD (all 9 calculated every X minutes and stored into 9 Customer UDFs which was then added to a Customer lookup)
With scripting presumably you could grab AR_CustomerSalesHistory_bus, do the SetKeyValue's for the 4 key columns, then do a Find() with nothing in the parentheses. If the retVal on your Find is 1 you're in business.
For YTD Sales the trick is to increment the DollarsSold while looping the FiscalPeriod from the Period 01 to the current period.