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

This commit is contained in:
Yan
2017-06-14 16:52:54 +06:30
22 changed files with 296 additions and 210 deletions

View File

@@ -31,28 +31,28 @@
customer_id = ""
# For CSS- Class for Order? Sale?
sale_status=""
if cpo.order_status == 'new'
unique_id=cpo.booking_id
# sale_status=""
# if cpo.order_status == 'new'
# unique_id=cpo.booking_id
customer_id=cpo.order_customer_id
# check selected item and assign
if @selected_item != nil
if cpo.order_id == @selected_item.order_id
sale_status = sale_status + " selected-item"
end
end
else
unique_id=cpo.sale_id
customer_id=cpo.sale_customer_id
sale_status="paid"
# check selected item and assign
if @selected_item != nil
if unique_id == @selected_item.sale_id
sale_status = sale_status + " selected-item"
end
# customer_id=cpo.order_customer_id
# # check selected item and assign
# if @selected_item_type == "Sale"
# if cpo.order_id == @selected_item.order_id
# sale_status = sale_status + " selected-item"
# end
# end
# else
unique_id=cpo.sale_id
customer_id=cpo.sale_customer_id
sale_status="paid"
# check selected item and assign
if @selected_item != nil
if unique_id == @selected_item.sale_id
sale_status = sale_status + " selected-item"
end
end
# end
%>
<div class="card orders <%= sale_status %>">
<div class="card-block">
@@ -69,9 +69,7 @@
</p>
<p class="card-text">
Order Status :
<span class="orders-order-status">
<%= cpo.order_status %>
</span>
<span class="orders-order-status"><%= cpo.sale_status %></span>
</small>
</p>
</div>
@@ -84,10 +82,11 @@
<!--- Panel 1 - Table Orders -->
<div class="tab-pane active" id="tables" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<%
@booking_orders.each do |bko|
# No Show completed
puts bko.sale_status
if bko.sale_status == 'completed'
next
end
@@ -101,11 +100,11 @@
unique_id=bko.booking_id
customer_id=bko.order_customer_id
# check selected item and assign
if !@selected_item.nil?
if bko.order_id == @selected_item.order_id
sale_status = sale_status + " selected-item"
end
end
# if @selected_item != nil
# if bko.order_id == @selected_item.order_id
# sale_status = sale_status + " selected-item"
# end
# end
else
unique_id=bko.sale_id
customer_id=bko.sale_customer_id
@@ -132,9 +131,7 @@
</p>
<p class="card-text">
Order Status :
<span class="orders-order-status">
<%= bko.order_status %>
</span>
<span class="orders-order-status"><%= bko.order_status %></span>
</small>
</p>
</div>
@@ -165,11 +162,11 @@
unique_id=rmo.booking_id
customer_id=rmo.order_customer_id
# check selected item and assign
if @selected_item != nil
if rmo.order_id == @selected_item.order_id
sale_status = sale_status + " selected-item"
end
end
# if @selected_item != nil
# if rmo.order_id == @selected_item.order_id
# sale_status = sale_status + " selected-item"
# end
# end
else
unique_id=rmo.sale_id
customer_id=rmo.sale_customer_id
@@ -196,9 +193,7 @@
</p>
<p class="card-text">
Order Status :
<span class="orders-order-status">
<%= rmo.order_status %>
</span>
<span class="orders-order-status"><%= rmo.order_status %></span>
</small>
</p>
</div>
@@ -214,6 +209,7 @@
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<%
@orders.each do |odr|
puts odr
# No Show completed
if odr.sale_status == 'completed'
next
@@ -227,11 +223,11 @@
if odr.order_status == 'new'
unique_id=odr.booking_id
customer_id = odr.order_customer_id
if @selected_item != nil
if odr.order_id == @selected_item.order_id
sale_status = sale_status + " selected-item"
end
end
# if @selected_item != nil
# if odr.order_id == @selected_item.order_id
# sale_status = sale_status + " selected-item"
# end
# end
else
unique_id=odr.sale_id
customer_id = odr.sale_customer_id
@@ -258,9 +254,7 @@
</p>
<p class="card-text">
Order Status :
<span class="orders-order-status">
<%= odr.order_status %>
</span>
<span class="orders-order-status"><%= odr.order_status %></span>
</small>
</p>
</div>
@@ -308,14 +302,14 @@
<th class="item-attr">Price</td>
</tr>
</thead>
<tbody>
<tbody>
<%
# For Sale Items
sub_total = 0
if @selected_item_type == "Sale"
@selected_item.sale_items.each do |sale_item|
sub_total += (sale_item.qty*sale_item.unit_price)
%>
%>
<tr>
<td class='item-name'><%= sale_item.product_name %></td>
<td class='item-attr'><%= sale_item.qty %></td>
@@ -327,8 +321,7 @@
%>
<%
# For Order Items
sub_total = 0
# For Order Items
if @selected_item_type == "Order"
@selected_item.order_items.each do |order_item|
sub_total += (order_item.qty*order_item.unit_price)
@@ -386,13 +379,12 @@
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
<button type="button" id="customer" class="btn btn-primary btn-lg btn-block" disabled>Customer</button>
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
<button type="button" id="customer" class="btn btn-primary btn-lg btn-block">Customer</button>
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
<!-- Cashier Buttons -->
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block" disabled>Discount</button>
<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" disabled>Pay</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>
</div>
</div>

View File

@@ -18,5 +18,6 @@
<div class="form-actions">
<%= f.button :submit %>
<%= link_to 'Back', print_settings_path, :class => "btn btn-default" %>
</div>
<% end %>

View File

@@ -1,6 +1,13 @@
<h1>Editing Print Setting</h1>
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', print_setting: @print_setting %>
<br />
</div>
<%= render 'form', print_setting: @print_setting %>
<%= link_to 'Show', @print_setting %> |
<%= link_to 'Back', print_settings_path %>

View File

@@ -1,49 +1,55 @@
<p id="notice"><%= notice %></p>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li>Print Settings</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_print_setting_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<h1>Print Settings</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Unique code</th>
<th>Template</th>
<th>Db name</th>
<th>Db type</th>
<th>Db username</th>
<th>Db password</th>
<th>Printer name</th>
<th>Api settings</th>
<th>Page width</th>
<th>Page height</th>
<th>Print copies</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @print_settings.each do |print_setting| %>
<br />
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<td><%= print_setting.name %></td>
<td><%= print_setting.unique_code %></td>
<td><%= print_setting.template %></td>
<td><%= print_setting.db_name %></td>
<td><%= print_setting.db_type %></td>
<td><%= print_setting.db_username %></td>
<td><%= print_setting.db_password %></td>
<td><%= print_setting.printer_name %></td>
<td><%= print_setting.api_settings %></td>
<td><%= print_setting.page_width %></td>
<td><%= print_setting.page_height %></td>
<td><%= print_setting.print_copies %></td>
<td><%= link_to 'Show', print_setting %></td>
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
<th>Name</th>
<th>Unique code</th>
<th>Template</th>
<!-- <th>Db name</th>
<th>Db type</th>
<th>Db username</th>
<th>Db password</th> -->
<th>Printer name</th>
<th>Api settings</th>
<th>Page width</th>
<th>Page height</th>
<th>Print copies</th>
<th colspan="3"></th>
</tr>
<% end %>
</tbody>
</table>
</thead>
<br>
<%= link_to 'New Print Setting', new_print_setting_path %>
<tbody>
<% @print_settings.each do |print_setting| %>
<tr>
<td><%= print_setting.name %></td>
<td><%= print_setting.unique_code %></td>
<td><%= print_setting.template %></td>
<!-- <td><%= print_setting.db_name %></td>
<td><%= print_setting.db_type %></td>
<td><%= print_setting.db_username %></td>
<td><%= print_setting.db_password %></td> -->
<td><%= print_setting.printer_name %></td>
<td><%= print_setting.api_settings %></td>
<td><%= print_setting.page_width %></td>
<td><%= print_setting.page_height %></td>
<td><%= print_setting.print_copies %></td>
<td><%= link_to 'Show', print_setting %></td>
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -1,5 +1,15 @@
<h1>New Print Setting</h1>
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', print_setting: @print_setting %>
<br />
</div>
<%= render 'form', print_setting: @print_setting %>
<%= link_to 'Back', print_settings_path %>

View File

@@ -1,5 +1,11 @@
<p id="notice"><%= notice %></p>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
<li>Show</li>
</ul>
</div>
<p>
<strong>Name:</strong>
<%= @print_setting.name %>

View File

@@ -1,11 +1,11 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_employees_path %>">Employees</a></li>
<li>Edit</li>
</ul>
</div>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_employees_path %>">Employees</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', employee: @employee %>
</div>

View File

@@ -1,11 +1,11 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_employees_path %>">Employees</a></li>
<li>New</li>
</ul>
</div>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_employees_path %>">Employees</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', employee: @employee %>
</div>