<commit_before>= kujaku do |k|
  - k.helper :journal_period_crit

= form_tag() do

  = field_set :details do
    = attributes_list(@account, stamps: false) do |l|
      - l.attribute :name, url: true
      - l.attribute :number, url: true
      - l.attribute :description

    = error_messages "account"

  = field_set :items do
    - [:period, :started_at, :stopped_at].each do |x|
      = hidden_field_tag(x, params[x])
    - precision = Nomen::Currency[Preference[:currency]].precision

    .active-list-actions
      = mask_lettered_items_button :mark_journal_entry_items

    - items = @account.reconcilable_entry_items(params[:period], params[:started_at], params[:stopped_at])
    - partial_lettering = items.any?(&:partially_lettered?)
    .active-list#mark_journal_entry_items
      %table.list
        %thead
          %tr
            %th{ colspan: (partial_lettering ? 2 : 1) }= JournalEntryItem.human_attribute_name(:letter)
            %th.act
            %th= JournalEntry.human_attribute_name(:printed_on)
            %th= Journal.model_name.human
            %th= JournalEntry.model_name.human
            %th= JournalEntryItem.human_attribute_name(:name)
            %th= JournalEntryItem.human_attribute_name(:absolute_debit)
            %th= JournalEntryItem.human_attribute_name(:absolute_credit)

        %tfoot
          %tr#total.valid.total{data: {valid_if_equality_between: "#total-debit, #total-credit", submit_if_valid: "true"}}
            %th{colspan: (partial_lettering ? 7 : 6)}= :total.tl
            %td#total-debit{data:  {use: "tr.selected .debit", calculate_round: precision}}=  0
            %td#total-credit{data: {use: "tr.selected .credit", calculate_round: precision}}= 0

        %tbody
          - items.each do |item|
            - checked = (item.letter.blank? && (params[:journal_entry_item]||{}).keys.include?(item.id.to_s))
            - trid, conf = "e#{item.id}", {}
            %tr{id: trid, class: (item.closed? ? "disabled " : checked ? "selected " : "test") + cycle("even", "odd") + ((item.lettered? && !item.partially_lettered?) ? ' lettered-item' : '')}
              %td.chk
                - if (item.letter.blank? || item.partially_lettered?) && !item.closed?
                  = check_box_tag("journal_entry_item[#{item.id}][to_mark]", "1", checked, id: "journal_entry_item_#{item.id}_to_mark", data: {add_class: "selected", add_class_to: "##{trid}"})
                  - conf = {data: {click: "#journal_entry_item_#{item.id}_to_mark"}}
              %td.ltr
                = item.letter
              %td.act
                - unless item.letter.blank? or item.closed?
                  = link_to({action: :unmark, id: @account.id, letter: item.letter}, class: "unmark", method: :post, data: {confirm: :are_you_sure.tl}) do
                    %i
                    = :unmark.ta
              %td.dat{conf}= item.entry.printed_on.l
              %td{conf}= link_to(item.journal.name, {action: :show, controller: :journals, id: item.journal_id}, keep: true)
              %td.code{conf}= link_to(item.entry.number, {action: :show, controller: :journal_entries, id: item.entry_id}, keep: true)
              %td{conf}= item.name
              %td.dec.debit{conf}=  number_to_accountancy(item.absolute_debit)
              %td.dec.credit{conf}= number_to_accountancy(item.absolute_credit)
<commit_msg>Fixes custom dates interval searchbar. Fixes #1854.<commit_after>= kujaku do |k|
  - k.helper :journal_period_crit

= form_tag() do

  = field_set :details do
    = attributes_list(@account, stamps: false) do |l|
      - l.attribute :name, url: true
      - l.attribute :number, url: true
      - l.attribute :description

    = error_messages "account"

  = field_set :items do
    - [:period, :started_at, :stopped_at].each do |x|
      = hidden_field_tag(x, params[x])
    - precision = Nomen::Currency[Preference[:currency]].precision

    .active-list-actions
      = mask_lettered_items_button :mark_journal_entry_items

    - items = @account.reconcilable_entry_items(params[:period], params[:started_on], params[:stopped_on])
    - partial_lettering = items.any?(&:partially_lettered?)
    .active-list#mark_journal_entry_items
      %table.list
        %thead
          %tr
            %th{ colspan: (partial_lettering ? 2 : 1) }= JournalEntryItem.human_attribute_name(:letter)
            %th.act
            %th= JournalEntry.human_attribute_name(:printed_on)
            %th= Journal.model_name.human
            %th= JournalEntry.model_name.human
            %th= JournalEntryItem.human_attribute_name(:name)
            %th= JournalEntryItem.human_attribute_name(:absolute_debit)
            %th= JournalEntryItem.human_attribute_name(:absolute_credit)

        %tfoot
          %tr#total.valid.total{data: {valid_if_equality_between: "#total-debit, #total-credit", submit_if_valid: "true"}}
            %th{colspan: (partial_lettering ? 7 : 6)}= :total.tl
            %td#total-debit{data:  {use: "tr.selected .debit", calculate_round: precision}}=  0
            %td#total-credit{data: {use: "tr.selected .credit", calculate_round: precision}}= 0

        %tbody
          - items.each do |item|
            - checked = (item.letter.blank? && (params[:journal_entry_item]||{}).keys.include?(item.id.to_s))
            - trid, conf = "e#{item.id}", {}
            %tr{id: trid, class: (item.closed? ? "disabled " : checked ? "selected " : "test") + cycle("even", "odd") + ((item.lettered? && !item.partially_lettered?) ? ' lettered-item' : '')}
              %td.chk
                - if (item.letter.blank? || item.partially_lettered?) && !item.closed?
                  = check_box_tag("journal_entry_item[#{item.id}][to_mark]", "1", checked, id: "journal_entry_item_#{item.id}_to_mark", data: {add_class: "selected", add_class_to: "##{trid}"})
                  - conf = {data: {click: "#journal_entry_item_#{item.id}_to_mark"}}
              %td.ltr
                = item.letter
              %td.act
                - unless item.letter.blank? or item.closed?
                  = link_to({action: :unmark, id: @account.id, letter: item.letter}, class: "unmark", method: :post, data: {confirm: :are_you_sure.tl}) do
                    %i
                    = :unmark.ta
              %td.dat{conf}= item.entry.printed_on.l
              %td{conf}= link_to(item.journal.name, {action: :show, controller: :journals, id: item.journal_id}, keep: true)
              %td.code{conf}= link_to(item.entry.number, {action: :show, controller: :journal_entries, id: item.entry_id}, keep: true)
              %td{conf}= item.name
              %td.dec.debit{conf}=  number_to_accountancy(item.absolute_debit)
              %td.dec.credit{conf}= number_to_accountancy(item.absolute_credit)

{'fraction_non_alphanumeric': 0.14718934911242604, 'fraction_numerical': 0.0026627218934911242, 'mean_word_length': 2.67246061922868, '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': '7137682', 'n_tokens_mistral': 2227, 'n_tokens_neox': 2162, 'n_words': 388}