<div id="flapB2B" class="tab-pane fade in boxFlex">

      <div class="form-group form-group-flex">
         <div class="col-md-3 control-label">
            <label>{'redefineForB2B'|translate:'currenciesWindowTab'}</label>
         </div>
         <div class="col-md-4">
            <div class="input-group">
               {if $body.data.data.b2b.price_round_direction}
                  {$enabled = true}
               {else}
                  {$enabled = false}
               {/if}
               {print_toggle name="dummy" value=$enabled attrs=' data-currencies-b2b-toggle '}
            </div>
         </div>
      </div>

   <div id="b2b-container">
      <div class="row bottom-space">
         <div class="col-md-12">
            <h1 class="h4 main-panel-title">{'PricesOfGoods'|translate}</h1>
         </div>
      </div>

      <div class="row">
         <div class="col-md-6">
            <div class="form-group">
               <div class="col-md-6 control-label"><label>{'price_round_direction'|translate}</label></div>
               <div class="col-md-6">
                  <select name="data[data][b2b][price_round_direction]" class="selecter">
                     {foreach from=$body.directions item=direction key=key}
                        <option value="{$key}" {if $key==$body.data.data.b2b.price_round_direction}selected{/if}>{$direction}</option>
                     {/foreach}
                  </select>
               </div>
            </div>

            <div class="form-group form-group-flex">
               <div class="col-md-6 control-label"><label>{'price_round'|translate}</label></div>
               <div class="col-md-6">
                  <select name="data[data][b2b][price_round]" class="selecter">
                     {foreach from=$body.rounds item=round key=key}
                        <option value="{$key}" {if $key==$body.data.data.b2b.price_round}selected{/if}>{$round}</option>
                     {/foreach}
                  </select>
               </div>
            </div>

            <div class="form-group form-group-flex">
               <div class="col-md-6 control-label"><label>{'price_round_order'|translate}</label></div>
               <div class="col-md-6">
                  <select name="data[data][b2b][price_round_order]" class="selecter">
                     {foreach from=$body.rounds item=round key=key}
                        <option value="{$key}" {if $key==$body.data.data.b2b.price_round_order}selected{/if}>{$round}</option>
                     {/foreach}
                  </select>
               </div>
            </div>
         </div>

         <div class="col-md-6">
            <div class="form-group form-group-flex">
               <div class="col-md-6 control-label"><label>{'price_decimal_mark'|translate}</label></div>
               <div class="col-md-6">
                  <select name="data[data][b2b][price_decimal_mark]" class="selecter">
                     {foreach from=$body.mark item=mark key=key}
                        <option value="{$key}" {if $key==$body.data.data.b2b.price_decimal_mark}selected{/if}>{$mark}</option>
                     {/foreach}
                  </select>
               </div>
            </div>



            <div class="form-group">
               <div class="col-md-6 control-label"><label>{'price_precision'|translate}</label></div>
               <div class="col-md-6">
                  <select name="data[data][b2b][price_precision]" class="selecter">
                     {foreach from=$body.precisions item=precision key=key}
                        <option value="{$key}" {if $key==$body.data.data.b2b.price_precision}selected{/if}>{$precision}</option>
                     {/foreach}
                  </select>
               </div>
            </div>

            <div class="form-group">
               <div class="col-md-6 control-label"><label>Baťovské ceny</label></div>
               <div class="col-md-6">
                  <select name="data[data][b2b][bata]" class="selecter">
                     <option value="">ne</option>
                     <option value="1" {if $body.data.data.b2b.bata == 1}selected{/if}>9,-</option>
                     <option value="0.1" {if $body.data.data.b2b.bata == 0.1}selected{/if}>9,90</option>
                     <option value="0.01" {if $body.data.data.b2b.bata == 0.01}selected{/if}>9,99</option>
                  </select>
               </div>
            </div>

         </div>
      </div>
   </div>
</div>

<script>
   $('[data-currencies-b2b-toggle]').on('change', function() {
      if ($(this).prop('checked')) {
         $('#b2b-container').fadeIn().find('input, select').removeAttr('disabled').trigger('chosen:updated');
      } else {
         $('#b2b-container').fadeOut().find('input, select').attr('disabled', true);
      }
   });
   if ($('[data-currencies-b2b-toggle]').prop('checked')) {
      $('#b2b-container').show().find('input, select').removeAttr('disabled');
   } else {
      $('#b2b-container').hide().find('input, select').attr('disabled', true);
   }
</script>
