{* CSS *} {capture assign="_add_button"} [`Add deal`] {/capture} {* PAGE *}
{if $deals} {foreach $deals as $_deal} {$_stage = ifset($funnels[$_deal.funnel_id].stages[$_deal.stage_id])} {$_now = date('Y-m-d H:i:s')} {/foreach}
{if !empty($_stage.color)} {$_funnel_name = $funnels[$_deal.funnel_id].name|escape} {/if}
{if $_deal.status_id == "WON"} [`WON`] {if !empty($_deal.closed_datetime)}{$_deal.closed_datetime|wa_datetime}{/if} {elseif $_deal.status_id == "LOST"} [`LOST`] {if !empty($_deal.closed_datetime)}{$_deal.closed_datetime|wa_datetime}{/if} {else} {$_stage.name|escape} {/if}
{waDateTime::format('shortdate', strtotime($_deal.create_datetime))}
{if !$_deal.closed_datetime} {if empty($_deal.reminder_datetime)} {else} {/if} {/if}
{if $_deal.amount} {$_deal.amount|wa_format_amount_currency:$_deal.currency_id} {else} — {/if}
{if $_deal.user_contact_id} {$_user_photo = $_deal.user_contact->getPhoto(32)} {if !empty($_user_photo)} {/if} {$_deal.user_contact.name|escape} {* $_deal.user_contact.name_status *} {/if}
{if $available_funnel}

{$_add_button}

{/if} {else}
[`No deals`]
{if $available_funnel}

{$_add_button}

{/if}
{/if} {if !$wa->user()->isAdmin('crm')}

[`Some deals may not show due to access rights restrictions.`]

{/if}