Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Nweni
2017-06-16 18:22:13 +06:30
21 changed files with 352 additions and 181 deletions

View File

@@ -1,26 +1,8 @@
<div class="row">
<div class="col-lg-10 col-md-10 col-sm-10">
<div class="col-lg-11 col-md-11 col-sm-11">
<!-- Column One -->
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#queue" role="tab">Customer Details </a>
</li>
<li class="nav-item">
<a class="nav-link " data-toggle="tab" href="#booking" role="tab">Orders </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#customer" role="tab">Sales</a>
</li>
</ul>
<!-- Nav tabs - End -->
<div class="tab-content">
<div class="tab-pane active" id="queue" role="tabpanel"">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<br>
<h4>Customer Profile</h4>
@@ -51,11 +33,8 @@
</table>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<br>
<h4>Membership Detail</h4>
<div class="table-responsive">
<table class="table table-striped">
@@ -78,8 +57,22 @@
</div>
</div>
</div>
</div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<!-- <li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#queue" role="tab">Customer Details </a>
</li> -->
<li class="nav-item">
<a class="nav-link " data-toggle="tab" href="#booking" role="tab">Orders </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#customer" role="tab">Sales</a>
</li>
</ul>
<!-- Nav tabs - End -->
<div class="tab-content">
<div class="tab-pane" id="booking" role="tabpanel">
<h3>Order Details</h3>
<div class="table-responsive">
@@ -114,9 +107,8 @@
</table>
</div>
</div>
<div class="tab-pane" id="customer" role="tabpanel">
<h3>Sale Details</h3>
<h3>Sale Details</h3>
<div class="table-responsive">
<table class="table table-striped">
<thead>
@@ -146,7 +138,6 @@
</table>
</div>
</div>
</div>
</div>

View File

@@ -1,16 +1,25 @@
<%= simple_form_for([:crm,@dining_queue]) do |f| %>
<%= f.error_notification %>
<p class="hidden generate_no"><%= @queue_no %></p>
<div class="form-inputs">
<%= f.input :name %>
<%= f.input :contact_no %>
<%= f.input :queue_no %>
<%= f.input :queue_no , :class => "dining",:id => "dining", :readonly => true%>
</div>
<br>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>
<script type="text/javascript">
$(document).ready(function(){
if($('form').attr('id') == "new_dining_queue"){
var queue_no = $('.generate_no').text();
$('#dining_queue_queue_no').val(queue_no);
}
});
</script>

View File

@@ -383,6 +383,6 @@
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block">Pay</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
<button type="button" id="re-print" class="btn btn-primary btn-lg btn-block">Re.Print</button>
</div>
</div>

View File

@@ -34,7 +34,6 @@
<th>Order status</th>
<th>Order date</th>
<th>Items Count</th>
<th>Action</th>
</tr>
</thead>
@@ -42,13 +41,13 @@
<% @orders.each do |order| %>
<tr>
<td><%= order.order_id %></td>
<td><%= link_to order.order_id, transactions_order_path(order) %></td>
<td><%= order.order_type %></td>
<td><%= order.customer.name rescue '-' %></td>
<td><%= order.status %></td>
<td> <%= order.date.strftime("%d-%m-%Y") %> </td>
<td> <%= order.item_count %> </td>
<td><%= link_to 'Show', transactions_order_path(order) %></td>
</tr>
<% end %>
</tbody>

View File

@@ -14,7 +14,7 @@
<hr>
<div class="row">
<div class="col-lg-12">
<div class="col-lg-11 col-md-11 col-sm-11">
<div class="main-box-body clearfix">
<div class="table-responsive">
<table class="table table-striped">
@@ -70,13 +70,16 @@
<% end %>
</tbody>
</table>
<a href="<%= transactions_orders_path%>" class="btn btn-primary pull-left">
<i class="fa fa-arrow-left fa-xs"></i> Back
</a>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<a href="<%= transactions_orders_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-xs"></i> Back
</a>
</div>
</div>

View File

@@ -36,7 +36,6 @@
<th>Cashier</th>
<th>Sales status</th>
<th>Receipt Date</th>
<th>Action</th>
</tr>
</thead>
@@ -44,14 +43,13 @@
<% if @sales != 0 %>
<% @sales.each do |sale| %>
<tr>
<td><%= sale.sale_id %></td>
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.grand_total rescue '-' %></td>
<td><%= sale.total_tax %></td>
<td><%= sale.cashier_name rescue '-' %></td>
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
<td><%= link_to 'Show', transactions_sale_path(sale) %></td>
</tr>
<% end %>
<% else %>

View File

@@ -82,12 +82,13 @@
<td>Discount</td>
<td colspan="2"><%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<% @sale.sale_taxes.each do |r|%>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Tax</td>
<td colspan="2"><%= number_with_precision(@sale.total_tax, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%= r.tax_name %>(<%= r.tax_rate %>)</td>
<td colspan="2"><%= number_with_precision(r.tax_payable_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<% end %>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Grand Total</td>
@@ -99,21 +100,24 @@
<td>Pay Amount</td>
<td colspan="2"><%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Change</td>
<td colspan="2"><%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<% @sale_receivables.each do |r|%>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Payment <%= r.payment_method rescue ' '%></td>
<td colspan="2"><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%>
</td>
</tr>
</tr>
<% end %>
<tr>
<td colspan=2 style="text-align:center"></td>
<td>Change</td>
<td colspan="2"><%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
</tbody>
</table>
@@ -160,67 +164,61 @@
<div class="tab-pane" id="customer" role="tabpanel">
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr>
<td colspan="3"></td>
</tr>
<tr>
<th width="20%"><h4>Customer Details</h4></th>
<th width="20%"></th>
<td></td>
</tr>
<tr>
<th width="20%"></th>
<th width="20%">Name</th>
<td><%= @customer.name %></td>
</tr>
<tr>
<th width="20%"></th>
<th width="20%">Email</th>
<td><%= @customer.email %></td>
</tr>
<tr>
<th width="20%"></th>
<th width="20%">Contact no</th>
<td><%= @customer.contact_no %></td>
</tr>
<tr>
<th width="20%"></th>
<th width="20%">Company</th>
<td><%= @customer.company rescue '-' %></td>
</tr>
<tr>
<th width="20%"></th>
<th width="20%">Date Of Birth</th>
<td><%= @customer.date_of_birth rescue '-' %> </td>
</tr>
<tr>
<th width="20%"><h4>Membership Details</h4></th>
<td width="20%"></td>
<td></td>
</tr>
<% if @membership == 0 %>
<tr>
<td colspan="2">"There is no membership data"</td>
</tr>
<% else %>
<% @membership.each do |member| %>
<tr>
<td width="20%"></td>
<th width="20%"><%= member["accountable_type"] %></th>
<td><%= member["balance"] %></td>
</tr>
<% end %>
<% end %>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-md-6">
<br>
<h4>Customer Profile</h4>
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr>
<th>Name</th>
<td><%= @customer.name %></td>
</tr>
<tr>
<th>Email</th>
<td><%= @customer.email %></td>
</tr>
<tr>
<th>Contact no</th>
<td><%= @customer.contact_no %></td>
</tr>
<tr>
<th>Company</th>
<td><%= @customer.company %></td>
</tr>
<tr>
<th>Date Of Birth</th>
<td><%= @customer.date_of_birth %> </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<br>
<h4>Membership Detail</h4>
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<% if @membership == 0 %>
<tr>
<td colspan="2">"There is no membership data"</td>
</tr>
<% else %>
<% @membership.each do |member| %>
<tr>
<th><%= member["accountable_type"] %></th>
<td><%= member["balance"] %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@@ -229,18 +227,17 @@
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary btn-lg">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
<!-- Temporary No Needs -->
<a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-danger pull-right btn-lg">
<a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-danger btn-lg">
<i class="fa fa-trash fa-lg"></i> Void Sale
</a>
<!-- <a href="<%= transactions_manual_complete_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-success pull-right btn-lg">
<a href="<%= transactions_manual_complete_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-success btn-lg">
<i class="fa fa-invoice fa-lg"></i> Complete Sale
</a> -->
</a>
</div>
</div>