check unclose shift in filter

This commit is contained in:
phyusin
2018-05-15 17:35:10 +06:30
parent eaa013c10f
commit de05c4423a
5 changed files with 28 additions and 21 deletions

View File

@@ -77,7 +77,7 @@
//Reset the form to pervious values
<% if params[:shift_name].to_i > 0%>
shift_id = '<%= params[:shift_name] %>'
local_date = '<%= @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")%> -<%= @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") %>'
local_date = '<%= @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")%> -<%= @shift.shift_closed_at ? @shift.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p") : "-" %>'
var shift = $('#shift_name');
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
shift.append(str);

View File

@@ -95,7 +95,7 @@
<%= result[:employee_name] rescue '-'%>
</td>
<td><%= result[:shift_started_at].strftime("%e %b %I:%M%p") rescue '-' %> -
<%= result[:shift_closed_at].strftime("%e %b %I:%M%p") rescue '-' %>
<%= result[:shift_closed_at] ? result[:shift_closed_at].strftime("%e %b %I:%M%p") : '-' %>
</td>
<!-- <td style='color:red;'>(<%= sprintf "%.2f",result.void_amount.to_f.to_d rescue '-'%>)</td> -->
<td><%= number_with_precision(result[:cash_sales].to_f, precision:precision.to_i,delimiter:delimiter) %></td>