{block "filter-status"}
   <li class="with_caret "><a href="#" class="opener"><span>{'filterStatus'|translate:"orders"}</span></a></li>
   <li class="pill-content hidden">
      <div class="nav-sub nav-pills">
         <ul>
            {if isset($cfg.Order.Status.global)}
               {foreach from=$cfg.Order.Status.global item=value key=key}
                  <li><a target="mainFrame" href="launch.php?s=list.php&amp;type={$type}&amp;status={$key}&statusStorno=0">
                        {$value} {$orders[$key]}
                     </a></li>
               {/foreach}
            {/if}
            {if $cfg.Order.Status.storno.1}
               <li><a target="mainFrame" href="launch.php?s=list.php&amp;type={$type}&amp;statusStorno=1">
                     {$cfg.Order.Status.storno.1}
                  </a></li>
            {/if}
         </ul>
      </div>
   </li>
{/block}

{if !empty($cfg.Order.Flags)}
   <li class="with_caret "><a href="#" class="opener"><span>{'filterSign'|translate:"orders"}</span></a></li>
   <li class="pill-content hidden">
      <div class="nav-sub nav-pills">
         <ul>
            {if !empty($cfg.Order.Flags)}
               {foreach from=$cfg.Order.Flags item=flag key=key}
                  <li><a onmousedown="_XP_selectItem(event);" target="mainFrame"
                         href="launch.php?s=list.php&amp;type={$type}&amp;flags={$key}&amp;onlyActive=1">
                        {$flag.name} ({$flags[$key]})
                     </a></li>
               {/foreach}
            {/if}
         </ul>
      </div>
   </li>
{/if}
<li class="nav-header smaller"><i class="glyphicon glyphicon-search"></i><span>{'search'|translate:"orders"}</span></li>

<li class="pill-content always-visible">
   <ul class="nav-sub nav-pills">
      <form target="mainFrame" method="get" action="launch.php" class="form-inline">
      {block "search-basic"}
         <div class="form-group">
            <div class="input-group invert">
               <input type="text" class="form-control input-sm disable-spinner" name="idCode" value=""
                      placeholder="{'searchCodeOrId'|translate:"orders"}">
               {inversion field="idCode"}
            </div>
         </div>

         {ifmodule INVOICES}
            <div class="form-group">
               <div class="input-group invert">
                  <input type="text" class="form-control input-sm disable-spinner" name="invoiceNo" value=""
                         placeholder="{'searchInvoiceNo'|translate:"orders"}">
                  {inversion field="invoiceNo"}
               </div>
            </div>
         {/ifmodule}

         {ifmodule DROPSHIP}
            <div class="form-group">
               <div class="input-group invert">
                  <input type="text" class="form-control input-sm disable-spinner" name="dropshipExternalId" value=""
                         placeholder="{'searchDropshipExternalId'|translate:"orders"}">
                  {inversion field="dropshipExternalId"}
               </div>
            </div>
         {/ifmodule}

         <div class="form-group">
            <div class="input-group invert">
               <input type="text" class="form-control input-sm" name="customer" value=""
                      placeholder="{'customer'|translate:"orders"}"/>
               {inversion field="customer"}
            </div>
         </div>

         {block "search-basic-additional"}{/block}

         {block "search-only-active"}
            <div class="form-group">
               <div class="checkbox">
                  <input type="checkbox" class="input" name="onlyActive" value="1" {block "search-only-active-checked"}checked="checked"{/block} id="onlyActive">
                  <label for="onlyActive">{'openOnly'|translate:"orders"}</label>
                  <span class="help-tip" data-toggle="tooltip" title="" data-original-title="{'onlyActiveTooltip'|translate:'orders'}" style="position: relative; right: 0"><i class="bi bi-question-circle"></i></span>
               </div>
            </div>
         {/block}

         <script type="application/javascript">
            $('input[name=idCode], input[name=code], input[name=customer]').keypress(function (e) {
               if (e.key == "Enter") {
                  var $this = $(this),
                     url = 'launch.php?s=list.php&type={$type}&' + $this.attr('name') + '=' + $this.val();
                  if ($this.attr('name') == 'customer')
                     url += '&onlyActive=' + ($('input[name=onlyActive]').prop('checked') ? 1 : 0);
                  nf(null, url);
                  return false;
               }
            });
         </script>
         {/block}
         {block "search-extended"}

         {include "./orderListFilter.extendedFilter.tpl" prefix=""}

         <div class="form-group">
            <div class="input-group invert">
               <input type="text" class="form-control input-sm" name="ico_dic" value=""
                      placeholder="{'searchICO'|translate:'users'}"/>
               {inversion field="ico_dic"}
            </div>
         </div>
         <div class="form-group">
            <div class="input-group invert">
               <input type="text" class="form-control input-sm" name="phone" value=""
                      placeholder="{'phone'|translate:'users'}"/>
               {inversion field="phone"}
            </div>
         </div>
         {ifmodule BALIKONOS}
            <div class="form-group">
               <input type="text" class="form-control input-sm" name="package_id" maxlength="15" value=""
                      placeholder="{'packageId'|translate:"orders"}"/>
            </div>
         {/ifmodule}

         {ifModule PRODUCERS}
            <div class="form-group">
               <div class="input-group invert">
                  <select data-autocomplete="producer" id="producer" name="producer[]" multiple="multiple" data-type="producers"
                          class="selecter selecter-ajax"
                          data-placeholder="Vyberte výrobce"></select>
                  {inversion field="producer"}
               </div>
            </div>
         {/ifModule}

         {ifmodule NEW_POS}
            <div class="form-group">
               <div class="input-group invert">
                  <select data-autocomplete="pos" id="pos" name="pos[]" multiple="multiple" data-type="pos" class="selecter selecter-ajax"
                          data-placeholder="Vyberte pokladnu"></select>
                  {inversion field="pos"}
               </div>
            </div>
         {/ifmodule}

         {ifmodule PRODUCTS_BATCHES}
            <div class="form-group">
               <div class="input-group invert">
                  <input type="text" class="form-control input-sm disable-spinner" name="batch" value=""
                         placeholder="{'batch'|translate:'ordersFilter'}">
                  {inversion field="batch"}
               </div>
            </div>
         {/ifmodule}

         {if $module.ORDER_DISCOUNT}
            <div class="form-group">
               <div class="input-group invert">
                  <select data-autocomplete="order_discount" name="order_discounts[]" multiple='multiple' class="selecter"
                          id="order_discount" data-preload="order_discount" data-placeholder="{'orderDiscountId'|translate:"orders"}">
                  </select>
                  {inversion field="order_discount"}
               </div>
            </div>
         {/if}

         {ifmodule PRODUCTS__WEIGHT}
            <div class="input-group">
               <input type="text" class="form-control input-sm" name="weightFrom" id="weightFrom" value=""
                      placeholder="{'weightFrom'|translate:"orders"}"/>
               <span class="input-group-btn"></span>
               <input type="text" class="form-control input-sm" name="weightTo" id="weightFrom" value=""
                      placeholder="{'weightTo'|translate:"orders"}"/>
               <span class="input-group-addon">kg</span>
            </div>
         {/ifmodule}

         {block "custom-extended-search"}
         {/block}

         {ifmodule ORDER_EDIT}
            <input type="hidden" name="hide_edited" value="1">
         {/ifmodule}

      {/block}
      <div class="form-group">
         <input type="reset" id="resetBtn" value="{'delete'|translate:"orders"}" class="btn btn-danger btn-sm"/>
         <input type="submit" value="{'searchBtn'|translate:"orders"}" class="btn btn-primary btn-sm"/>
         <input type="hidden" name="s" value="list.php">
         <input type="hidden" name="type" value="{$type}"/>
      </div>
      </form>
   </ul>
</li>
<li><a href="launch.php?s=list.php&amp;type={$type}&amp;multipleOrder=1" target="mainFrame"><span>{'multipleOrders'|translate:"orders"}</span></a>
</li>
<li><a href="launch.php?s=list.php&amp;type={$type}&amp;order=5d&amp;dateFrom={$dateToday}&amp;dateTo={$dateToday}"
       target="mainFrame"><span>{'todayOrders'|translate:"orders"}</span></a></li>
