update sale ability and shipt slae

This commit is contained in:
Aung Myo
2017-06-30 15:53:25 +06:30
parent a5bf5222f6
commit 45c69ab536
4 changed files with 11 additions and 6 deletions

View File

@@ -89,6 +89,11 @@ class Ability
can :moving, :movetable
can :move_dining, :moveroom
can :first_bill, :payment
can :show, :payment
can :create, :payment
can :reprint, :payment
elsif user.role == "accountant"

View File

@@ -21,7 +21,7 @@ class ShiftSale < ApplicationRecord
#find open shift where is open today and is not closed and login by current cashier
today_date = DateTime.now.strftime("%Y-%m-%d")
puts today_date
shift = ShiftSale.where("TO_CHAR(shift_started_at, 'YYYY-MM-DD')=? and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}", today_date).take
shift = ShiftSale.where("DATE(shift_started_at)= #{ today_date } and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}").take
return shift
#end

View File

@@ -42,7 +42,7 @@
<li><%= link_to "Daily Sale Report", reports_dailysale_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Sales Item Report", reports_saleitem_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Receipt Report", reports_receipt_no_index_path, :tabindex =>"-1" %></li>
<!-- <li><%= link_to "Shift Sale Report", reports_shiftsale_index_path, :tabindex =>"-1" %></li> -->
<li><%= link_to "Shift Sale Report", reports_shiftsale_index_path, :tabindex =>"-1" %></li>
</ul>
</li>
</ul>

View File

@@ -42,9 +42,9 @@
<!-- <th>Credit Charges</th> -->
<th>Credit Payment</th>
<!-- <th>FOC Payment</th> -->
<th>Card Payment</th>
<th>Grand Total +
<!-- <br/>Rounding Adj --></th>
<th>Other Payment</th>
<!-- <th>Grand Total
<br/>Rounding Adj</th> -->
<!-- <th>Rounding Adj</th> -->
<th>Grand Total</th>
</tr>
@@ -101,7 +101,7 @@
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
<td><b><%= sprintf("%.2f",card) rescue '-'%></b></td>
<td><b><%= sprintf("%.2f",total) rescue '-'%></b></td>
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
<td><b><%= sprintf("%.2f",g_total) rescue '-'%></b></td>
</tr>