nfc done
This commit is contained in:
@@ -85,7 +85,7 @@ class HomeController < ApplicationController
|
||||
if !shift.nil?
|
||||
redirect_to origami_root_path
|
||||
else
|
||||
redirect_to crm_customers_path
|
||||
redirect_to dashboard_path
|
||||
end
|
||||
elsif employee.role == "cashier"
|
||||
#check if cashier has existing open cashier
|
||||
|
||||
@@ -112,7 +112,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.delivery_status = true AND odt.price <> 0 AND assigned_order_items.created_at <= ?", Time.now.end_of_day.utc)
|
||||
.where("assigned_order_items.delivery_status = true AND odt.price <> 0 AND assigned_order_items.created_at between #{Time.now.beginning_of_day.utc} and #{Time.now.end_of_day.utc}")
|
||||
.group("assigned_order_items.order_id")
|
||||
|
||||
|
||||
|
||||
@@ -50,12 +50,22 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
def update_sale_by_customer
|
||||
|
||||
id = params[:sale_id][0,3]
|
||||
customer_id = params[:customer_id]
|
||||
|
||||
# Check and find with card no
|
||||
if(!customer_id.include? "CUS")
|
||||
customer = Customer.find_by_paypar_account_no(customer_id)
|
||||
if(customer != nil)
|
||||
customer_id = customer.customer_id
|
||||
end
|
||||
end
|
||||
|
||||
if(id == "SAL")
|
||||
sale = Sale.find(params[:sale_id])
|
||||
status = sale.update_attributes(customer_id: params[:customer_id])
|
||||
status = sale.update_attributes(customer_id: customer_id)
|
||||
sale.sale_orders.each do |sale_order|
|
||||
order = Order.find(sale_order.order_id)
|
||||
status = order.update_attributes(customer_id: params[:customer_id])
|
||||
status = order.update_attributes(customer_id: customer_id)
|
||||
end
|
||||
else
|
||||
@booking = BookingOrder.find_by_order_id(params[:sale_id])
|
||||
@@ -63,7 +73,7 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
|
||||
@orders.each do |bo|
|
||||
order = Order.find(bo.order_id)
|
||||
status = order.update_attributes(customer_id: params[:customer_id])
|
||||
status = order.update_attributes(customer_id: customer_id)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -37,6 +37,7 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
sale_item.unit_price = di["price"]
|
||||
sale_item.taxable_price = 0
|
||||
sale_item.is_taxable = 0
|
||||
sale_item.account_id = 0
|
||||
|
||||
sale_item.price = di["price"]
|
||||
sale_item.save
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
|
||||
<div class="input-append col-md-12 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control input-xs col-md-4">
|
||||
<div class="input-append col-md-7 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" id="search" class="form-control input-xs col-md-9">
|
||||
<button type="submit" class="btn btn-primary btn-md">Search</button>
|
||||
<button id="member_acc_no" class="btn btn-success"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||
<!-- <a href="modal-window" data-toggle= "modal" data-target="#modal-window" class="btn btn-primary btn-md" id="card_read" >Read Card</a> -->
|
||||
|
||||
<!-- <button type="button" class="btn btn-info btn-md" data-toggle="modal" data-target="#myModal">Open Modal</button> -->
|
||||
</div>
|
||||
<% end %>
|
||||
<button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -102,13 +102,11 @@ $(function() {
|
||||
var cardNo = "";
|
||||
$("#sxModal").show();
|
||||
setTimeout(function(){
|
||||
getCardNo;
|
||||
getCardNo();
|
||||
$("#sxModal").hide();
|
||||
},5000);
|
||||
alert($("#search").val());
|
||||
$("#filter_form").submit();
|
||||
},100);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click',".customer_tr",function(){
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
<li><%= link_to "Shift Sale Report", reports_shiftsale_index_path, :tabindex =>"-1" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="navbar-nav mr-auto">
|
||||
<a href="<%= crm_customers_path %>" role="button" aria-haspopup="true" aria-expanded="false"> CRM</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -12,20 +12,20 @@
|
||||
|
||||
<div class="main-box-body clearfix" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<table id="origami-crm-table" class="table table-striped">
|
||||
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<% path ="/origami/#{@sale_id}/customers" %>
|
||||
<%= form_tag path, :method => :get do %>
|
||||
<div class="input-append col-md-12 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" class="form-control input-sm col-md-4">
|
||||
<%= form_tag path, :id => "filter_form", :method => :get do %>
|
||||
<div class="input-append col-md-7 form-group pull-left">
|
||||
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-9">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Search</button>
|
||||
<button class="btn btn-success"><span class="fa fa-credit-card"></span>Member Card</button>
|
||||
</div>
|
||||
<% end %>
|
||||
<button id="member_acc_no" class="btn btn-success btn-sm"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -94,7 +94,6 @@
|
||||
<div class="form-group">
|
||||
<label>Paypar Account No:</label>
|
||||
<div class="input-group">
|
||||
<%= #f.input :paypar_account_no, :id => "paypar_account_no", :class => "form-control" %>
|
||||
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly />
|
||||
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
|
||||
</div>
|
||||
@@ -224,6 +223,23 @@
|
||||
$("#sxModal").hide();
|
||||
},100);
|
||||
});
|
||||
|
||||
// Read Card Reader
|
||||
$("#member_acc_no").on('click', function(e){
|
||||
var cardNo = "";
|
||||
var sale_id = $("#sale_id").val() || 0;
|
||||
var customer_mamber_card_no = 0;
|
||||
$("#sxModal").show();
|
||||
setTimeout(function(){
|
||||
getCardNo();
|
||||
$("#sxModal").hide();
|
||||
customer_mamber_card_no = $("#search").val();
|
||||
|
||||
if(sale_id != 0 && customer_mamber_card_no != 0){
|
||||
update_sale(customer_mamber_card_no,sale_id);
|
||||
}
|
||||
},100);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -236,6 +252,7 @@
|
||||
function setCardNo(cardNo){
|
||||
if(cardNo.length == 16){
|
||||
$("#paypar_account_no").val(cardNo);
|
||||
$("#search").val(cardNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,6 +270,7 @@
|
||||
var url = "customers/"+customer_id;
|
||||
}
|
||||
|
||||
// Need To Clean?
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
|
||||
@@ -107,7 +107,8 @@
|
||||
<button id="refreshbutton" type="button" class="btn btn-block" style="border-radius:5px;color:#fff;background-color:red;"> Refresh off </button>
|
||||
<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>
|
||||
<button id="sale_summary" type="button" class="btn btn-block btn-primary">Sale Sammary</button>
|
||||
<!-- Temporary Disabled -->
|
||||
<!-- <button id="sale_summary" type="button" class="btn btn-block btn-primary">Sale Sammary</button> -->
|
||||
<button id="close_cashier" type="button" class="btn btn-block btn-primary"> Close Cashier </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user