<commit_before>- mask=@journal.facility.journal_mask
%JRNL_HDR_IMP
  %BUSINESS_UNIT== NWUNV
  %JOURNAL_ID== NEXT
  %JOURNAL_DATE= @journal.journal_date.strftime("%Y%m%d")
  %DESCR254=h "#{mask}: Journal ##{ @journal.id}, Created By: #{User.find(@journal.created_by).username}"
  %LEDGER_GROUP== ACTUALS
  %SOURCE== RSC
  %OPRID== GLBATCH
  - @journal_rows.each_with_index do |row, i|
    %JRNL_LN_IMP
      %JOURNAL_LINE= i+1
      %BUSINESS_UNIT== NWUNV
      %LEDGER== ACTUALS
      %ACCOUNT= row.account
      %FOREIGN_AMOUNT= number_to_currency row.amount, :delimiter => '', :unit => ''
      - line_desc="#{mask}:#{row.description}"
      - line_desc="#{mask}:#{row.order_detail.to_s}:#{row.order_detail.product.name}" if row.order_detail
      - line_desc=line_desc[0..29] if line_desc.size > 30
      %LINE_DESCR=h line_desc
      %FUND_CODE= row.fund
      %DEPTID= row.dept
      - if row.project
        %PROJECT_ID= row.project # optional
      - if row.program
        %PROGRAM_CODE= row.program # optional
      - if row.activity
        %ACTIVITY_ID= row.activity # optional
      - if row.reference
        %JRNL_LN_REF= row.reference #optional
  %NU_JRNL_TRL_IMP
    %RECORD_COUNT= @journal_rows.length
    %TOTAL_CREDITS= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount < 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # negative number
    %TOTAL_DEBITS= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount > 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # positive number
<commit_msg>Create generic journal XML output.<commit_after>%journal{id: @journal.id}
  %date= @journal.journal_date.strftime("%Y%m%d")
  %description= "Journal ##{@journal.id}, Created By: #{@journal.created_by_user.username}"
  - @journal_rows.each_with_index do |row, i|
    %journal_row
      %journal_line= i + 1
      %account= row.account
      %amount= number_to_currency row.amount, :delimiter => '', :unit => ''

  %totals
    %record_count= @journal_rows.length
    %total_credits= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount < 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # negative number
    %TOTAL_DEBITS= number_to_currency @journal_rows.inject(0) { |sum,row| sum += (row.amount > 0 ? row.amount : 0) }, :delimiter => '', :unit => '' # positive number

{'fraction_non_alphanumeric': 0.16030534351145037, 'fraction_numerical': 0.009329940627650551, 'mean_word_length': 3.7849898580121706, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '3618137', 'n_tokens_mistral': 873, 'n_tokens_neox': 846, 'n_words': 161}