<commit_before>=partial :form
- @accounts = @data
- balance = @accounts.map{|a| a.opening_balance_as_of(@from_date) || 0}.reduce(:+)
%table.report.nojs
  %tr.header
    %thead
      %th
        Date
      %th
        Particulars
      %th
        Vch Type
      %th
        Vch. No.
      %th
        %b Debit
      %th
        %b Credit
  %tr.total
    %td
      = @from_date
    %td
      Opening Balance
    %td
    %td
    %td
      = balance.to_currency
    %td
  - posting_hash = Posting.all(:account.in => @accounts, "journal.date.lte" => @report.to_date, "journal.date.gte" => @report.from_date).map{|p| [p.journal.date, p]}.to_hash
  - posting_hash.keys.sort.each do |date|
    %tr{:class => cycle('odd','even')}
      - posting = posting_hash[date]
      - balance += posting.amount
      %td
        = date
      %td
        = posting.journal.comment
      %td
      %td
      %td
        = posting.amount > 0 ? posting.amount.to_currency : "-"
      %td
        = posting.amount < 0 ? posting.amount.abs.to_currency : "-"
  %tr.total
    %td
      = @to_date
    %td
      Closing Balance
    %td
    %td
    %td
      = balance.to_currency
    %td
        
        <commit_msg>fixed no-method error in bank book<commit_after>=partial :form
- @accounts = @data
- balance = @accounts.map{|a| a.opening_balance_as_of(@from_date) || 0}.reduce(:+)
%table.report.nojs
  %tr.header
    %thead
      %th
        Date
      %th
        Particulars
      %th
        Vch Type
      %th
        Vch. No.
      %th
        %b Debit
      %th
        %b Credit
  %tr.total
    %td
      = @from_date
    %td
      Opening Balance
    %td
    %td
    %td
      = (balance || 0).to_currency
    %td
  - posting_hash = Posting.all(:account.in => @accounts, "journal.date.lte" => @report.to_date, "journal.date.gte" => @report.from_date).map{|p| [p.journal.date, p]}.to_hash
  - posting_hash.keys.sort.each do |date|
    %tr{:class => cycle('odd','even')}
      - posting = posting_hash[date]
      - balance += posting.amount
      %td
        = date
      %td
        = posting.journal.comment
      %td
      %td
      %td
        = posting.amount > 0 ? posting.amount.to_currency : "-"
      %td
        = posting.amount < 0 ? posting.amount.abs.to_currency : "-"
  %tr.total
    %td
      = @to_date
    %td
      Closing Balance
    %td
    %td
    %td
      = (balance || 0).to_currency
    %td
        
        
{'fraction_non_alphanumeric': 0.14037267080745341, 'fraction_numerical': 0.0033126293995859213, 'mean_word_length': 1.7054871220604704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2962672', 'n_tokens_mistral': 880, 'n_tokens_neox': 859, 'n_words': 169}