Merge branch 'staging' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -42,10 +42,6 @@ class Origami::ShiftsController < BaseOrigamiController
|
|||||||
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
||||||
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||||
|
|
||||||
|
|
||||||
puts "sssssssssss"
|
|
||||||
puts @total_amount_by_account.to_json
|
|
||||||
|
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
|
|||||||
@@ -6,18 +6,19 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
|
|
||||||
if Sale.exists?(sale_id)
|
if Sale.exists?(sale_id)
|
||||||
sale = Sale.find_by_sale_id(sale_id)
|
sale = Sale.find_by_sale_id(sale_id)
|
||||||
sale.payment_status = 'void'
|
|
||||||
sale.sale_status = 'void'
|
|
||||||
sale.save
|
|
||||||
|
|
||||||
# update count for shift sale
|
# update count for shift sale
|
||||||
if(sale.sale_status == "void")
|
if(sale.sale_status == "completed")
|
||||||
if sale.shift_sale_id != nil
|
if sale.shift_sale_id != nil
|
||||||
shift = ShiftSale.find(sale.shift_sale_id)
|
shift = ShiftSale.find(sale.shift_sale_id)
|
||||||
shift.calculate(sale_id, "void")
|
shift.calculate(sale_id, "void")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sale.payment_status = 'void'
|
||||||
|
sale.sale_status = 'void'
|
||||||
|
sale.save
|
||||||
|
|
||||||
bookings = sale.bookings
|
bookings = sale.bookings
|
||||||
bookings.each do |booking|
|
bookings.each do |booking|
|
||||||
orders = booking.orders
|
orders = booking.orders
|
||||||
|
|||||||
@@ -3,18 +3,17 @@ class Transactions::OrdersController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
|
|
||||||
filter = params[:filter]
|
filter = params[:filter]
|
||||||
|
count = params[:count]
|
||||||
from = params[:from]
|
from = params[:from]
|
||||||
to = params[:to]
|
to = params[:to]
|
||||||
|
|
||||||
if filter.nil? || from.nil? || to.nil?
|
if filter.nil? && from.nil? && to.nil? && count.nil?
|
||||||
orders = Order.order("order_id desc")
|
orders = Order.order("order_id desc")
|
||||||
|
puts "ssssss"
|
||||||
else
|
else
|
||||||
orders = Order.search(filter,from,to)
|
orders = Order.search(filter,from,to,count)
|
||||||
# if order.count > 0
|
puts "aaaaa"
|
||||||
# orders = order
|
|
||||||
# else
|
|
||||||
# orders = Order.order("order_id desc")
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if !orders.nil?
|
if !orders.nil?
|
||||||
@@ -22,6 +21,7 @@ class Transactions::OrdersController < ApplicationController
|
|||||||
else
|
else
|
||||||
@orders = []
|
@orders = []
|
||||||
end
|
end
|
||||||
|
puts @orders.to_json
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.json { render json: @orders }
|
format.json { render json: @orders }
|
||||||
|
|||||||
@@ -320,12 +320,18 @@ class Order < ApplicationRecord
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.search(filter,from,to)
|
def self.search(filter,from,to,count)
|
||||||
if !from.nil? && !to.nil?
|
if count.to_i > 0
|
||||||
Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ?", from,to)
|
item_count = "and item_count = '#{count}'"
|
||||||
else
|
else
|
||||||
# find(:all)
|
item_count = ''
|
||||||
where("order_id LIKE ? OR item_count ='#{filter}'","%#{filter}%",)
|
end
|
||||||
|
if from.present? && to.present?
|
||||||
|
Order.where("DATE_FORMAT(date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(date,'%d-%m-%Y') <= ? #{item_count}", from,to)
|
||||||
|
elsif !from.present? && !to.present? && count.present?
|
||||||
|
Order.where("item_count = '#{count}'")
|
||||||
|
else
|
||||||
|
Order.where("order_id LIKE ? OR status LIKE ? OR order_type LIKE ? OR source='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ class Sale < ApplicationRecord
|
|||||||
.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and sp.payment_method = 'creditnote' #{keyword} #{custo}", from,to)
|
.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and sp.payment_method = 'creditnote' #{keyword} #{custo}", from,to)
|
||||||
else
|
else
|
||||||
sale = Sale.all.joins("JOIN sale_payments sp on sp.sale_id = sales.sale_id")
|
sale = Sale.all.joins("JOIN sale_payments sp on sp.sale_id = sales.sale_id")
|
||||||
.where("sp.payment_method =? #{keyword} #{custo}",'creditnote')
|
.where("sp.payment_method ='creditnote' #{keyword} #{custo}")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-1">
|
<div class="form-group col-md-1">
|
||||||
<label></label>
|
<label> </label>
|
||||||
<input type="submit" value="Search" class='btn btn-primary btn-md'>
|
<input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -14,12 +14,16 @@
|
|||||||
<div class="main-box-body clearfix">
|
<div class="main-box-body clearfix">
|
||||||
<%= form_tag transactions_orders_path, :method => :get do %>
|
<%= form_tag transactions_orders_path, :method => :get do %>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label>Enter Keyword</label>
|
<label>Search Keyword</label>
|
||||||
<input type="text" name="filter" placeholder="Order ID" class="form-control input-md">
|
<input type="text" name="filter" placeholder="Order ID" class="form-control input-md">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label>Items Count</label>
|
<label>Items Count</label>
|
||||||
<input id="number" data-id='numberRangePicker' type="range" data-min="0" data-max="20" data-step="1" data-value="14"/>
|
<div id="slider">
|
||||||
|
<input class="bar" name="count" min="0" max="20" type="range" id="rangeinput" onchange="rangevalue.value=value"/>
|
||||||
|
<span class="highlight"></span>
|
||||||
|
<output id="rangevalue">0</output>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
@@ -32,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-1">
|
<div class="form-group col-md-1">
|
||||||
<label></label>
|
<label> </label>
|
||||||
<input type="submit" value="Search" class='btn btn-primary btn-md'>
|
<input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -76,6 +80,132 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
|
||||||
|
|
||||||
|
#slider {
|
||||||
|
/*width: 400px;*/
|
||||||
|
height: 17px;
|
||||||
|
position: relative;
|
||||||
|
margin: 10px auto;
|
||||||
|
background: #10171D;
|
||||||
|
|
||||||
|
-webkit-border-radius: 40px;
|
||||||
|
-moz-border-radius: 40px;
|
||||||
|
border-radius: 40px;
|
||||||
|
/*
|
||||||
|
-webkit-box-shadow: inset 0px 0px 1px 1px rgba(0, 0, 0, 0.9), 0px 1px 1px 0px rgba(255, 255, 255, 0.13);
|
||||||
|
-moz-box-shadow: inset 0px 0px 1px 1px rgba(0, 0, 0, 0.9), 0px 1px 1px 0px rgba(255, 255, 255, 0.13);
|
||||||
|
box-shadow: inset 0px 0px 1px 1px rgba(0, 0, 0, 0.9), 0px 1px 1px 0px rgba(255, 255, 255, 0.13);*/
|
||||||
|
}
|
||||||
|
|
||||||
|
#slider .bar {
|
||||||
|
width: 168px;
|
||||||
|
height: 5px;
|
||||||
|
background: #333;
|
||||||
|
position: relative;
|
||||||
|
top: -4px;
|
||||||
|
left: 4px;
|
||||||
|
|
||||||
|
background: #1d2e38;
|
||||||
|
background: -moz-linear-gradient(left, #1d2e38 0%, #2b4254 50%, #2b4254 100%);
|
||||||
|
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#1d2e38), color-stop(50%,#2b4254), color-stop(100%,#2b4254));
|
||||||
|
background: -webkit-linear-gradient(left, #1d2e38 0%,#2b4254 50%,#2b4254 100%);
|
||||||
|
background: -o-linear-gradient(left, #1d2e38 0%,#2b4254 50%,#2b4254 100%);
|
||||||
|
background: -ms-linear-gradient(left, #1d2e38 0%,#2b4254 50%,#2b4254 100%);
|
||||||
|
background: linear-gradient(left, #1d2e38 0%,#2b4254 50%,#2b4254 100%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1d2e38', endColorstr='#2b4254',GradientType=1 );
|
||||||
|
|
||||||
|
-webkit-border-radius: 40px;
|
||||||
|
-moz-border-radius: 40px;
|
||||||
|
border-radius: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#slider .highlight {
|
||||||
|
height: 2px;
|
||||||
|
position: absolute;
|
||||||
|
width: 168px;
|
||||||
|
top: 6px;
|
||||||
|
left: 6px;
|
||||||
|
|
||||||
|
-webkit-border-radius: 40px;
|
||||||
|
-moz-border-radius: 40px;
|
||||||
|
border-radius: 40px;
|
||||||
|
|
||||||
|
background: rgba(255, 255, 255, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="range"] {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
background-color: black;
|
||||||
|
height: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="range"]::-webkit-slider-thumb {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
position: relative;
|
||||||
|
top: 0px;
|
||||||
|
z-index: 1;
|
||||||
|
width: 11px;
|
||||||
|
height: 11px;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-box-shadow: 0px 6px 5px 0px rgba(0,0,0,0.6);
|
||||||
|
-moz-box-shadow: 0px 6px 5px 0px rgba(0,0,0,0.6);
|
||||||
|
box-shadow: 0px 6px 5px 0px rgba(0,0,0,0.6);
|
||||||
|
-webkit-border-radius: 40px;
|
||||||
|
-moz-border-radius: 40px;
|
||||||
|
border-radius: 40px;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ebf1f6), color-stop(50%,#abd3ee), color-stop(51%,#89c3eb), color-stop(100%,#d5ebfb));
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="range"]:hover ~ #rangevalue,input[type="range"]:active ~ #rangevalue {
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
|
||||||
|
filter: alpha(opacity=20);
|
||||||
|
opacity: 1;
|
||||||
|
top: -75px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tool Tip */
|
||||||
|
#rangevalue {
|
||||||
|
color: white;
|
||||||
|
font-size: 10px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
display: block;
|
||||||
|
color: #fff;
|
||||||
|
margin: 20px 0;
|
||||||
|
position: relative;
|
||||||
|
left: 44.5%;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border: 1px solid black;
|
||||||
|
|
||||||
|
-webkit-box-shadow: inset 0px 1px 1px 0px rgba(255, 255, 255, 0.2), 0px 2px 4px 0px rgba(0,0,0,0.4);
|
||||||
|
-moz-box-shadow: inset 0px 1px 1px 0px rgba(255, 255, 255, 0.2), 0px 2px 4px 0px rgba(0,0,0,0.4);
|
||||||
|
box-shadow: inset 0px 1px 1px 0px rgba(255, 255, 255, 0.2), 0px 2px 4px 0px rgba(0,0,0,0.4);
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222931), color-stop(100%,#181D21));
|
||||||
|
|
||||||
|
-webkit-border-radius: 20px;
|
||||||
|
-moz-border-radius: 20px;
|
||||||
|
border-radius: 20px;
|
||||||
|
width: 18px;
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
filter: alpha(opacity=0);
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
-webkit-transition: all 0.5s ease;
|
||||||
|
-moz-transition: all 0.5s ease;
|
||||||
|
-o-transition: all 0.5s ease;
|
||||||
|
-ms-transition: all 0.5s ease;
|
||||||
|
transition: all 0.5s ease;
|
||||||
|
top: -95px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="range"]:focus{
|
||||||
|
outline:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user