This commit is contained in:
Myat Zin Wai Maw
2019-12-13 10:12:08 +06:30
parent 79598c0126
commit f45849de49
39 changed files with 123 additions and 1121 deletions

View File

@@ -440,82 +440,8 @@
</div>
</div>
</div>
<% if type && !modify_order%>
<div class="modal fade" id="TableModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="margin-top: -1rem;">
<!-- <h4 class="modal-title" id="TableModalLabel">Select Table</h4> -->
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;">&times;</button>
</div>
<div class="modal-body" style="margin-top: -0.75rem;padding-top:5px">
<%@zone.each do |zone| %>
<h5>Zone : <%=zone.name%></h5>
<div class="card-columns" style="column-count: 7;">
<%zone.tables.each do |table| %>
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<% color="red"%>
<% else %>
<% color="orange"%>
<% end %>
<% else %>
<% if table.get_checkout_booking.nil? %>
<% color="blue"%>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
<% else %>
<% color="green"%>
<% end %>
<div class="card tables <%=color%> text-white table_<%= table.id %>" data-id="<%= table.id %>" data-type="<%= table.type %>" data-name="<%= table.name %>">
<div class="card-block">
<%= table.name %>
</div>
</div>
<%end%>
<%zone.rooms.each do |table| %>
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<% color="red"%>
<% else %>
<% color="orange"%>
<% end %>
<% else %>
<% if table.get_checkout_booking.nil? %>
<% color="blue"%>
<% else %>
<% color="orange"%>
<% end %>
<% end %>
<% else %>
<% color="green"%>
<% end %>
<div class="card tables <%=color%> text-white table_<%= table.id %>" data-id="<%= table.id %>" data-type="<%= table.type %>" data-name="<%= table.name %>">
<div class="card-block">
<%= table.name %>
</div>
</div>
<%end%>
</div>
<%end%>
<div class="modal-footer p-r-30">
<button type="button" class="btn btn-link btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
&nbsp; &nbsp;
<button type="button" class="btn btn-link bg-blue waves-effect confirm_table" data-dismiss="modal">Confirm</button>
</div>
</div>
</div>
</div>
</div>
<% end %>
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
</div>
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
</div>
<style type="text/css">
.fadeInRight{
-webkit-animation-duration: 350ms !important;

View File

@@ -1,101 +0,0 @@
<div class="container-fluid">
<div class='row'>
<div class="col-lg-10 col-md-10 col-sm-10">
<h2> <%= t :cash_in %> </h2>
<br>
<table class='table table-striped'>
<tr>
<td> <%= t :payment_reference %>
</td>
<td>
<input type="text" class="form-control" placeholder="Reference" id="reference">
</td>
</tr>
<tr>
<td> <%= t("views.right_panel.detail.remark") %>
</td>
<td>
<input type="text" class="form-control" placeholder="Remark" id="remark">
</td>
</tr>
<tr>
<td> <%= t :payment_method %>
</td>
<td>
<button class='btn bg- waves-effect payment-type' data-id='cash' id='cash' style="background-color: #7a62d3;"><%= t("views.btn.cash") %></button>
<button class='btn bg- waves-effect payment-type' data-id='mpu' id='mpu' style="background-color: #7a62d3;"><%= t("views.btn.mpu") %></button>
<button class='btn bg- waves-effect payment-type' data-id='visa' id='visa' style="background-color: #7a62d3;"><%= t("views.btn.visa") %></button>
<button class='btn bg- waves-effect payment-type' data-id='jcb' id='jcb' style="background-color: #7a62d3;"><%= t("views.btn.jcb") %></button>
</td>
</tr>
<tr>
<td> <%= t :reference_number %>
</td>
<td>
<input type="text" class="form-control" id="payment_method_reference">
</td>
</tr>
<tr>
<td> <%= t("views.right_panel.detail.amount") %>
</td>
<td>
<input type="text" class="form-control" placeholder="Amount" id="amount">
</td>
</tr>
</table>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 ">
<br>
<div class="button-demo m-t-40">
<button type="button" class="btn bg-default waves-effect btn-" id='back'><i class="material-icons">reply</i> <%= t("views.btn.back") %> </button>
<button type="button" class="btn bg-blue waves-effect btn-" id='cash_in'> <%= t("views.btn.cash_in") %> </button>
</div>
</div>
</div>
</div>
<script>
cashier_type = '<%= @cashier_type %>';
console.log(cashier_type)
var payment_method = "";
$('.payment-type').on('click',function(){
$('.payment-type').css("background-color","#7a62d3");
$(this).css("background-color","green");
var type = $(this).attr('data-id')
if(type == 'cash'){
payment_method = 'cash';
}else if(type == 'mpu'){
payment_method = "mpu";
}else if(type == 'visa'){
payment_method = "visa";
}else if(type == 'jcb'){
payment_method = "jcb";
}
})
$('#cash_in').on('click',function(){
var reference = $('#reference').val();
var remark = $('#remark').val();
var amount = $('#amount').val();
var payment_method_reference = $('#payment_method_reference').val();
$.ajax({type: "POST",
url: "<%= foodcourt_cash_ins_path %>",
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount + "&payment_method="+payment_method + "&payment_method_reference="+ payment_method_reference,
success:function(result){
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
}else{
window.location.href = '/foodcourt';
}
}
});
})
$('#back').on('click',function(){
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
}else{
window.location.href = '/foodcourt';
}
})
</script>

View File

@@ -1,2 +0,0 @@
<h1>CashMgmt#create</h1>
<p>Find me in app/views/cash_mgmt/create.html.erb</p>

View File

@@ -1,2 +0,0 @@
<h1>CashMgmt#index</h1>
<p>Find me in app/views/cash_mgmt/index.html.erb</p>

View File

@@ -1,3 +0,0 @@
<h1>CashMgmt#new</h1>
<p>Find me in app/views/cash_mgmt/new.html.erb</p>

View File

@@ -1,53 +0,0 @@
<div class="container-fluid">
<div class='row'>
<div class="col-lg-10 col-md-10 col-sm-10">
<h2><%= t :cash_out %></h2>
<table class='table table-striped'>
<tr>
<td> <%= t :payment_reference %></td>
<td><input type="text" class="form-control" placeholder="Reference" id="reference"></td>
</tr>
<tr>
<td> <%= t("views.right_panel.detail.remark") %></td>
<td><input type="text" class="form-control" placeholder="Remark" id="remark"></td>
</tr>
<tr>
<td> <%= t("views.right_panel.detail.amount") %> </td>
<td><input type="text" class="form-control" placeholder="Amount" id="amount"></td>
</tr>
</table>
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<br><br>
<button type="button" class="btn bg-default btn-block" id='back'> <i class="material-icons">reply</i><%= t("views.btn.back") %> </button>
<button type="button" class="btn bg-blue btn-block" id='cash_out'> <%= t("views.btn.cash_out") %> </button>
</div>
</div>
</div>
<script>
cashier_type = '<%= @cashier_type %>';
$('#cash_out').on('click',function(){
var reference = $('#reference').val();
var remark = $('#remark').val();
var amount = $('#amount').val();
$.ajax({type: "POST",
url: "<%= foodcourt_cash_outs_path %>",
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount,
success:function(result){
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
}else{
window.location.href = '/foodcourt';
}
}
});
})
$('#back').on('click',function(){
if (cashier_type == 'quick_service' || cashier_type == 'food_court') {
window.location.href = '/foodcourt/'+cashier_type+'/pending_order';
}else{
window.location.href = '/foodcourt';
}
})
</script>

View File

@@ -1,281 +0,0 @@
<div class="container-fluid">
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<div class="block-header">
<!-- <h2><%= t :dashboard %></h2> -->
<h2><%= t :date_time %> : <%= Time.zone.now.utc.getlocal.strftime("%Y-%m-%d %I:%M %p") %></h2>
</div>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end
%>
<!-- Widgets -->
<div class="row clearfix">
<% if @quick_service == '1' %>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 qs_view">
<div class="info-box bg-purple">
<div class="icon" >
<i class="material-icons">arrow_forward</i>
</div>
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :quick_service %></div>
</div>
</div>
<% end %>
<% if @food_court == '1' %>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 fc_view">
<div class="info-box bg-pink">
<div class="icon" >
<i class="material-icons">arrow_forward</i>
</div>
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= @food_court_name %></div>
</div>
</div>
<% end %>
<% if @dinein_cashier == '1' %>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 cashier_view">
<div class="info-box bg-green">
<div class="icon" >
<i class="material-icons">arrow_forward</i>
</div>
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_cashier %></div>
</div>
</div>
<% end %>
<% if @reservation == '1' %>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 reservation">
<div class="info-box bg-orange">
<div class="icon" >
<i class="material-icons">arrow_forward</i>
</div>
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :reservation %></div>
</div>
</div>
<% end %>
<% if @order_reservation == '1' %>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-10 order_reservation">
<div class="info-box bg-blue">
<div class="icon" >
<i class="material-icons">arrow_forward</i>
</div>
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :order_reservation %></div>
</div>
</div>
<% end %>
</div>
<!-- #END# Widgets -->
<% if !@current_user.nil? && @current_user.role != 'waiter' && @setting_flag %>
<!-- CPU Usage -->
<div class="row clearfix">
<% if !@summ_sale.nil? %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h6><%= t :sale %></h6>
<table class="table">
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
<td align="right"><%= @summ_sale.total_receipt %></td>
</tr>
<tr>
<% revenue = @summ_sale.total_amount - @summ_sale.total_discount%>
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
<td align="right"><%= number_with_precision( revenue, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
</table>
<table class="table">
<% if !(@total_payment_methods.nil?) %>
<% @total_payment_methods.each do |payment| %>
<% if !@sale_data[0].empty? %>
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
<tr>
<% if payment.payment_method == 'paypar' %>
<td>Redeem Sale : </td>
<% else %>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% end %>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
<%= data[""+pay_mth+""] %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
<% end %>
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
<% if !total_card.nil? %>
<tr>
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
<td align="right">
<%= total_card["card"].to_f %>
</td>
</tr>
<% end %>
<% end %>
</table>
</div>
</div>
</div>
<% end %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h6><%= t :customer %></h6>
<table class="table">
<% if !@total_customer.nil? %>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :customer %> : </td>
<td align="right"><%= @total_customer %></td>
</tr>
<% end %>
<% if !@total_dinein.nil? %>
<tr>
<td><%= t("views.right_panel.detail.dine_in") %> : </td>
<td align="right"><%= @total_dinein %></td>
</tr>
<% end %>
<% if !@total_takeaway.nil? %>
<tr>
<td><%= t("views.right_panel.detail.takeaway") %> : </td>
<td align="right"><%= @total_takeaway %></td>
</tr>
<% end %>
<!-- <% if !@total_other_customer.nil? %>
<tr>
<td><%= t :customer %> : </td>
<td align="right"><%= @total_other_customer.total_cus %></td>
</tr>
<% end %> -->
<% if !@total_membership.nil? %>
<tr>
<td><%= t("views.right_panel.detail.membership") %> : </td>
<td align="right"><%= @total_membership %></td>
</tr>
<% end %>
</table>
</div>
</div>
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h6><%= t("views.right_panel.detail.order") %></h6>
<table class="table">
<% if !@total_order.nil? %>
<tr>
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.order") %> : </td>
<td align="right" width="60px"><%= @total_order.total_order %></td>
</tr>
<% end %>
<% if !@total_accounts.nil? %>
<% @total_accounts.each do |account| %>
<tr>
<td width="40px"><%= account.title %> (Account) : </td>
<td align="right" width="60px">
<% @account_data.each do |data| %>
<% acc = account.title %>
<%= data[""+acc+""] %> <% if !data[''+acc+''].nil? %> ( <%= data[''+acc+'_amount'] %> ) <% end %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
<% if !@top_items.nil? %>
<tr>
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
<td align="right" width="60px"><%= @top_items.item_name %>
<br>(<%= @top_items.item_total_price %>)</td>
</tr>
<% end %>
<% if !@total_foc_items.nil? %>
<tr>
<td width="40px"><%= t("views.right_panel.detail.total") %> <%= t("views.btn.foc") %> <%= t("views.right_panel.detail.item") %> : </td>
<td align="right" width="60px"><%= @total_foc_items.to_int %></td>
</tr>
<% end %>
</table>
</div>
</div>
</div>
</div>
<% end %>
</div>
<button type="button" data-href="<%=foodcourt_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect second_view hidden" style="height: 45px">Customer View</button>
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
<script>
$(function() {
$("#loading_wrapper").show();
getAllMenu();
$(".cashier_view").on('click', function() {
window.location.href = '/foodcourt';
});
$(".qs_view").on('click', function() {
var display_type = '<%= @display_type %>';
if (display_type.length>0) {
display_type = '<%= @display_type %>';
}else{
display_type = null;
}
if ($('#server_mode').val() != "cloud" && display_type == 2) {
document.getElementById('second_view').click();
}
window.location.href = '/foodcourt/quick_service';
});
$(".fc_view").on('click', function() {
var display_type = '<%= @display_type %>';
if (display_type.length>0) {
display_type = '<%= @display_type %>';
}else{
display_type = null;
}
if ($('#server_mode').val() != "cloud" && display_type == 2) {
document.getElementById('second_view').click();
}
window.location.href = '/foodcourt/food_court';
});
$(".order_reservation").on('click', function() {
window.location.href = '/foodcourt/order_reservation';
});
$("#second_view").on('click', function () {
var url = $(this).attr("data-href");
window.open(url,'_blank');
});
$(".reservation").on("click", function(){
window.location.href = '/foodcourt/reservation';
});
});
</script>

View File

@@ -1,7 +0,0 @@
if @status == true
#show invoice number and stuff
json.status @status
else
json.status @status
json.error_message @error_message
end

View File

@@ -1,149 +0,0 @@
<%= stylesheet_link_tag 'reservation', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'reservation', 'data-turbolinks-track': 'reload' %>
<div class="container-fluid">
<div class="row">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
<div class="card" id="make-reservation-slimscroll" data-height="-50">
<div class="card-header">
<h5 class="card-title text-center bg-faded"><%= t :make_reservation %></h5>
</div>
<div class="card-body">
<div class="wizard">
<div class="wizard-inner">
<div class="active-line"></div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="nav-item">
<div class="connecting-line border-right"></div>
<a href="#reservation" class="nav-link active" data-toggle="tab" aria-controls="reservation" role="tab" title="Reservation">
<span class="round-tab">
1
</span>
</a>
</li>
<li role="presentation" class="nav-item disabled">
<div class="connecting-line"></div>
<a href="#personal_detail" class="nav-link disable" data-toggle="tab" aria-controls="personal_detail" role="tab" title="Personal Detail">
<span class="round-tab">
2
</span>
</a>
</li>
</ul>
</div> <!-- .end.wizard-inner -->
<div class="tab-content">
<div class="tab-pane active" role="tabpanel" id="reservation">
<div class="form-row">
<div class="col-sm-12 col-md-12 col-lg-12">
<label class="font-12 radio-inline">
<input type="radio" name="reservation_type" checked class="radio-col-indigo reservation_type" value="0"><%= t("views.right_panel.detail.dine_in") %>
</label>&nbsp;
<label class="font-12 radio-inline">
<input type="radio" name="reservation_type" class="radio-col-indigo reservation_type" value="1"><%= t :room %>
</label>
</div>
</div>
<div class="dining_type">
<div class="form-row clearfix">
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<input class="form-control check_in_date datepicker" name="check_in_date" id="check_in_date" type="text" placeholder="Check-in Date">
</div>
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<input class="form-control check_out_date datepicker" name="check_out_date" id="check_out_date" type="text" placeholder="Check Out Date">
</div>
</div>
<div class="form-row clearfix">
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<input class="form-control check_in_time timepicker" name="check_in_time" id="check_in_time" type="text" placeholder="Check-in Time">
</div>
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<input class="form-control check_out_time timepicker" name="check_out_time" id="check_out_time" type="text" placeholder="Check Out Time">
</div>
</div>
</div>
<div class="room_type">
<div class="form-row clearfix">
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<input class="form-control check_in_date datepicker" name="check_in_date" id="check_in_date" type="text" placeholder="Check-in Date">
</div>
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<input class="form-control check_out_date datepicker" name="check_out_date" id="check_out_date" type="text" placeholder="Check Out Date">
</div>
</div>
<div class="form-row clearfix">
<div class="form-group col-sm-12 col-md-12 col-lg-12">
<label for="room_count" class="control-label">ROOMS</label>
<input type="number" class="form-control number_limit" name="room_count" id="room_count" data-type="room" value="1">
</div>
</div>
</div>
<div class="form-row clearfix">
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<label for="adult_count" class="control-label">ADULT</label>
<input type="number" class="form-control number_limit" name="adult_count" id="adult_count" data-type="adult" value="1">
</div>
<div class="form-group col-sm-6 col-md-6 col-lg-6">
<label for="child_count" class="control-label">CHILD</label>
<input type="number" class="form-control number_limit" name="child_count" id="child_count" data-type="child">
</div>
</div>
<div class="row text-center">
<div class="form-group col-sm-12 col-md-12 col-lg-12">
<button class="btn bg-blue btn-lg waves-effect">CHECK AVAILABLE</button>
<button class="btn bg-blue btn-lg waves-effect next-step">NEXT</button>
</div>
</div>
</div><!-- .end.tab-panel .reservation -->
<div class="tab-pane" role="tabpanel" id="personal_detail">
<div class="form-row">
<div class="form-group col-sm-12 col-md-12 col-lg-12">
<input class="form-control" name="name" id="name" type="text" placeholder="NAME">
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-12 col-md-12 col-lg-12">
<input class="form-control" name="contact_no" id="contact_no" type="number" placeholder="PHONE NUMBER">
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-12 col-md-12 col-lg-12">
<input class="form-control" name="address" id="address" type="text" placeholder="ADDRESS">
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-12 col-md-12 col-lg-12">
<label for="reservation_note" class="control-label">RESERVATION NOTE</label>
<textarea rows="3" id="reservation_note" name="reservation_note" class="form-control"></textarea>
</div>
</div>
<div class="row text-center">
<div class="form-group col-sm-12 col-md-12 col-lg-12">
<button class="btn bg-blue btn-lg prev-step">PREV</button>
<button class="btn bg-blue btn-lg">SUBMIT</button>
</div>
</div>
</div>
</div><!-- .end.tab-content .personal_detail -->
</div> <!-- .end.wizard -->
</div>
</div>
</div>
<div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
<div class="card font-13">
<div class="row clearfix">
<div class="col-xs-7 col-sm-7 col-md-7 col-lg-7" id="process-reservation-slimscroll" data-height="-80">
</div>
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5" id="reservation-info-slimscroll" data-height="-80">
</div>
</div>
</div>
</div>
</div>
</div>