Merge branch 'master' into menu_sync
This commit is contained in:
@@ -124,18 +124,20 @@ $(document).on('click',".customer_tr",function(){
|
||||
var url = "customers/" + customer_id + "/edit";
|
||||
}
|
||||
|
||||
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});;
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
success: function(data) {
|
||||
// Selected for Taxes
|
||||
var taxes = JSON.stringify(data.tax_profiles);
|
||||
var parse_taxes = JSON.parse(taxes);
|
||||
console.log(parse_taxes);
|
||||
$.each(parse_taxes, function(i, value){
|
||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected");
|
||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
});
|
||||
|
||||
$('#customer_id').val(data.id);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
||||
|
||||
|
||||
<% if current_login_employee.role = "admin" %>
|
||||
|
||||
<% elsif current_login_employee.role = "cashier" %>
|
||||
<%= link_to "Cashier Station", origami_path %>
|
||||
|
||||
<% elsif current_login_employee = "waiter" %>
|
||||
<% elsif current_login_employee = "account" %>
|
||||
<%= link_to "Cashier Station", oishi_path %>
|
||||
|
||||
<% else %>
|
||||
@@ -14,22 +14,29 @@
|
||||
|
||||
<% end %>
|
||||
<% shop = Shop.first %>
|
||||
|
||||
<!-- -->
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="page-header" style="width:100%;text-align:center;background-color:#ddd;">
|
||||
<h4 style="color : #ef404a;font-weight:bold;font-style:italic;"><%= shop.name %></h4>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<%= shop.address %>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<%= shop.phone_no %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="card">
|
||||
<div class="page-header" style="width:100%;text-align:center;background-color:#ddd;">
|
||||
<h4 style="color : #ef404a;font-weight:bold;font-style:italic;margin-bottom:0px;"><%= shop.name %></h4>
|
||||
</div>
|
||||
<div class="card-block" style="text-align:center;background-color:#ddd;padding:0rem;">
|
||||
<%= shop.address %>
|
||||
</div>
|
||||
<div class="card-block" style="text-align:center;background-color:#ddd;padding:0rem;">
|
||||
<%= shop.phone_no %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: auto;
|
||||
background-color: #ef404a;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
197
app/views/oqs/home/bkindex.html.erb
Normal file
197
app/views/oqs/home/bkindex.html.erb
Normal file
@@ -0,0 +1,197 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab">Processed <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li>
|
||||
|
||||
<% # For Tab Disable for Station is inactive
|
||||
status=""
|
||||
@queue_stations_items.each do |qsi|
|
||||
if qsi[:is_active] == false
|
||||
status="disabled"
|
||||
end
|
||||
%>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href=<%= '#' + qsi[:station_name].gsub(' ', '_') %> role="tab" <%= status %>>
|
||||
<%= qsi[:station_name] %>
|
||||
<span class="badge badge-pill badge-default" id=<%= qsi[:station_name].gsub(' ', '_') + '_count' %>>
|
||||
<%= qsi[:item_count] %>
|
||||
</span>
|
||||
<% if qsi[:is_ap] %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed -->
|
||||
<div class="tab-pane active" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@queue_completed_item.each do |qid|
|
||||
%>
|
||||
<div class="card queue_station">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span class="order-zone-type"><%= qid.type %> - </span>
|
||||
<span class="order-zone"><%= qid.zone %></span>
|
||||
<small class="pull-right"><%= qid.order_id %></small>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="order-item">
|
||||
<%= qid.item_name %>
|
||||
</span> [x
|
||||
<span class="order-qty">
|
||||
<%= qid.qty %>
|
||||
</span> ]
|
||||
</h4>
|
||||
|
||||
<p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
|
||||
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at
|
||||
<span class="order-at">
|
||||
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
|
||||
</span> -
|
||||
<span class="order-by">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</small>
|
||||
</p>
|
||||
<p class="hidden order-status">completed</p>
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Panel 0 - Completed -->
|
||||
|
||||
<!-- Order Item for Queue Station -->
|
||||
<%
|
||||
@queue_stations_items.each do |qsi|
|
||||
%>
|
||||
<!-- Generated Pane -->
|
||||
<div class="tab-pane" id=<%= qsi[:station_name].gsub(' ', '_') %> role="tabpanel">
|
||||
<!--- Order Items -->
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@queue_items_details.each do |qid|
|
||||
if qid.price != 0
|
||||
if qid.zone_id == qsi[:zone_id] && qid.station_name == qsi[:station_name]
|
||||
%>
|
||||
<div class="card queue_station">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span class="order-zone-type"><%= qid.type %> - </span>
|
||||
<span class="order-zone"><%= qid.zone %></span>
|
||||
<small class="pull-right"><%= qid.order_id %></small>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="order-item"><%= qid.item_name %></span> [x
|
||||
<span class="order-qty"><%= qid.qty %></span> ]
|
||||
</h4>
|
||||
|
||||
<p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
|
||||
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at
|
||||
<span class="order-at">
|
||||
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
|
||||
</span> -
|
||||
<span class="order-by">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</small>
|
||||
</p>
|
||||
<!-- Hidden Fields for Items -->
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id=<%= 'edit_' + qid.assigned_order_item_id.to_s %> class="btn btn-warning order-item order-item-edit">EDIT</button>
|
||||
<button id=<%= 'assigned_queue_' + qid.assigned_order_item_id.to_s %> class="btn btn-primary order-item order-complete">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end of Pane -->
|
||||
<% end %>
|
||||
<!-- End Order Item for Queue Station -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">ORDER DETAILS - Table</strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:33%; text-align:left">Order By</th>
|
||||
<th style="width:33%; text-align:right">Order At</td>
|
||||
<th style="width:33%; text-align:right">Customer</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td id="order-by" style="width:33%; text-align:left"></td>
|
||||
<td id="order-at" style="width:33%; text-align:right"></td>
|
||||
<td id="order-customer" style="width:33%; text-align:right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Table/Room</strong></td>
|
||||
<td id="order-from" colspan="2"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" style="min-height:360px; max-height:360px; overflow:auto">
|
||||
<table class="table" id="oqs-order-details-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:80%; text-align:left">Items</th>
|
||||
<th style="width:20%; text-align:right">QTY</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Bind With JS -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three--->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- OQS Buttons -->
|
||||
<button type="button" title="Print Order Item" id="print_order_item" class="btn btn-primary btn-lg btn-block">Print</a>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" id="print_order_summary">Print <br/>Order<br/>Summary</button>
|
||||
<a href="<%= dashboard_path %>" class="btn btn-primary btn-lg btn-block" role="button" aria-haspopup="true"> Back </a>
|
||||
<!-- <button type="button" class="" id="print_order_summary">Print <br/>Order<br/>Summary</button> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,39 +1,63 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<div class="col-md-6">
|
||||
<%= form_tag oqs_root_path, :method => :get do %>
|
||||
<div class="form-group col-md-4">
|
||||
<input type="text" name="filter" class="form-control input-sm" placeholder="" style="margin-right: 10px">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1">
|
||||
<input type="submit" value="Search" class='btn btn-primary btn-sm'>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab">Processed <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
<!-- <li class="nav-item nav-search <%= @filter.to_s.length > 0? " " : "hide"%>">
|
||||
<a class="nav-link <%= @filter.to_s.length > 0? "active" : " "%>" data-toggle="tab" href="#search" role="tab">Searching .. <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li> -->
|
||||
<li class="nav-item nav-completed">
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Processed <span class="badge badge-pill badge-default" id="completed_count"><%= @queue_completed_item.length %></span></a>
|
||||
</li>
|
||||
|
||||
<%
|
||||
# For Tab Disable for Station is inactive
|
||||
<% # For Tab Disable for Station is inactive
|
||||
status=""
|
||||
@queue_stations_items.each do |qsi|
|
||||
if qsi[:is_active] == false
|
||||
@queue_stations.each do |qsi|
|
||||
if qsi.is_active == false
|
||||
status="disabled"
|
||||
end
|
||||
%>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href=<%= '#' + qsi[:station_name].gsub(' ', '_') %> role="tab" <%= status %>>
|
||||
<%= qsi[:station_name] %>
|
||||
<span class="badge badge-pill badge-default" id=<%= qsi[:station_name].gsub(' ', '_') + '_count' %>>
|
||||
<%= qsi[:item_count] %>
|
||||
end %>
|
||||
<li class="nav-item oqs_click" >
|
||||
<p class="hidden oqs-id"><%= qsi.id %></p>
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab" <%= status %>>
|
||||
<%= qsi.station_name %>
|
||||
<% if @filter.nil? %>
|
||||
<span class="badge badge-pill badge-default" id=""> <%= qsi.assigned_order_items.where("delivery_status=0").count %>
|
||||
</span>
|
||||
<% if qsi[:is_ap] %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
</a>
|
||||
<%else%>
|
||||
<span class="badge badge-pill badge-default" id="">
|
||||
<% @count.each do |c|%>
|
||||
<% if qsi.id == c.station_id %>
|
||||
<%= c.total %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</span>
|
||||
<%end%>
|
||||
<% if qsi.auto_print %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
<p class="hidden filter"><%= @filter %></p>
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed -->
|
||||
|
||||
<div class="tab-pane active" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@@ -77,66 +101,14 @@
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- End Panel 0 - Completed -->
|
||||
|
||||
<!-- Order Item for Queue Station -->
|
||||
<%
|
||||
@queue_stations_items.each do |qsi|
|
||||
%>
|
||||
<!-- Generated Pane -->
|
||||
<div class="tab-pane" id=<%= qsi[:station_name].gsub(' ', '_') %> role="tabpanel">
|
||||
<!--- Order Items -->
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@queue_items_details.each do |qid|
|
||||
if qid.price != 0
|
||||
if qid.zone_id == qsi[:zone_id] && qid.station_name == qsi[:station_name]
|
||||
%>
|
||||
<div class="card queue_station">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span class="order-zone-type"><%= qid.type %> - </span>
|
||||
<span class="order-zone"><%= qid.zone %></span>
|
||||
<small class="pull-right"><%= qid.order_id %></small>
|
||||
</h4>
|
||||
<h4>
|
||||
<span class="order-item"><%= qid.item_name %></span> [x
|
||||
<span class="order-qty"><%= qid.qty %></span> ]
|
||||
</h4>
|
||||
|
||||
<p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
|
||||
|
||||
<p class="card-text">
|
||||
<small class="text-muted">Order at
|
||||
<span class="order-at">
|
||||
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
|
||||
</span> -
|
||||
<span class="order-by">
|
||||
<%= qid.item_order_by %>
|
||||
</span>
|
||||
</small>
|
||||
</p>
|
||||
<!-- Hidden Fields for Items -->
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id=<%= 'edit_' + qid.assigned_order_item_id.to_s %> class="btn btn-warning order-item order-item-edit">EDIT</button>
|
||||
<button id=<%= 'assigned_queue_' + qid.assigned_order_item_id.to_s %> class="btn btn-primary order-item order-complete">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end of Pane -->
|
||||
<% end %>
|
||||
<!-- End Order Item for Queue Station -->
|
||||
<!--- Order Items -->
|
||||
<div class="card-columns oqs_append" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
</div>
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -197,4 +169,6 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
@@ -108,7 +108,7 @@
|
||||
<button id="cash_in" type="button" class="btn btn-block btn-primary"> Cash In </button>
|
||||
<button id="cash_out" type="button" class="btn btn-block btn-primary"> Cash Out </button>
|
||||
<!-- Temporary Disabled -->
|
||||
<%if current_login_employee.role == "cashier" %>
|
||||
<%if current_login_employee.role == "cashier" && @shop.quick_sale_summary == true%>
|
||||
<button id="sale_summary" type="button" class="btn btn-block btn-primary">Sale Sammary</button>
|
||||
<%end%>
|
||||
<button id="close_cashier" type="button" class="btn btn-block btn-primary"> Close Cashier </button>
|
||||
|
||||
@@ -55,11 +55,29 @@
|
||||
<td><%= amount.total_price.round(2) %></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
<% if !@total_member_discount[0].member_discount.nil?
|
||||
@member_discount = @total_member_discount[0].member_discount rescue 0.0
|
||||
@overall = @shift.total_discounts - @member_discount
|
||||
%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Overall Discount Amount</th>
|
||||
<th><%= @shift.total_discounts %></th>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Member Discount</th>
|
||||
<th><%= @member_discount %></th>
|
||||
</tr>
|
||||
<%else @overall = @shift.total_discounts %>
|
||||
|
||||
<%end%>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Overall Discount</th>
|
||||
<th><%= @overall %></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right;"> Total Discount</th>
|
||||
<th><%= @shift.total_discounts %></th>
|
||||
</tr>
|
||||
|
||||
<% @sale_taxes.each do |tax| %>
|
||||
<tr>
|
||||
@@ -98,6 +116,7 @@
|
||||
<th><%=@shift.credit_sales %></th>
|
||||
</tr>
|
||||
<% @total_amount = 0
|
||||
|
||||
@other_payment.each do |other| %>
|
||||
<tr>
|
||||
<th></th>
|
||||
@@ -107,32 +126,32 @@
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">MPU Payment </td>
|
||||
<td><%=other.mpu_amount.round(2) %></td>
|
||||
<% @total_amount = @total_amount+other.mpu_amount %>
|
||||
<td><%=other.mpu_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.mpu_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">VISA Payment </td>
|
||||
<td><%=other.visa_amount.round(2) %></td>
|
||||
<% @total_amount = @total_amount+other.visa_amount %>
|
||||
<td><%=other.visa_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.visa_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">JCB Payment </td>
|
||||
<td><%=other.master_amount.round(2) %></td>
|
||||
<% @total_amount = @total_amount+other.master_amount %>
|
||||
<td><%=other.master_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.master_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">Master Payment </td>
|
||||
<td><%=other.jcb_amount.round(2) %></td>
|
||||
<% @total_amount = @total_amount+other.jcb_amount %>
|
||||
<td><%=other.jcb_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.jcb_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td style="text-align: right;">Reedem Payment </td>
|
||||
<td><%=other.paypar_amount.round(2) %></td>
|
||||
<% @total_amount = @total_amount+other.paypar_amount %>
|
||||
<td><%=other.paypar_amount.round(2) rescue 0.0 %></td>
|
||||
<% @total_amount = @total_amount+other.paypar_amount rescue 0.0 %>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
|
||||
5
app/views/origami/voucher/create.json.jbuilder
Normal file
5
app/views/origami/voucher/create.json.jbuilder
Normal file
@@ -0,0 +1,5 @@
|
||||
if(@status)
|
||||
json.status @status
|
||||
else
|
||||
json.status false
|
||||
end
|
||||
179
app/views/origami/voucher/index.html.erb
Normal file
179
app/views/origami/voucher/index.html.erb
Normal file
@@ -0,0 +1,179 @@
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>Voucher / Coupon</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="margin-top:10px;padding-top:20px;">
|
||||
<div class="rebate-form">
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">You can pay up to </label>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_voucher %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @vouchercount != 0 %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Recent Voucher paid amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@vouchercount %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="<%=@sale_id %>" class="form-control col-lg-7 col-md-7 col-sm-7 float-value" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
|
||||
<!-- <div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div> -->
|
||||
<input type="text" name="" id="amount" class="form-control col-lg-7 col-md-7 col-sm-7 float-value" value="" data-value="amount" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number " data-value="1" data-type="num">1</div>
|
||||
<div class=" cashier_number left" data-value="2" data-type="num">2</div>
|
||||
<div class=" cashier_number left" data-value="3" data-type="num">3</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number " data-value="4" data-type="num">4</div>
|
||||
<div class=" cashier_number left" data-value="5" data-type="num">5</div>
|
||||
<div class=" cashier_number left" data-value="6" data-type="num">6</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number " data-value="7" data-type="num">7</div>
|
||||
<div class=" cashier_number left" data-value="8" data-type="num">8</div>
|
||||
<div class=" cashier_number left" data-value="9" data-type="num">9</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number " data-value="0" data-type="num">0</div>
|
||||
<div class=" cashier_number left" data-value="." data-type="num">.</div>
|
||||
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class=" cashier_number green" data-type="nett" >Nett</div>
|
||||
<div class=" cashier_number red left" data-type="del">Del</div>
|
||||
<div class=" cashier_number orange left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-1 col-sm-1">
|
||||
<div class="row bottom">
|
||||
<div class="cashier_number long" data-value="1000" data-type="add">1000</div>
|
||||
<div class="cashier_number long left" data-value="3000" data-type="add">3000</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="cashier_number long" data-value="5000" data-type="add">5000</div>
|
||||
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="pay purple" id="voucher_pay">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||
else {
|
||||
$('#validamount').attr("value",parseFloat("<%= @can_voucher %>") - parseFloat(localStorage.getItem("cash")));
|
||||
}
|
||||
});
|
||||
// number key pad
|
||||
var float_value = ""
|
||||
var total = 0
|
||||
|
||||
$(document).on('focusout', '.float-value', function(event){
|
||||
float_value = $(this).attr("data-value");
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#'+float_value).val();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
var input_type = $(this).attr("data-type");
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#'+float_value).val(input_value);
|
||||
}else{
|
||||
$('#'+float_value).val(original_value+input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#'+float_value).val(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#'+float_value).val("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#'+float_value).val();
|
||||
$('#'+float_value).val(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
case 'nett':
|
||||
var remain_amount = $('#validamount').val();
|
||||
$('#'+float_value).val(remain_amount);
|
||||
break;
|
||||
|
||||
}
|
||||
event.handled = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
$('#voucher_pay').on('click',function(){
|
||||
var amount = $('#amount').val();
|
||||
var refnumber = $("#<%=@sale_id %>").val();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) ){
|
||||
// alert(amount);
|
||||
// alert(refnumber);
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_voucher_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id+ "&refnumber="+ refnumber,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("Paid Amount is over!");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! dining_charge, :id, :created_at, :updated_at
|
||||
json.url dining_charge_url(dining_charge, format: :json)
|
||||
18
app/views/settings/dining_charges/_form.html.erb
Normal file
18
app/views/settings/dining_charges/_form.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<%= simple_form_for([:settings,@zone,@settings_dining_facility,@dining_charge]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :item_code %>
|
||||
<%= f.input :unit_price %>
|
||||
<%= f.input :taxable %>
|
||||
<%= f.input :charge_type %>
|
||||
<%= f.input :minimum_free_time %>
|
||||
<%= f.input :charge_block %>
|
||||
<%= f.input :time_rounding %>
|
||||
<%= f.input :time_rounding_block %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
19
app/views/settings/dining_charges/edit.html.erb
Normal file
19
app/views/settings/dining_charges/edit.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<!-- <h1>Editing Dining Charge</h1>
|
||||
|
||||
<%= render 'form', dining_charge: @dining_charge %>-->
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_path(@zone) %>">Zone</a></li>
|
||||
<% if @table %>
|
||||
<li><a href="<%= edit_settings_zone_table_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
|
||||
<% elsif @room %>
|
||||
<li><a href="<%= edit_settings_zone_room_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
|
||||
<% end %>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', dining_charge: @dining_charge %>
|
||||
</div>
|
||||
25
app/views/settings/dining_charges/index.html.erb
Normal file
25
app/views/settings/dining_charges/index.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Dining Charges</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @dining_charges.each do |dining_charge| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', dining_charge %></td>
|
||||
<td><%= link_to 'Edit', edit_dining_charge_path(dining_charge) %></td>
|
||||
<td><%= link_to 'Destroy', dining_charge, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Dining Charge', new_dining_charge_path %>
|
||||
1
app/views/settings/dining_charges/index.json.jbuilder
Normal file
1
app/views/settings/dining_charges/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @dining_charges, partial: 'dining_charges/dining_charge', as: :dining_charge
|
||||
18
app/views/settings/dining_charges/new.html.erb
Normal file
18
app/views/settings/dining_charges/new.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<!-- <h1>New Dining Charge</h1>
|
||||
|
||||
<%= render 'form', dining_charge: @dining_charge %> -->
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_zone_path(@zone) %>">Zone</a></li>
|
||||
<% if @table %>
|
||||
<li><a href="<%= edit_settings_zone_table_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
|
||||
<% elsif @room %>
|
||||
<li><a href="<%= edit_settings_zone_room_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
|
||||
<% end %>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', dining_charge: @dining_charge %>
|
||||
</div>
|
||||
4
app/views/settings/dining_charges/show.html.erb
Normal file
4
app/views/settings/dining_charges/show.html.erb
Normal file
@@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_dining_charge_path(@dining_charge) %> |
|
||||
<%= link_to 'Back', dining_charges_path %>
|
||||
1
app/views/settings/dining_charges/show.json.jbuilder
Normal file
1
app/views/settings/dining_charges/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "dining_charges/dining_charge", dining_charge: @dining_charge
|
||||
@@ -16,6 +16,7 @@
|
||||
<th style="width:20%">Name</th>
|
||||
<th style="width:20%">Role</th>
|
||||
<th style="width:20%">Created At</th>
|
||||
<th style="width:20%">Updated At</th>
|
||||
<th style="width:20%">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -26,6 +27,7 @@
|
||||
<td><%= link_to employee.name,settings_employee_path(employee) %></td>
|
||||
<td><%= employee.role %></td>
|
||||
<td><%= employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_settings_employee_path(employee) %>
|
||||
<%if employee.role != "administrator"%>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employee</a></li>
|
||||
|
||||
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
@@ -15,7 +15,8 @@
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Role</th>
|
||||
|
||||
<th>Created At</th>
|
||||
<th>Updated At</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -24,6 +25,8 @@
|
||||
<tr>
|
||||
<td><%= @employee.name %></td>
|
||||
<td><%= @employee.role %></td>
|
||||
<td><%= @employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= @employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_settings_employee_path(@employee) %>
|
||||
</td>
|
||||
@@ -34,4 +37,3 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,6 +7,26 @@
|
||||
<%= f.input :seater %>
|
||||
<%= f.input :order_by %>
|
||||
<%= f.input :is_active %>
|
||||
<% if @settings_table.dining_charges.length == 0 %>
|
||||
<div class="div-border">
|
||||
<div class="col-md-10">
|
||||
<%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn btn-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<% @settings_table.dining_charges.each do |dc| %>
|
||||
<div class="div-border">
|
||||
<div class="col-md-10"><b><u>Dining Charge</u></b></div>
|
||||
<div class="col-md-10">item code : <%= dc.item_code %></div>
|
||||
<div class="col-md-10">Unit price : <%= dc.unit_price %></div>
|
||||
<div class="col-md-10">Charge type : <%= dc.charge_type %></div>
|
||||
<div class="col-md-10">
|
||||
<%= link_to 'Edit Charges', edit_settings_zone_table_dining_charge_path(@zone,@settings_table,dc),:class => 'btn btn-primary' %>
|
||||
<!-- <button class="btn btn-primary" src="<%= edit_settings_zone_table_dining_charge_path(@zone,@settings_table,dc) %>">Edit Charge</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
|
||||
Reference in New Issue
Block a user