<commit_before>#journals_container
  %form{:class => "_remote_", :method => "GET", :action => url(:controller => :journals, :action => :index)}
    %b From
    - today = Date.today
    = date_select :from_date, (params[:from_date] || today), :min_date => Date.min_date, :max_date => Date.today
    %b To
    = date_select :to_date, (params[:to_date] || today), :min_date => Date.min_date, :max_date => Date.today
    %b Voucher type
    = select :journal_type_id, :collection => JournalType.all.map{|x| [x.id, x.name]}, :prompt => "Select voucher type"
    %input{:type => :hidden, :name => "return", :value => params[:return]}
    %input{:type => :hidden, :name => "_target_", :value => "journals_container"}
    = submit "GO"  
  %table.report.nojs
    %tr
      %th 
        Created at
      %th
        Date
      %th 
        Journal ID  
      %th 
        Debit Account
      %th 
        Credit Account
      %th 
        Breakup
      %th 
        Amount
      %th 
        Comment
    - journals.each do |journal|
      - postings = journal.postings.sort_by{|x| x.amount}
      %tr
        %td.text
          = journal.created_at.strftime(Mfi.first.date_format + " at %H:%m")
        %td.text
          = journal.date
        %td
          = link_to journal.id, resource(journal)
        - debit_postings, credit_postings = journal.postings.group_by{|x| x.amount>0}.values
        %td.text 
          - debit_postings.each do |p|
            = p.account.name
            %br
        %td.text
          - credit_postings.each do |p|
            = p.account.name
            %br
        %td
          %b De
          = debit_postings.map{|x| x.amount.abs.to_currency}.join("<br/>")
          %br
          %b Cr
          = credit_postings.map{|x| x.amount.abs.to_currency}.join("<br/>")
        %td
          = postings.map{|x| x.amount>0 ? x.amount : 0}.inject(0){|s,x| s+=x}
        %td.text
          = journal.comment
  = paginate(journals).to_s.gsub("<a", "<a class='_remote_' id='journal_entries'")<commit_msg>view side bug on journals/_list<commit_after>#journals_container
  %form{:class => "_remote_", :method => "GET", :action => url(:controller => :journals, :action => :index)}
    %b From
    - today = Date.today
    = date_select :from_date, (params[:from_date] || today), :min_date => Date.min_date, :max_date => Date.today
    %b To
    = date_select :to_date, (params[:to_date] || today), :min_date => Date.min_date, :max_date => Date.today
    %b Voucher type
    = select :journal_type_id, :collection => JournalType.all.map{|x| [x.id, x.name]}, :prompt => "Select voucher type"
    %input{:type => :hidden, :name => "return", :value => params[:return]}
    %input{:type => :hidden, :name => "_target_", :value => "journals_container"}
    = submit "GO"  
  %table.report.nojs
    %tr
      %th 
        Created at
      %th
        Date
      %th 
        Journal ID  
      %th 
        Debit Account
      %th 
        Credit Account
      %th 
        Breakup
      %th 
        Amount
      %th 
        Comment
    - journals.each do |journal|
      - postings = journal.postings.sort_by{|x| x.amount}
      %tr
        %td.text
          = journal.created_at.strftime(Mfi.first.date_format + " at %H:%m")
        %td.text
          = journal.date
        %td
          = link_to journal.id, resource(journal)
        - debit_postings, credit_postings = journal.postings.group_by{|x| x.amount>0}.values
        %td.text 
          - debit_postings.each do |p|
            = p.account ? p.account.name : "Some deleted account id #{p.account_id}"
            %br
        %td.text
          - credit_postings.each do |p|
            = p.account ? p.account.name : "Some deleted account id #{p.account_id}"
            %br
        %td
          %b De
          = debit_postings.map{|x| x.amount.abs.to_currency}.join("<br/>")
          %br
          %b Cr
          = credit_postings.map{|x| x.amount.abs.to_currency}.join("<br/>")
        %td
          = postings.map{|x| x.amount>0 ? x.amount : 0}.inject(0){|s,x| s+=x}
        %td.text
          = journal.comment
  = paginate(journals).to_s.gsub("<a", "<a class='_remote_' id='journal_entries'")
{'fraction_non_alphanumeric': 0.1533492822966507, 'fraction_numerical': 0.0019138755980861245, 'mean_word_length': 2.051824817518248, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 45, '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': '227625', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1390, 'n_words': 287}