change dashboard ui
This commit is contained in:
@@ -91,7 +91,7 @@ class HomeController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
@summ_sale = Sale.summary_sale_receipt(today)
|
@summ_sale = Sale.summary_sale_receipt(today)
|
||||||
|
p @summ_sale
|
||||||
@total_customer = Sale.total_customer(today)
|
@total_customer = Sale.total_customer(today)
|
||||||
@total_dinein = Sale.total_dinein(today)
|
@total_dinein = Sale.total_dinein(today)
|
||||||
@total_takeaway = Sale.total_takeaway(today)
|
@total_takeaway = Sale.total_takeaway(today)
|
||||||
|
|||||||
@@ -954,7 +954,7 @@ end
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.summary_sale_receipt(today)
|
def self.summary_sale_receipt(today)
|
||||||
query = Sale.select('count(sale_id) as total_receipt, sum(total_amount) as total_amount, sum(grand_total) as grand_total, sum(total_discount) as total_discount, sum(total_tax) as total_tax')
|
query = Sale.select('count(sale_id) as total_receipt, (case when sum(total_amount) > 0 then sum(total_amount) else 0.0 end) as total_amount, (case when sum(grand_total) > 0 then sum(grand_total) else 0.0 end) as grand_total, (case when sum(total_discount) > 0 then sum(total_discount) else 0.0 end) as total_discount, (case when sum(total_tax) > 0 then sum(total_tax) else 0.0 end) as total_tax')
|
||||||
.where('sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
|
.where('sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
|
||||||
.first()
|
.first()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -103,9 +103,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
|
||||||
|
<% if !@summ_sale.nil? %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||||
<% if !@summ_sale.nil? %>
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<h6>Sale</h6>
|
<h6>Sale</h6>
|
||||||
@@ -157,9 +157,9 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||||
@@ -168,45 +168,35 @@
|
|||||||
<h6>Customer</h6>
|
<h6>Customer</h6>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<% if !@total_customer.nil? %>
|
<% if !@total_customer.nil? %>
|
||||||
<% if @total_customer.total_cus > 0 %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Total Customer : </td>
|
<td>Total Customer : </td>
|
||||||
<td align="right"><%= @total_customer.total_cus %></td>
|
<td align="right"><%= @total_customer.total_cus %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
<% if !@total_dinein.nil? %>
|
<% if !@total_dinein.nil? %>
|
||||||
<% if @total_dinein.total_dinein_cus > 0 %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Dine in : </td>
|
<td>Dine in : </td>
|
||||||
<td align="right"><%= @total_dinein.total_dinein_cus %></td>
|
<td align="right"><%= @total_dinein.total_dinein_cus %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
<% if !@total_takeaway.nil? %>
|
<% if !@total_takeaway.nil? %>
|
||||||
<% if @total_takeaway.total_take_cus > 0 %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Takeaway : </td>
|
<td>Takeaway : </td>
|
||||||
<td align="right"><%= @total_takeaway.total_take_cus %></td>
|
<td align="right"><%= @total_takeaway.total_take_cus %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
<% if !@total_other_customer.nil? %>
|
<% if !@total_other_customer.nil? %>
|
||||||
<% if @total_other_customer.total_cus > 0 %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Customer : </td>
|
<td>Customer : </td>
|
||||||
<td align="right"><%= @total_other_customer.total_cus %></td>
|
<td align="right"><%= @total_other_customer.total_cus %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
<% if !@total_membership.nil? %>
|
<% if !@total_membership.nil? %>
|
||||||
<% if @total_membership.total_memb_cus > 0 %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Membership : </td>
|
<td>Membership : </td>
|
||||||
<td align="right"><%= @total_membership.total_memb_cus %></td>
|
<td align="right"><%= @total_membership.total_memb_cus %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -220,13 +210,11 @@
|
|||||||
<h6>Order</h6>
|
<h6>Order</h6>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<% if !@total_order.nil? %>
|
<% if !@total_order.nil? %>
|
||||||
<% if @total_order.total_order > 0 %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Total Order : </td>
|
<td>Total Order : </td>
|
||||||
<td align="right"><%= @total_order.total_order %></td>
|
<td align="right"><%= @total_order.total_order %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if !(@total_accounts.nil?) %>
|
<% if !(@total_accounts.nil?) %>
|
||||||
<% @total_accounts.each do |account| %>
|
<% @total_accounts.each do |account| %>
|
||||||
@@ -249,13 +237,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if !@total_foc_items.nil? %>
|
<% if !@total_foc_items.nil? %>
|
||||||
<% if @total_foc_items > 0 %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Total FOC Item : </td>
|
<td>Total FOC Item : </td>
|
||||||
<td align="right"><%= @total_foc_items %></td>
|
<td align="right"><%= @total_foc_items %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user