<commit_before><!-- ---
title: Development Tracker
--- -->

<%= erb :'partials/_projects-header', :locals => { :project => project, :countryOrRegion => countryOrRegion, :fundedProjectsCount => fundedProjectsCount, :fundingProjectsCount => fundingProjectsCount, :active => "transactions"} %>

<%# ------------------------------------------------------------------------ %>
<%#                       B U D G E T S   T A B L E                          %>
<%# ------------------------------------------------------------------------ %>
<div class="row">
  <div class="twelve columns">
      <% if(!is_dfid_project(project['iati_identifier'])) %>
      <div id="disclaimer" class="disclaimer grey">
          <div style="margin-top: 0px; padding: 0.3em 0.0em 0em;" class="ui-state-highlight ui-corner-all">
              <p style="margin-bottom: 0px; line-height: 1; font-size: 1em"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span><strong>Disclaimer</strong>: The data for this page has been produced from IATI data published by <%= project['reporting_organisations'][0]['narratives'][0]['text'] || "" %>. Please contact them if you have any questions about their data.</p>
          </div>
      </div>
      <% end %>
  </div>
  <div class="twelve columns transactions">

    <div class="section-group-title trans-header-container">
      <div class="trans-header-left">
        <span class="trans-type-title">Budget</span>
        <a class="more-info-link more-info-link-spacer" id="moreinfolink1" target="1">
           <img src="/images/icon-information.png" alt="More information about budget" class="more-info-link-middle"/>
        </a> 
        <aside id="moreinfo1" class="more-info">  
              <div class="more-info-content trans-more-info-box-limiter">
                The total amount of money available to spend.  Some budgets may not be shown if projects are in an active procurement phase.
              </div>
        </aside>   
        <p style="margin-bottom:2px;">(Current approved budget)</p>
       </div>  
       <%# projectBudgets=financial_year_wise_budgets(yearWiseBudgets['results'],"P") %>
       <% totalProjectBudget=get_sum_budget(projectYearWiseBudgets).to_f %>
       <div class="trans-header-right">
         <div class="<%= project['aggregations']['activity_children']['budget_value'].to_f.round(0) < 0 ? 'negative' : ''%> float-right trans-type-value">
           <%=  Money.new(project['aggregations']['activity_children']['budget_value'].to_f.round(0)*100, if project['aggregations']['activity_children']['budget_currency'].nil? then project['default_currency']['code'] else project['aggregations']['activity_children']['budget_currency'] end).format(:no_cents_if_whole => true,:sign_before_symbol => false)%>
         </div>
       </div>        
    </div>
    <table class="transactions-table" style="width:100%">
      <tbody>
        <tr>
          <th>Financial Year</th>
          <th>Value</th>
        </tr>
        <% projectYearWiseBudgets.each do |projectYearWiseBudget| %>
          <tr>
            <td><%= projectYearWiseBudget['fy'] %></td>
            <td><span class="<%= projectYearWiseBudget['value'].round(0) < 0 ? 'negative' : ''%>"><%= Money.new(projectYearWiseBudget['value'].to_f.round(0)*100, project['default_currency']['code']).format(:no_cents_if_whole => true,:sign_before_symbol => false) %></span></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>

<%# ------------------------------------------------------------------------ %>
<%#                   I N C O M I N G   F U N D S   T A B L E                %>
<%# ------------------------------------------------------------------------ %>
<div class="row">
  <div class="twelve columns transactions">
    <%# incomingFunds=transactions.select {|group| group['transaction_type']['code'] == "1" } %>
    <%if !incomingFunds.nil? && incomingFunds.length > 0 %>
    <%# totalIncomingFund=get_sum_transaction(incomingFunds).to_f %>
     <div class="section-group-title trans-header-container">
          <div class="trans-header-left">
            <span class="trans-type-title">Incoming Funds</span>
            <a class="more-info-link more-info-link-spacer" id="moreinfolink2" target="2">
               <img src="/images/icon-information.png" alt="More information about Incoming Funds" class="more-info-link-middle"/>
            </a> 
            <aside id="moreinfo2" class="more-info">  
                  <div class="more-info-content trans-more-info-box-limiter">
                   Funds that originate from a source other than the donor(s) reported in the activity.
                  </div>
            </aside>   
            <p style="margin-bottom:2px;">(Funds received from an external funding source)</p>
           </div>  

           <div class="trans-header-right">
              <%# mixedCurrencyExists = transactions.select {|group| group['transaction_type']['code'] == '1' }.sort{ |a,b| b['transaction_date']  <=> a['transaction_date'] } %>
              <% if incomingFunds.uniq{|m| m['currency']['code']}.count == 1%>
                <div class="<%= project['aggregations']['activity_children']['incoming_funds_value'].to_f.round(0) < 0 ? 'negative' : ''%> float-right trans-type-value"><%= Money.new(project['aggregations']['activity_children']['incoming_funds_value'].to_f.round(0)*100, project['aggregations']['activity_children']['incoming_funds_currency']).format(:no_cents_if_whole => true,:sign_before_symbol => false)%>
                </div>
              <%end%>
           </div>        
      </div> 
      <table class="transactions-table" style="width:100%">
        <tbody>
          <tr>
            <th><%= "Activity Description" %></th>
            <th width="30%">Provider</th>
            <th width="15%">Date</th>
            <th width="15%" style="text-align:right;">Value</th>
          </tr>
          <% incomingFunds.sort{ |a,b| b['transaction_date']  <=> a['transaction_date'] }.each do |incomingFund| %>
            <tr>
              <td><%= if !incomingFund['description'].nil? then incomingFund['description']['narratives'][0]['text'] else "" end %></td>
              <td width="30%"><%= if incomingFund['provider_organisation'].nil? then '' else incomingFund['provider_organisation']['narratives'][0]['text'] + 
              if incomingFund['provider_organisation']['provider_activity_id'].nil? then '' else " (" + incomingFund['provider_organisation']['provider_activity_id'] + ")" end  end   %></td>
              <td width="15%"><%= Date.parse(incomingFund['transaction_date']).strftime("%d %b %Y")%></td>
              <td width="15%" class="<%= incomingFund['value'].to_f.round(0) < 0 ? 'negative' : ''%>" style="text-align:right;"><%= Money.new(incomingFund['value'].to_f.round(0)*100, incomingFund['currency']['code']).format(:no_cents_if_whole => true,:sign_before_symbol => false) %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    <% end %>
  </div>
</div>

<%# ------------------------------------------------------------------------ %>
<%#                   C O M M I T M E N T S   T A B L E                      %>
<%# ------------------------------------------------------------------------ %>
<div class="row">
  <div class="twelve columns transactions">
    <%# commitments=transactions.select {|group| group['transaction_type']['code'] == '2' } %>
    <%if !commitments.nil? && commitments.length > 0 %>
    <% h2Activities = get_h2_project_details(project['id'])%>
    <%# totalCommitments=get_sum_transaction(commitments).to_f %>
    <%#= totalCommitments%>
     <div class="section-group-title trans-header-container">
          <div class="trans-header-left"><commit_msg>fixed issue with blank provider-org text in incoming funds<commit_after><!-- ---
title: Development Tracker
--- -->

<%= erb :'partials/_projects-header', :locals => { :project => project, :countryOrRegion => countryOrRegion, :fundedProjectsCount => fundedProjectsCount, :fundingProjectsCount => fundingProjectsCount, :active => "transactions"} %>

<%# ------------------------------------------------------------------------ %>
<%#                       B U D G E T S   T A B L E                          %>
<%# ------------------------------------------------------------------------ %>
<div class="row">
  <div class="twelve columns">
      <% if(!is_dfid_project(project['iati_identifier'])) %>
      <div id="disclaimer" class="disclaimer grey">
          <div style="margin-top: 0px; padding: 0.3em 0.0em 0em;" class="ui-state-highlight ui-corner-all">
              <p style="margin-bottom: 0px; line-height: 1; font-size: 1em"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span><strong>Disclaimer</strong>: The data for this page has been produced from IATI data published by <%= project['reporting_organisations'][0]['narratives'][0]['text'] || "" %>. Please contact them if you have any questions about their data.</p>
          </div>
      </div>
      <% end %>
  </div>
  <div class="twelve columns transactions">

    <div class="section-group-title trans-header-container">
      <div class="trans-header-left">
        <span class="trans-type-title">Budget</span>
        <a class="more-info-link more-info-link-spacer" id="moreinfolink1" target="1">
           <img src="/images/icon-information.png" alt="More information about budget" class="more-info-link-middle"/>
        </a> 
        <aside id="moreinfo1" class="more-info">  
              <div class="more-info-content trans-more-info-box-limiter">
                The total amount of money available to spend.  Some budgets may not be shown if projects are in an active procurement phase.
              </div>
        </aside>   
        <p style="margin-bottom:2px;">(Current approved budget)</p>
       </div>  
       <%# projectBudgets=financial_year_wise_budgets(yearWiseBudgets['results'],"P") %>
       <% totalProjectBudget=get_sum_budget(projectYearWiseBudgets).to_f %>
       <div class="trans-header-right">
         <div class="<%= project['aggregations']['activity_children']['budget_value'].to_f.round(0) < 0 ? 'negative' : ''%> float-right trans-type-value">
           <%=  Money.new(project['aggregations']['activity_children']['budget_value'].to_f.round(0)*100, if project['aggregations']['activity_children']['budget_currency'].nil? then project['default_currency']['code'] else project['aggregations']['activity_children']['budget_currency'] end).format(:no_cents_if_whole => true,:sign_before_symbol => false)%>
         </div>
       </div>        
    </div>
    <table class="transactions-table" style="width:100%">
      <tbody>
        <tr>
          <th>Financial Year</th>
          <th>Value</th>
        </tr>
        <% projectYearWiseBudgets.each do |projectYearWiseBudget| %>
          <tr>
            <td><%= projectYearWiseBudget['fy'] %></td>
            <td><span class="<%= projectYearWiseBudget['value'].round(0) < 0 ? 'negative' : ''%>"><%= Money.new(projectYearWiseBudget['value'].to_f.round(0)*100, project['default_currency']['code']).format(:no_cents_if_whole => true,:sign_before_symbol => false) %></span></td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>

<%# ------------------------------------------------------------------------ %>
<%#                   I N C O M I N G   F U N D S   T A B L E                %>
<%# ------------------------------------------------------------------------ %>
<div class="row">
  <div class="twelve columns transactions">
    <%# incomingFunds=transactions.select {|group| group['transaction_type']['code'] == "1" } %>
    <%if !incomingFunds.nil? && incomingFunds.length > 0 %>
    <%# totalIncomingFund=get_sum_transaction(incomingFunds).to_f %>
     <div class="section-group-title trans-header-container">
          <div class="trans-header-left">
            <span class="trans-type-title">Incoming Funds</span>
            <a class="more-info-link more-info-link-spacer" id="moreinfolink2" target="2">
               <img src="/images/icon-information.png" alt="More information about Incoming Funds" class="more-info-link-middle"/>
            </a> 
            <aside id="moreinfo2" class="more-info">  
                  <div class="more-info-content trans-more-info-box-limiter">
                   Funds that originate from a source other than the donor(s) reported in the activity.
                  </div>
            </aside>   
            <p style="margin-bottom:2px;">(Funds received from an external funding source)</p>
           </div>  

           <div class="trans-header-right">
              <%# mixedCurrencyExists = transactions.select {|group| group['transaction_type']['code'] == '1' }.sort{ |a,b| b['transaction_date']  <=> a['transaction_date'] } %>
              <% if incomingFunds.uniq{|m| m['currency']['code']}.count == 1%>
                <div class="<%= project['aggregations']['activity_children']['incoming_funds_value'].to_f.round(0) < 0 ? 'negative' : ''%> float-right trans-type-value"><%= Money.new(project['aggregations']['activity_children']['incoming_funds_value'].to_f.round(0)*100, project['aggregations']['activity_children']['incoming_funds_currency']).format(:no_cents_if_whole => true,:sign_before_symbol => false)%>
                </div>
              <%end%>
           </div>        
      </div> 
      <table class="transactions-table" style="width:100%">
        <tbody>
          <tr>
            <th><%= "Activity Description" %></th>
            <th width="30%">Provider</th>
            <th width="15%">Date</th>
            <th width="15%" style="text-align:right;">Value</th>
          </tr>
          <% incomingFunds.sort{ |a,b| b['transaction_date']  <=> a['transaction_date'] }.each do |incomingFund| %>
            <tr>
              <td><%= if !incomingFund['description'].nil? then incomingFund['description']['narratives'][0]['text'] else "" end %></td>
              <td width="30%"><%= 
              if incomingFund['provider_organisation'].nil? then '' 
                else if incomingFund['provider_organisation']['narratives'][0].nil? then '' 
                else incomingFund['provider_organisation']['narratives'][0]['text'] end + 
              if incomingFund['provider_organisation']['provider_activity_id'].nil? then '' else " (" + incomingFund['provider_organisation']['provider_activity_id'] + ")" end  end   %></td>
              <td width="15%"><%= Date.parse(incomingFund['transaction_date']).strftime("%d %b %Y")%></td>
              <td width="15%" class="<%= incomingFund['value'].to_f.round(0) < 0 ? 'negative' : ''%>" style="text-align:right;"><%= Money.new(incomingFund['value'].to_f.round(0)*100, incomingFund['currency']['code']).format(:no_cents_if_whole => true,:sign_before_symbol => false) %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    <% end %>
  </div>
</div>

<%# ------------------------------------------------------------------------ %>
<%#                   C O M M I T M E N T S   T A B L E                      %>
<%# ------------------------------------------------------------------------ %>
<div class="row">
  <div class="twelve columns transactions">
    <%# commitments=transactions.select {|group| group['transaction_type']['code'] == '2' } %>
    <%if !commitments.nil? && commitments.length > 0 %>
    <% h2Activities = get_h2_project_details(project['id'])%>
    <%# totalCommitments=get_sum_transaction(commitments).to_f %>
    <%#= totalCommitments%>
     <div class="section-group-title trans-header-container">
          <div class="trans-header-left">
{'fraction_non_alphanumeric': 0.22804226069246436, 'fraction_numerical': 0.009228615071283097, 'mean_word_length': 2.421820557491289, 'pattern_counts': {'":': 0, '<': 313, '<?xml version=': 0, '>': 337, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2121467', 'n_tokens_mistral': 4859, 'n_tokens_neox': 4489, 'n_words': 876}