A project can have many reports/estimates with version numbers.
I need to output projects only if the project have both an estimate & a report attached.
I use this summary template to output, and it works as expected except it's very very slow. There is only 30 projects in LISEProjects (and >200 reports/estimates), but it takes nearly 10 seconds to load:
Code: Select all
{if $items|@count > 0}{strip}
{foreach from=$items item=item name=data}
{* FIND LATEST REVISION & GET ID *}
{LISEReports xs_project = $item->item_id xs_type = 'Estimate' xs_scenario = 'Lift' pagelimit='1' orderby='custom_revision|DESC' template_summary='get_id' assign='estimate'}
{LISEReports xs_project = $item->item_id xs_type = 'Report' xs_scenario = 'Lift' pagelimit='1' orderby='custom_revision|DESC' template_summary='get_id' assign='report'}
{* OUTPUT ONLY IF ESTIMATE & REPORT IS PRESENT *}
{if !empty($estimate) && !empty($report)}
DISPLAY PROJECT DATA.
{/if}
{/foreach}
{/strip}{/if}