<commit_before>= form_tag do
  = field_set :prerequisites_checks_before_closure.tl do
    .close-conditions
      -# ------ Warnings ------
      = warnings(@financial_year,
                  fixed_assets: FixedAsset.drafts,
                  loans: Loan.drafts,
                  tax_declarations: :not_sent_tax_declarations,
                  incoming_parcels: :not_given_incoming_parcel,
                  purchases: :not_invoiced_or_aborted_purchase,
                  outgoing_parcels: :not_given_outgoing_parcel,
                  sales: :not_invoiced_or_aborted_sale)

      -# ------ Checks ------
      = checks(@financial_year,
               closed_previous_years: @financial_year.all_previous_financial_years_closed_or_locked?,
               drafts_empty: @financial_year.no_draft_entry?,
               entries_balanced: @financial_year.no_entry_to_balance?,
               no_entries_on_radicals: @financial_year.unbalanced_radical_account_classes_array.empty?)

  = field_set :close_settings.tl do
    = field FinancialYear.model_name.human, @financial_year.code
    = field FinancialYear.human_attribute_name(:stopped_on), @financial_year.stopped_on.l
    = hidden_field_tag("financial_year[stopped_on]", @financial_year.stopped_on)
    = field FinancialYear.human_attribute_name(:result_journal), select_tag("result_journal_id", options_for_select([[:dont_generate_result_entries.tl, ""], [:create_journal.tl, 0]] + Journal.where(currency: @financial_year.currency, nature: :result).collect{|j| [j.name, j.id]}, selected: params[:result_journal_id]))
    = field FinancialYear.human_attribute_name(:closure_journal), select_tag("closure_journal_id", options_for_select([[:dont_generate_closure_entries.tl, ""], [:create_journal.tl, 0]] + Journal.where(currency: @financial_year.currency, nature: :closure).collect{|j| [j.name, j.id]}, selected: params[:closure_journal_id]))
    = field FinancialYear.human_attribute_name(:forward_journal), select_tag("forward_journal_id", options_for_select([[:dont_generate_carrying_forward_entries.tl, ""], [:create_journal.tl, 0]] + Journal.where(currency: @financial_year.currency, nature: :forward).collect{|j| [j.name, j.id]}, selected: params[:forward_journal_id]))

    #confirmCloseModal.modal.fade{ tabindex: '-1', role: 'dialog', 'aria-labelledby': 'indexModal', 'aria-hidden': 'true' }
      .modal-dialog{ role: 'document' }
        .modal-content
          .modal-header
            %button.close{ data: { dismiss: 'modal' }, 'aria-label': 'Close', type: 'button' }
              %i.icon.icon-destroy{ 'aria-hidden': 'true' }
            %b.modal-title= :last_confirmation_before_definitive_close.tl
          .modal-body<commit_msg>Add code to get result of financial year (needs to get style with ot)<commit_after>= form_tag do
  = field_set :prerequisites_checks_before_closure.tl do
    .close-conditions
      -# ------ Warnings ------
      = warnings(@financial_year,
                  fixed_assets: FixedAsset.drafts,
                  loans: Loan.drafts,
                  tax_declarations: :not_sent_tax_declarations,
                  incoming_parcels: :not_given_incoming_parcel,
                  purchases: :not_invoiced_or_aborted_purchase,
                  outgoing_parcels: :not_given_outgoing_parcel,
                  sales: :not_invoiced_or_aborted_sale)

      -# ------ Checks ------
      = checks(@financial_year,
               closed_previous_years: @financial_year.all_previous_financial_years_closed_or_locked?,
               drafts_empty: @financial_year.no_draft_entry?,
               entries_balanced: @financial_year.no_entry_to_balance?,
               no_entries_on_radicals: @financial_year.unbalanced_radical_account_classes_array.empty?)

      -# = AccountancyComputation.new(@financial_year).sum_entry_items_by_line(:profit_and_loss_statement, :exercice_result)
      
  = field_set :close_settings.tl do
    = field FinancialYear.model_name.human, @financial_year.code
    = field FinancialYear.human_attribute_name(:stopped_on), @financial_year.stopped_on.l
    = hidden_field_tag("financial_year[stopped_on]", @financial_year.stopped_on)
    = field FinancialYear.human_attribute_name(:result_journal), select_tag("result_journal_id", options_for_select([[:dont_generate_result_entries.tl, ""], [:create_journal.tl, 0]] + Journal.where(currency: @financial_year.currency, nature: :result).collect{|j| [j.name, j.id]}, selected: params[:result_journal_id]))
    = field FinancialYear.human_attribute_name(:closure_journal), select_tag("closure_journal_id", options_for_select([[:dont_generate_closure_entries.tl, ""], [:create_journal.tl, 0]] + Journal.where(currency: @financial_year.currency, nature: :closure).collect{|j| [j.name, j.id]}, selected: params[:closure_journal_id]))
    = field FinancialYear.human_attribute_name(:forward_journal), select_tag("forward_journal_id", options_for_select([[:dont_generate_carrying_forward_entries.tl, ""], [:create_journal.tl, 0]] + Journal.where(currency: @financial_year.currency, nature: :forward).collect{|j| [j.name, j.id]}, selected: params[:forward_journal_id]))

    #confirmCloseModal.modal.fade{ tabindex: '-1', role: 'dialog', 'aria-labelledby': 'indexModal', 'aria-hidden': 'true' }
      .modal-dialog{ role: 'document' }
        .modal-content
          .modal-header
            %button.close{ data: { dismiss: 'modal' }, 'aria-label': 'Close', type: 'button' }
              %i.icon.icon-destroy{ 'aria-hidden': 'true' }
            %b.modal-title= :last_confirmation_before_definitive_close.tl
          .modal-body
{'fraction_non_alphanumeric': 0.12902648532569794, 'fraction_numerical': 0.0014316392269148174, 'mean_word_length': 3.9112478031634446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '408355', 'n_tokens_mistral': 1795, 'n_tokens_neox': 1728, 'n_words': 242}