Guest User

Untitled

a guest
May 20th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <h1>Plant <%= plant.PlantID -%> - <%= plant.PlantName -%></h1>
  2. <%# dates is just an array of dates specified by the client. -%>
  3. <% @dates.each do |date| -%>
  4. <%# sum is the first item in summary that matches the corresponding date -%>
  5. <%# if an item can't be found, it's [] -%>
  6. <% sum = summary.find_all {|i| i['ScheduleDate'].to_date == date} -%>
  7. <% unless sum == [] -%>
  8. <div class="plantday">
  9. <h2><%= nice_date date %></h2>
  10. <table>
  11. <% sum.each do |row| -%>
  12. <tr>
  13. <td><%= row['Material'] %> <%= row['PGOil'] -%></td>
  14. <td><%= row['Tons'] -%></td>
  15. <td><%= row['DayShiftYN'] -%></td>
  16. <td><%= row['CrewLeader'] -%></td>
  17. </tr>
  18. <% end -%>
  19. </table>
  20. <div class="planttotals">
  21. <h2><%= plant.PlantName -%> Totals</h2>
  22. <%= trucksummary date, plant.PlantID %>
  23. </div>
  24. </div>
  25. <% end -%>
  26. <% end -%>
Add Comment
Please, Sign In to add comment