<div class="b2b-panel">
   <div class="container">
      <div class="b2b-panel-inner">
         <div class="b2b-panel-icon">
            <span class="fc icons_user"></span>
            <p>
               {t}B2B klient{/t}
               <strong>
                  {if $ctrl.firm}
                     {$ctrl.firm}
                  {elseif $ctrl.name && $ctrl.surname}
                     {$ctrl.name}&nbsp;{$ctrl.surname}
                  {else}
                     {$ctrl.email}
                  {/if}
               </strong>
            </p>
         </div>
         {block "b2b-panel-stats"}
            {get_znz_user_stats assign='stats'}
            <div class="b2b-panel-icon">
               <span class="fc icons_stats"></span>
               <p>
                  {t}Obrat{/t} {$smarty.now|date_format:"%Y"}
                  <strong>{$stats.Obrat|format_price}</strong>
               </p>
            </div>
            <div class="b2b-panel-icon">
               <span class="fc icons_percentage"></span>
               <p>
                  {t}Průběh slevy z obratu{/t}
                  <strong>{t slevaProcentem=$stats.slevaProcentem}Máte aktivní {slevaProcentem}% slevu{/t}</strong>
               </p>
            </div>
            {if $stats}
               <div class="b2b-discount-line">
                  {$stepPercentage = 100 / ($stats.SlevoveMeze|count - 1)}
                  <p>
                     <span class="progress-line" style="width: {$stats.slevaProcentem}%;"></span>
                     {foreach $stats.SlevoveMeze as $item}
                        <span
                           class="circle circle-{$item@iteration} {if $stats.slevaProcentem >= $stepPercentage * $item@index}completed{/if}">
                           >{$item.Od|format_price}
                           <br>
                           -{$item.Sleva}%
                        </span>
                     {/foreach}
                  </p>
               </div>
            {/if}
         {/block}
         {block 'b2b-panel-menu'}
            <div class="b2b-panel-icon">
               <span class="fc icons_percent"></span>
               <p>
                  {t}Průběh slevy z obratu{/t}
                  <strong>{t slevaProcentem=$stats.slevaProcentem}Máte aktivní {slevaProcentem}% slevu{/t}</strong>
               </p>
            </div>
            {*            <div class="b2b-panel-menu">*}
            {*               <p>{t}Rychlý přístup{/t}</p>*}
            {*               <ul class="list-inline">*}
            {*                  <li><a href="{path('account')}">{t}Můj účet{/t}</a></li>*}
            {*                  <li><a href="{path('orders')}">{t}Moje objednávky{/t}</a></li>*}
            {*                  {ifmodule WATCHDOG}*}
            {*                     <li><a href="{url s=category campaign="W"}">{t}Hlídané zboží{/t}</a></li>*}
            {*                  {/ifmodule}*}
            {*                  <li><a href="{url s=cart}">{t}Import objednávky{/t}</a></li>*}
            {*                  <li class="repeat-order"><a href="{path('orders')}"><span class="fc icons_repeat"></span>{t}Opakovat objednávku{/t}</a>*}
            {*                  </li> *}{* todo *}
            {*                  {block "b2b-panel-menu-additional"}{/block}*}
            {*               </ul>*}
            {*            </div>*}
         {/block}
      </div>
   </div>
</div>
