update oqs

This commit is contained in:
Aung Myo
2017-08-11 12:15:30 +06:30
23 changed files with 345 additions and 303 deletions

View File

@@ -23,9 +23,13 @@ $(document).ready(function(){
// setTimeout(function(){
// window.location.reload(1);
// }, 10000);
$(".nav-completed").on("click", function(){
$("#completed").removeClass('hide')
});
$(".oqs_click").on("click", function(){
$("#completed").addClass('hide')
var oqs_id = $(this).find(".oqs-id").text();
var url = 'oqs/get_items/'+oqs_id;
show_details(url);
@@ -42,7 +46,7 @@ $(document).ready(function(){
url: url,
data: {},
dataType: "json",
success: function(data) {
success: function(data) {
for(var field in data) {
var price = parseFloat(data[field].price).toFixed(2);
@@ -52,12 +56,13 @@ $(document).ready(function(){
var options = data.options;
}
var date = data[field]["created_at"];
var date = new Date(data[field]["created_at"]);
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
row ='<div class="card queue_station">'
+'<div class="card-block">'
+'<h4 class="card-title">'
+'<span class="order-zone-type">'+data[field]["zone"]+'- </span>'
+'<span class="order-zone-type">'+data[field]["type"]+'- </span>'
+'<span class="order-zone">'+ data[field]["zone"] +'</span>'
+'<small class="pull-right">'+ data[field]["order_id"] +'- </small>'
+'</h4>'
@@ -71,7 +76,7 @@ $(document).ready(function(){
+'<p class="card-text">'
+'<small class="text-muted">Order at'
+'<span class="order-at">'+ date +'</span> - '
+'<span class="order-at">'+ show_date +'</span> - '
+'<span class="order-by">'+ data[field]["item_order_by"] +'</span> '
+'</small> '
@@ -195,10 +200,7 @@ $(document).ready(function(){
$(document).on('click', '#print_order_item', function(event){
var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text();
var options = $('.selected-item').children('.card-block').find('.item-options').text();
var params = { 'options':options };
console.log(assigned_item_id);
console.log(options);
console.log(params);
var params = { 'options':options };
$.ajax({
type: 'GET',
url: '/oqs/print/print/'+assigned_item_id,

View File

@@ -65,6 +65,7 @@ class Crm::CustomersController < BaseCrmController
# GET /crm/customers/1/edit
def edit
@customer = Customer.find(params[:id])
end
# POST /crm/customers
@@ -78,7 +79,7 @@ class Crm::CustomersController < BaseCrmController
if @crm_customers.save
# update tax profile
customer = Customer.find(@crm_customers.customer_id)
customer.update_attributes(tax_profiles: params[:customer][:tax_profiles].to_json)
customer.update_attributes(tax_profiles: params[:customer][:tax_profiles])
name = customer_params[:name]
phone = customer_params[:contact_no]
email = customer_params[:email]
@@ -195,10 +196,12 @@ end
# PATCH/PUT /crm/customers/1
# PATCH/PUT /crm/customers/1.json
def update
# Remove "" default first
params[:customer][:tax_profiles].delete_at(0)
respond_to do |format|
if @crm_customer.update(customer_params)
# update tax profile
@crm_customer.update_attributes(tax_profiles: params[:customer][:tax_profiles])
name = customer_params[:name]
phone = customer_params[:contact_no]
email = customer_params[:email]

View File

@@ -98,7 +98,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 = #{status} AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}'")
.where("assigned_order_items.delivery_status = 0 AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}'")
.group("assigned_order_items.assigned_order_item_id")
.order("assigned_order_items.created_at")
end

View File

@@ -101,9 +101,9 @@ class Oqs::HomeController < BaseOqsController
if oqs_id == nil
oqs = ''
else
oqs = " and assigned_order_items.order_queue_station_id = '#{oqs_id}' "
oqs = "and assigned_order_items.order_queue_station_id = '#{oqs_id}' "
end
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at")
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at")
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id
left join orders as od ON od.order_id = assigned_order_items.order_id
@@ -112,8 +112,10 @@ 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 = #{status} AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}'#{oqs}")
.where("assigned_order_items.delivery_status = #{status} AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' #{oqs}")
.group("assigned_order_items.assigned_order_item_id")
.order("assigned_order_items.created_at")
end
# Completed Order

View File

@@ -37,14 +37,14 @@ class Origami::CustomersController < BaseOrigamiController
@crm_customers = Customer.order("customer_id").page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
else
@crm_customers = Customer.search(filter)
@crm_customers = Customer.search(filter)
end
#@crm_customers = Customer.all
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50)
@crm_customer = Customer.new
@count_customer = Customer.count_customer
@taxes = TaxProfile.all.order("order_by asc")
# if flash["errors"]
# @crm_customer.valid?
# end

View File

@@ -273,28 +273,34 @@ class Sale < ApplicationRecord
total_tax_amount = 0
#tax_profile - list by order_by
tax_profiles = TaxProfile.all.order("order_by asc")
customer = Customer.find(sale.customer_id)
# #Creat new tax records
tax_profiles.each do |tax|
sale_tax = SaleTax.new(:sale => sale)
sale_tax.tax_name = tax.name
sale_tax.tax_rate = tax.rate
customer.tax_profiles.each do |cus_tax|
if cus_tax.to_i == tax.id
sale_tax = SaleTax.new(:sale => sale)
sale_tax.tax_name = tax.name
sale_tax.tax_rate = tax.rate
# substract , to give after discount
total_tax = total_taxable - total_discount
#include or execulive
if tax.inclusive
sale_tax.tax_payable_amount = total_tax / 21
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
# substract , to give after discount
total_tax = total_taxable - total_discount
#include or execulive
if tax.inclusive
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
end
#new taxable amount is standard rule for step by step
# total_taxable = total_taxable + sale_tax.tax_payable_amount
sale_tax.inclusive = tax.inclusive
sale_tax.save
end
end
#new taxable amount is standard rule for step by step
# total_taxable = total_taxable + sale_tax.tax_payable_amount
sale_tax.inclusive = tax.inclusive
sale_tax.save
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
end
sale.total_tax = total_tax_amount
@@ -312,32 +318,37 @@ class Sale < ApplicationRecord
#tax_profile - list by order_by
tax_profiles = TaxProfile.all.order("order_by asc")
# #Creat new tax records
customer = Customer.find(self.customer_id)
# #Create new tax records
tax_profiles.each do |tax|
sale_tax = SaleTax.new(:sale => self)
sale_tax.tax_name = tax.name
sale_tax.tax_rate = tax.rate
customer.tax_profiles.each do |cus_tax|
if cus_tax.to_i == tax.id
sale_tax = SaleTax.new(:sale => self)
sale_tax.tax_name = tax.name
sale_tax.tax_rate = tax.rate
# substract , to give after discount
total_tax = total_taxable - self.total_discount
#include or execulive
if tax.inclusive
sale_tax.tax_payable_amount = total_tax / 21
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
# substract , to give after discount
total_tax = total_taxable - self.total_discount
#include or execulive
if tax.inclusive
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
end
#new taxable amount is standard rule for step by step
# total_taxable = total_taxable + sale_tax.tax_payable_amount
sale_tax.inclusive = tax.inclusive
sale_tax.save
end
end
#new taxable amount is standard rule for step by step
# total_taxable = total_taxable + sale_tax.tax_payable_amount
sale_tax.inclusive = tax.inclusive
sale_tax.save
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
end
self.total_tax = total_tax_amount
end
def product_get_unit_price(item_code)
@@ -382,7 +393,6 @@ class Sale < ApplicationRecord
end
def self.search(filter,from,to)
if filter.blank?
keyword = ''
else
@@ -399,7 +409,6 @@ class Sale < ApplicationRecord
end
def self.search_credit_sales(customer,filter,from,to)
if filter.blank?
keyword = ''
else
@@ -518,31 +527,25 @@ class Sale < ApplicationRecord
end
def self.get_by_range_by_saleitems(from,to,status,report_type)
query = Sale.select("
mi.item_code as code,(SUM(i.qty) * i.unit_price) as grand_total,
SUM(i.qty) as total_item," +
" i.unit_price as unit_price,
mi.name as product_name,
mc.name as menu_category_name,
mc.id as menu_category_id ")
.group('mi.id')
.order("mi.menu_category_id")
query = Sale.select("
mi.item_code as code,(SUM(i.qty) * i.unit_price) as grand_total,
SUM(i.qty) as total_item," +
" i.unit_price as unit_price,
mi.name as product_name,
mc.name as menu_category_name,
mc.id as menu_category_id ")
.group('mi.id')
.order("mi.menu_category_id")
query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id
JOIN menu_items mi ON i.product_code = mi.item_code" +
" JOIN menu_categories mc ON mc.id = mi.menu_category_id
JOIN employees ea ON ea.id = sales.cashier_id")
query = query.where("(receipt_date between ? and ? and sale_status=?) AND i.unit_price <> 0",from,to,status)
query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id
JOIN menu_items mi ON i.product_code = mi.item_code" +
" JOIN menu_categories mc ON mc.id = mi.menu_category_id
JOIN employees ea ON ea.id = sales.cashier_id")
query = query.where("(receipt_date between ? and ? and sale_status=?) AND i.unit_price <> 0",from,to,status)
end
def self.get_by_shiftsales(from,to,shift)
if !shift.blank?
ShiftSale.where("id =?",shift.id)

View File

@@ -237,12 +237,10 @@ class ReceiptBillPdf < Prawn::Document
end
def sale_payment(sale_data,precision,delimiter)
def sale_payment(sale_data,precision,delimiter)
stroke_horizontal_rule
move_down 5
SalePayment.where('sale_id = ?', sale_data.sale_id).each do |payment|
y_position = cursor
if payment.payment_method == "paypar"
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
@@ -269,15 +267,12 @@ class ReceiptBillPdf < Prawn::Document
text "#{number_with_precision(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
end
move_down 5
end
end
end
# show member information
def member_info(member_info,customer_name,rebate_amount,sale_data,precision,delimiter)
if rebate_amount != nil
if rebate_amount != nil
if rebate_amount["status"] == true
stroke_horizontal_rule
total = 0
@@ -429,6 +424,5 @@ class ReceiptBillPdf < Prawn::Document
move_down 5
end
end

View File

@@ -82,17 +82,7 @@
<div class="form-group">
<label>Date Of Birth</label>
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['card_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block" style="margin-top:-6px"><%= str %></span>
<% end %>
</div>
</div>
<div class="form-group">
<label>Select Customer Type</label>
@@ -103,10 +93,21 @@
<%end %>
</select>
</div>
<div class="form-group">
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['card_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block" style="margin-top:-6px"><%= str %></span>
<% end %>
</div>
<div class="form-group">
<label>Paypar Account No:</label>
<div class="input-group">

View File

@@ -0,0 +1,4 @@
json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth,
:membership_id, :membership_type, :membership_authentication_code,
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :tax_profiles
json.url crm_customer_url(@crm_customer, format: :json)

View File

@@ -1,4 +1,4 @@
<div class="row">
<!-- <div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
<li><a href="<%= crm_root_path %>">Home</a></li>
@@ -7,17 +7,17 @@
</li>
<!-- <a href="<%= new_crm_customer_path%>" class="btn btn-primary pull-right">
<i class="fa fa-plus-circle fa-lg"></i> Add Customer
</a> -->
</a>
</ol>
</div>
</div>
</div> -->
<div class="row">
<div class="col-lg-7 col-md-7 col-sm-7">
<div class="main-box-body clearfix">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
@@ -25,7 +25,7 @@
<%= form_tag crm_customers_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" placeholder="Search" id="search" class="form-control input-xs col-md-9">
<button type="submit" class="btn btn-primary btn-md">Search</button>
<button type="submit" class="btn btn-primary btn-md">Search</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> -->
@@ -48,12 +48,12 @@
<tbody>
<% @i = 0 %>
<% @crm_customers.each do |crm_customer| %>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td>
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
<%= @i += 1 %>
<% end %>
</td>
@@ -62,15 +62,15 @@
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
<td><%= link_to 'Show', crm_customer_path(crm_customer) %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= paginate @crm_customers %>
</div>
</div>
@@ -98,9 +98,9 @@ $(function() {
$('.datepicker').css('cursor','pointer');
// Read Card Reader
$("#member_acc_no").on('click', function(e){
var cardNo = "";
$("#sxModal").show();
$("#member_acc_no").on('click', function(e){
var cardNo = "";
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
@@ -120,19 +120,20 @@ $(document).on('click',".customer_tr",function(){
// var url = "/"+customer_id;
update_sale(customer_id,sale_id);
}else{
var url = "customers/"+customer_id;
var url = "customers/" + customer_id + "/edit";
}
$.ajax({
type: "GET",
url: url,
$.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(data.tax_profiles);
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");
});
@@ -166,7 +167,7 @@ $(document).on('click',".customer_tr",function(){
}else{
$('.mdm').prop( "checked", true )
}
$('.membership_authentication_code').val(data.membership_authentication_code);
$('#update_customer').removeAttr('disabled').val('');
@@ -185,7 +186,7 @@ $(document).on('click',".customer_tr",function(){
}
});
// }else{
// }
})
@@ -194,44 +195,43 @@ $(document).on('click',".customer_tr",function(){
title: 'Confirm!',
content: 'Are You Sure to assign this customer!',
buttons: {
cancel: function () {
},
confirm: {
text: 'Confirm',
btnClass: 'btn-green',
keys: ['enter', 'shift'],
action: function(){
$.ajax({
type: "POST",
$.ajax({
type: "POST",
url: "update_sale/" ,
data: {customer_id:customer_id,sale_id:sale_id},
dataType: "json",
success: function(data) {
if(data.status == true)
{
{
window.location.href = '/origami'
}else{
alert('Record not found!');
location.reload();
}
}
}
});
}
}
}
});
}
$('#reset').click(function() {
window.location.href = '/crm/customers'
return false;
});
</script>

View File

@@ -1,4 +1,4 @@
<div class="page-header">
<!-- <div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li>Queue</li>
@@ -6,19 +6,19 @@
<%= link_to t('.new', :default => t("helpers.links.new")),new_crm_dining_queue_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
</div> -->
<div class="row">
<!-- Column One -->
<div class="col-lg-11 col-md-11 col-sm-11">
<div class="tab-content" style="max-height:670px; overflow-y:scroll">
<div class="tab-content" style="max-height:670px; overflow-y:auto">
<!--- Panel 1 - Table Orders -->
<div class="active" role="tabpanel">
<div class="tab-pane" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<% @dining_queues.each do |queue| %>
<% if queue.status == "Assign"
@bg_color = "assign"
@@ -27,10 +27,10 @@
else
@bg_color = "normal"
end
%>
%>
<div class="card select-queue <%= @bg_color %>" data-id="<%= queue.id %>" style="width: 21.5rem;">
<div class="card-block">
<p class="hidden queue-id"><%= queue.id %></p>
<p class="hidden queue-id"><%= queue.id %></p>
<p class="hidden queue-status"><%= queue.status %></p>
<span class="card-title"><strong> Queue No : <%= queue.queue_no %></strong></span>
<span class="card-title pull-right"><strong> Seater : <%= queue.seater %></strong></span><br>
@@ -39,7 +39,7 @@
<span class="card-title"> Remark : <%= queue.remark %></span>
</div>
</div>
<% end %>
</div>
</div>
@@ -48,8 +48,10 @@
<!-- tabs - End -->
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<%= link_to t('.new', :default => t("helpers.links.new")),new_crm_dining_queue_path,:class => 'btn btn-primary btn-lg btn-block' %>
<hr>
<button type="button" id="assign" class="btn btn-primary btn-lg btn-block" disabled>Assign</button>
<button type="button" id="cancel" class="btn btn-warning btn-lg btn-block" disabled>Cancel</button>
<button type="button" id="cancel" class="btn btn-warning btn-lg btn-block" disabled>Cancel</button>
<a href="<%= dashboard_path %>" class="btn btn-primary btn-lg btn-block" role="button" aria-haspopup="true" aria-expanded="false"> Back </a>
</div>
</div>
@@ -71,7 +73,7 @@ $(function(){
$("#cancel").val($(this).find(".queue-id").text());
}); //End Click
});
$('#assign').click(function() {
var id = $(this).val();
@@ -90,31 +92,31 @@ function cancel_queue(id,url) {
title: 'Confirm!',
content: 'Are You Sure to cancel this Queue!',
buttons: {
cancel: function () {
cancel: function () {
},
confirm: {
text: 'Confirm',
btnClass: 'btn-green',
keys: ['enter', 'shift'],
action: function(){
$.ajax({
type: "POST",
$.ajax({
type: "POST",
url: url ,
data: {id:id},
dataType: "json",
success: function(data) {
if(data.status == true)
{
{
location.reload();
}
}
}
});
}
}
}
});
}
</script>
</script>

View File

@@ -8,22 +8,25 @@
<li class="navbar-nav mr-auto dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Settings</a>
<ul class="dropdown-menu">
<li><%= link_to "Zones (Zone,Table,Rooms)", settings_zones_path, :tabindex =>"-1" %></li>
<hr class="hr_advance" />
<li><%= link_to "Order Queue Stations",settings_order_queue_stations_path, :tabindex =>"-1" %></li>
<hr class="hr_advance" />
<li><%= link_to "Menus ", settings_menus_path, :tabindex =>"-1" %></li>
<li><%= link_to "Menu Categories", settings_menu_categories_path, :tabindex =>"-1" %></li>
<li><%= link_to "Menu Item Attributes", settings_menu_item_attributes_path, :tabindex =>"-1" %></li>
<li><%= link_to "Menu Item Options",settings_menu_item_options_path, :tabindex =>"-1" %></li>
<hr>
<li><%= link_to "Order Queue Stations",settings_order_queue_stations_path, :tabindex =>"-1" %></li>
<li><%= link_to "Zones", settings_zones_path, :tabindex =>"-1" %></li>
<hr>
<li><%= link_to "Cashier Terminals ", settings_cashier_terminals_path, :tabindex =>"-1" %></li>
<li><%= link_to "Employees", settings_employees_path, :tabindex =>"-1" %></li>
<hr class="hr_advance" />
<li><%= link_to "Cashier Terminals", settings_cashier_terminals_path, :tabindex =>"-1" %></li>
<li><%= link_to "Tax Profile", settings_tax_profiles_path, :tabindex =>"-1" %></li>
<hr class="hr_advance" />
<li><%= link_to "Membership Setting",settings_membership_settings_path, :tabindex =>"-1" %></li>
<li><%= link_to "Membership Action",settings_membership_actions_path, :tabindex =>"-1" %></li>
<li><%= link_to "Payment Method", settings_payment_method_settings_path, :tabindex =>"-1" %></li>
<li><%= link_to "Tax Profile", settings_tax_profiles_path, :tabindex =>"-1" %></li>
<li><%= link_to "Payment Methods", settings_payment_method_settings_path, :tabindex =>"-1" %></li>
<li><%= link_to "Print Setting", print_settings_path, :tabindex =>"-1" %></li>
<hr>
<hr class="hr_advance" />
<li><%= link_to "Employees", settings_employees_path, :tabindex =>"-1" %></li>
<hr class="hr_advance" />
<li><%= link_to "Accounts", settings_accounts_path, :tabindex =>"-1" %></li>
</ul>
</li>
@@ -33,7 +36,7 @@
<ul class="dropdown-menu">
<li><%= link_to "Orders ", transactions_orders_path, :tabindex =>"-1" %></li>
<li><%= link_to "Sales ", transactions_sales_path, :tabindex =>"-1" %></li>
<li><%= link_to "Credit Note ", transactions_credit_notes_path, :tabindex =>"-1" %></li>
<li><%= link_to "Credit Note ", transactions_credit_notes_path, :tabindex =>"-1" %></li>
</ul>
</li>
<li class="navbar-nav mr-auto dropdown">
@@ -42,9 +45,9 @@
<li><%= link_to "Daily Sale Report", reports_dailysale_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Sales Item Report", reports_saleitem_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Receipt Report", reports_receipt_no_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Shift Sale Report", reports_shiftsale_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Credit Sale Report", reports_credit_payment_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Void Sale Report", reports_void_sale_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Shift Sale Report", reports_shiftsale_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Credit Sale Report", reports_credit_payment_index_path, :tabindex =>"-1" %></li>
<li><%= link_to "Void Sale Report", reports_void_sale_index_path, :tabindex =>"-1" %></li>
</ul>
</li>
<li class="navbar-nav mr-auto">
@@ -57,7 +60,7 @@
<a href="<%= crm_customers_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;CRM</a>
</li>
</ul>
</div>
@@ -66,7 +69,7 @@
<ul class="navbar-nav mr-auto">
<%if current_login_employee.role !="waiter" %>
<li style="color: #959595"><%= current_login_employee.name %> </li>
<li style="padding-right:10px;padding-left:10px"> | </li>
<li ><%= link_to 'Logout', logout_path, method: :delete, data: { confirm: 'Are you sure?' } %>
</li>
@@ -76,3 +79,9 @@
<% end %>
</nav>
<style type="text/css">
hr.hr_advance {
margin-top: 10px !important;
margin-bottom: 10px !important;
}
</style>

View File

@@ -3,7 +3,7 @@
<div class="col-lg-8 col-md-8 col-sm-8">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<li class="nav-item nav-completed">
<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>
@@ -17,11 +17,12 @@
<p class="hidden oqs-id"><%= qsi.id %></p>
<a class="nav-link" data-toggle="tab" href="" role="tab" <%= status %>>
<%= qsi.station_name %>
<span class="badge badge-pill badge-default" id=""><%= qsi.assigned_order_items.count %>
<span class="badge badge-pill badge-default" id=""><%= qsi.assigned_order_items.count(:delivery_status) %>
</span>
<% if qsi.auto_print %>
<span>(ap)</span>
<% end %>
<% end %>
<%= qsi.assigned_order_items.where("delivery_status=0").count %>
</a>
</li>
<% end %>
@@ -77,13 +78,11 @@
<!-- Order Item for Queue Station -->
<!--- Order Items -->
<div class="card-columns oqs_append" style="padding-top:10px; column-gap: 1.2rem;">
<!--- end of Items-->
</div>
<!--- Order Items -->
<div class="card-columns oqs_append" style="padding-top:10px; column-gap: 1.2rem;">
</div>
<!--- end of Items-->
</div>
</div>
@@ -144,4 +143,3 @@
</div>
</div>

View File

@@ -1,7 +1,7 @@
<div class='row'>
<div class="col-lg-11 col-md-11 col-sm-11">
<h2> Payment Credit </h2>
<h2> Cash In </h2>
<br>
<table class='table table-striped'>
<tr>

View File

@@ -2,7 +2,7 @@
<div class='row'>
<div class="col-lg-11 col-md-11 col-sm-11">
<h2>Payment Debit</h2>
<h2>Cash Out</h2>
<table class='table table-striped'>
<tr>
<td> Payment Reference

View File

@@ -81,23 +81,7 @@
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['name']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block" style="margin-top:-10px"><%= str %></span>
<% end -%>
</div>
<div class="form-group">
<label>Paypar Account No:</label>
<div class="input-group">
<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>
</div>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group">
<label>Salutation :</label><br>
<label>Mr</label>
@@ -176,6 +160,37 @@
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
</div>
<div class="form-group">
<label>Select Customer Type</label>
<select class="selectpicker form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" >
<% Lookup.where("lookup_type = ?", "customer_type" ).each do |ct| %>
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
</div>
<div class="form-group">
<%= f.input :tax_profiles, :collection => @taxes, :input_html => { :multiple => true }, :class => "form-control col-md-6 tax_profiles" %>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
<% flash.each do |name, msg| %>
<% str="[\"#{msg['name']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<span class="help-block" style="margin-top:-10px"><%= str %></span>
<% end -%>
</div>
<div class="form-group">
<label>Paypar Account No:</label>
<div class="input-group">
<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>
</div>
<div class="form-group">
<label>Select Member Group</label>
<select class="selectpicker form-control col-md-12" name="member_group_id">
@@ -292,6 +307,12 @@
data: {},
dataType: "json",
success: function(data) {
var taxes = JSON.stringify(data.tax_profiles);
var parse_taxes = JSON.parse(taxes);
$.each(parse_taxes, function(i, value){
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected");
});
$('#customer_id').val(data.id);
$('#customer_name').val(data.name);
$('#customer_company').val(data.company);
@@ -301,7 +322,8 @@
$('#customer_membership_type').val(data.membership_type);
$('.select > option[value="'+data.membership_id+'"]').attr('selected','selected');
$('.membership_authentication_code').val(data.membership_authentication_code);
$('#customer_card_no').val(data.card_no);
$('#customer_type').val(data.customer_type);
$('#customer_salutation').val(data.salutation);
$('#customer_nrc_no').val(data.nrc_no);
$('#paypar_account_no').val(data.paypar_account_no);

View File

@@ -2,7 +2,7 @@
<div class="col-lg-11col-md-11 col-sm-11">
<div >
<div >
<% @payment_method_setting.each do |payment_method|%>
<% @payment_method_setting.where("is_active = true").each do |payment_method|%>
<div class="purple others-payment bottom left" data-type="<%= payment_method.payment_method %>" id="<%= payment_method.payment_method %>" data-url="<%=payment_method.gateway_url%>" data-sale-id="<%= @sale_id%>"><%= payment_method.payment_method %></div>
<% end %>
</div>

View File

@@ -1,7 +1,7 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= dashboard_path %>">Home</a></li>
<li>Credit Payment List Report</li>
<li>Void Sale Report</li>
</ul>
</div>

View File

@@ -13,8 +13,9 @@
<table class="table table-striped">
<thead>
<tr>
<th style="width:40%">Name</th>
<th style="width:40%">Role</th>
<th style="width:20%">Name</th>
<th style="width:20%">Role</th>
<th style="width:20%">Created At</th>
<th style="width:20%">Action</th>
</tr>
</thead>
@@ -24,13 +25,14 @@
<tr>
<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>
<%= link_to 'Edit', edit_settings_employee_path(employee) %>
<%= link_to 'Edit', edit_settings_employee_path(employee) %>
<%if employee.role != "administrator"%>
| <%= link_to 'Destroy', settings_employee_path(employee) , method: :delete, data: { confirm: 'Are you sure?' } %>
<%end%>
<%end%>
</td>
</tr>
<% end %>

View File

@@ -7,10 +7,10 @@
<%= f.input :gateway_communication_type %>
<%= f.input :gateway_url %>
<%= f.input :auth_token %>
<%= f.input :discount %>
<%= f.input :rebate %>
<%= f.input :bonus %>
<%= f.input :point %>
<label><%= f.check_box :discount %>Discount</label><br/>
<label><%= f.check_box :rebate %>Rebate</label><br/>
<label><%= f.check_box :bonus %>Bonus</label><br/>
<label><%= f.check_box :point %>Points</label>
</div>
<div class="form-actions">

View File

@@ -21,7 +21,7 @@
<th>Discount</th>
<th>Rebate</th>
<th>Bonus</th>
<th>Point</th>
<th>Points</th>
<th colspan="3"></th>
</tr>
</thead>