<commit_before>= content_for(:heading_toolbar) do
  .financial-year-title{ class: "#{resource.state}-financial-year"}
    %h2= resource.state.t(scope: 'enumerize.financial_year.state')

- main_toolbar do |t|
  - unless resource.closing?
    = t.edit resource unless resource.closure_in_preparation? && @closer != current_user
    = t.compute_balances resource, method: :post
  = t.new(label: :new_financial_year_exchange.tl, params: { controller: :financial_year_exchanges, financial_year_id: resource.id }) if resource.can_create_exchange?
  - if resource == FinancialYear.closable_or_lockable && !resource.closure_in_preparation?
    = link_to :prepare_financial_year_for_closure.tl(code: resource.code), { controller: :financial_year_closure_preparations, action: :create, financial_year_id: resource.id, redirect: backend_financial_year_path(resource) }, { class: 'btn btn-default no-icn', method: :post }
    = t.lock resource, label: :lock_financial_year.tl(code: resource.name), icon: false
  - if resource.closure_in_preparation? && @closer == current_user
    = link_to :quit_financial_year_closure_preparation.tl(code: resource.code), { controller: :financial_year_closure_preparations, action: :destroy, financial_year_id: resource.id, redirect: backend_financial_year_path(resource) }, { class: 'btn btn-default no-icn', method: :delete }
    = t.close resource, label: :close_financial_year.tl(code: resource.name), icon: false
    = t.lock resource, label: :lock_financial_year.tl(code: resource.name), icon: false
  - style = resource.closing? ? 'disabled-btn' : ''
  = dropdown_menu_button(:export_fec.ta, { icon: :download, class: style }) do |d|
    - export_params = params.slice(:id)
    - %i[all ba_bnc_ir_commercial_accountancy ba_ir_cash_accountancy bnc_ir_cash_accountancy].each do |position|
      - d.item "export_fec_#{position}".tl, action: :show, fiscal_position: position, format: :xml

= main_informations attachment: true do
  = infos do
    .med-info.important
      %span.title= :year_start.tl
      %span.value= resource.started_on.l

    .med-info.important
      %span.title= :year_end.tl
      %span.value= resource.stopped_on.l

    .med-info.important<commit_msg>A new financial year exchange can only be created if the financial year is opened<commit_after>= content_for(:heading_toolbar) do
  .financial-year-title{ class: "#{resource.state}-financial-year"}
    %h2= resource.state.t(scope: 'enumerize.financial_year.state')

- main_toolbar do |t|
  - unless resource.closing?
    = t.edit resource unless resource.closure_in_preparation? && @closer != current_user
    = t.compute_balances resource, method: :post
  = t.new(label: :new_financial_year_exchange.tl, params: { controller: :financial_year_exchanges, financial_year_id: resource.id }) if resource.can_create_exchange? && resource.opened?
  - if resource == FinancialYear.closable_or_lockable && !resource.closure_in_preparation?
    = link_to :prepare_financial_year_for_closure.tl(code: resource.code), { controller: :financial_year_closure_preparations, action: :create, financial_year_id: resource.id, redirect: backend_financial_year_path(resource) }, { class: 'btn btn-default no-icn', method: :post }
    = t.lock resource, label: :lock_financial_year.tl(code: resource.name), icon: false
  - if resource.closure_in_preparation? && @closer == current_user
    = link_to :quit_financial_year_closure_preparation.tl(code: resource.code), { controller: :financial_year_closure_preparations, action: :destroy, financial_year_id: resource.id, redirect: backend_financial_year_path(resource) }, { class: 'btn btn-default no-icn', method: :delete }
    = t.close resource, label: :close_financial_year.tl(code: resource.name), icon: false
    = t.lock resource, label: :lock_financial_year.tl(code: resource.name), icon: false
  - style = resource.closing? ? 'disabled-btn' : ''
  = dropdown_menu_button(:export_fec.ta, { icon: :download, class: style }) do |d|
    - export_params = params.slice(:id)
    - %i[all ba_bnc_ir_commercial_accountancy ba_ir_cash_accountancy bnc_ir_cash_accountancy].each do |position|
      - d.item "export_fec_#{position}".tl, action: :show, fiscal_position: position, format: :xml

= main_informations attachment: true do
  = infos do
    .med-info.important
      %span.title= :year_start.tl
      %span.value= resource.started_on.l

    .med-info.important
      %span.title= :year_end.tl
      %span.value= resource.stopped_on.l

    .med-info.important
{'fraction_non_alphanumeric': 0.12327547841566533, 'fraction_numerical': 0.0004450378282153983, 'mean_word_length': 5.157534246575342, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4433726', 'n_tokens_mistral': 1495, 'n_tokens_neox': 1461, 'n_words': 292}