Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>Plant <%= plant.PlantID -%> - <%= plant.PlantName -%></h1>
- <%# dates is just an array of dates specified by the client. -%>
- <% @dates.each do |date| -%>
- <%# sum is the first item in summary that matches the corresponding date -%>
- <%# if an item can't be found, it's [] -%>
- <% sum = summary.find_all {|i| i['ScheduleDate'].to_date == date} -%>
- <% unless sum == [] -%>
- <div class="plantday">
- <h2><%= nice_date date %></h2>
- <table>
- <% sum.each do |row| -%>
- <tr>
- <td><%= row['Material'] %> <%= row['PGOil'] -%></td>
- <td><%= row['Tons'] -%></td>
- <td><%= row['DayShiftYN'] -%></td>
- <td><%= row['CrewLeader'] -%></td>
- </tr>
- <% end -%>
- </table>
- <div class="planttotals">
- <h2><%= plant.PlantName -%> Totals</h2>
- <%= trucksummary date, plant.PlantID %>
- </div>
- </div>
- <% end -%>
- <% end -%>
Add Comment
Please, Sign In to add comment