Add CB settlement report and transaction
This commit is contained in:
135
app/controllers/reports/card_settle_tran_controller.rb
Normal file
135
app/controllers/reports/card_settle_tran_controller.rb
Normal file
@@ -0,0 +1,135 @@
|
||||
class Reports::CardSettleTranController < BaseReportController
|
||||
authorize_resource :class => false
|
||||
|
||||
# GET /transactions/sales
|
||||
# GET /transactions/sales.json
|
||||
def index
|
||||
@payment_method = [["All Payments",''],["MPU Payment","mpu"], ["Visa Payment","visa"],
|
||||
["Master Payment","master"], ["JCB Payment","jcb"],["UnionPay Payment","unionpay"],
|
||||
["Alipay Payment","alipay"]]
|
||||
@sales = Sale.all
|
||||
payment_type = params[:payment_type]
|
||||
|
||||
from, to = get_date_range_from_params
|
||||
status = 'Approved'
|
||||
@shift_sale_range = ''
|
||||
@shift = ''
|
||||
|
||||
if params[:shift_name].to_i != 0
|
||||
|
||||
@shift_sale_range = CardSettleTran.get_by_shift_sale_by_card(from,to,status)
|
||||
|
||||
@shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',@shift_sale.shift_started_at)
|
||||
else
|
||||
if @shift_sale.shift_closed_at.blank?
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',@shift_sale.shift_started_at)
|
||||
else
|
||||
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',@shift_sale.shift_started_at, @shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if from.nil? && to.nil? && payment_method.nil? && @shift.nil?
|
||||
|
||||
@cardSettles = CardSettleTran.order("sale_id desc")
|
||||
|
||||
@cardSettles = Kaminari.paginate_array(@cardSettles).page(params[:page]).per(20)
|
||||
else
|
||||
cardSettle = CardSettleTran.searchReport(from,to,payment_type,@shift_sale_range,@shift)
|
||||
if cardSettle.count > 0
|
||||
@cardSettles = cardSettle
|
||||
@cardSettles = Kaminari.paginate_array(@cardSettles).page(params[:page]).per(20)
|
||||
else
|
||||
@cardSettles = 0
|
||||
end
|
||||
end
|
||||
|
||||
@from = from
|
||||
@to = to
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
if @shift.present?
|
||||
@shift.each do |sh|
|
||||
@shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
|
||||
@shift_data = sh
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# date range
|
||||
PERIOD = {
|
||||
"today" => 0,
|
||||
"yesterday" => 1,
|
||||
"this_week" => 2,
|
||||
"last_week" => 3,
|
||||
"last_7" => 4,
|
||||
"this_month" => 5,
|
||||
"last_month" => 6,
|
||||
"last_30" => 7,
|
||||
"this_year" => 8,
|
||||
"last_year" => 9
|
||||
}
|
||||
|
||||
def get_date_range_from_params
|
||||
period_type = params[:period_type]
|
||||
period = params[:period]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
day_ref = Time.now.utc.getlocal
|
||||
if from.present? && to.present?
|
||||
f_date = DateTime.parse(from)
|
||||
t_date = DateTime.parse(to)
|
||||
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
|
||||
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
|
||||
from = f_time.beginning_of_day.utc.getlocal
|
||||
to = t_time.end_of_day.utc.getlocal
|
||||
else
|
||||
case period.to_i
|
||||
when PERIOD["today"]
|
||||
from = day_ref.beginning_of_day.utc
|
||||
to = day_ref.end_of_day.utc
|
||||
|
||||
when PERIOD["yesterday"]
|
||||
from = (day_ref - 1.day).beginning_of_day.utc
|
||||
to = (day_ref - 1.day).end_of_day.utc
|
||||
|
||||
when PERIOD["this_week"]
|
||||
from = Time.now.beginning_of_week.utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["last_week"]
|
||||
from = (day_ref - 7.day).beginning_of_week.utc
|
||||
to = (day_ref - 7.day).end_of_week.utc
|
||||
when PERIOD["last_7"]
|
||||
from = (day_ref - 7.day).utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["this_month"]
|
||||
from = Time.now.beginning_of_month.utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["last_month"]
|
||||
from = (day_ref - 1.month).beginning_of_month.utc
|
||||
to = (day_ref - 1.month).end_of_month.utc
|
||||
when PERIOD["last_30"]
|
||||
from = (day_ref - 30.day).utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["this_year"]
|
||||
from = Time.now.beginning_of_year.utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["last_year"]
|
||||
from = (day_ref - 1.year).beginning_of_year.utc
|
||||
to = (day_ref - 1.year).end_of_year.utc
|
||||
end
|
||||
end
|
||||
|
||||
return from, to
|
||||
end
|
||||
|
||||
end
|
||||
105
app/controllers/transactions/card_settle_trans_controller.rb
Normal file
105
app/controllers/transactions/card_settle_trans_controller.rb
Normal file
@@ -0,0 +1,105 @@
|
||||
class Transactions::CardSettleTransController < ApplicationController
|
||||
authorize_resource :class => false
|
||||
|
||||
# GET /transactions/sales
|
||||
# GET /transactions/sales.json
|
||||
def index
|
||||
@status = [["All Status",''], ["Approved","Approved"], ["Declined","Declined"]]
|
||||
@payment_method = [["All Payments",''],["MPU Payment","mpu"], ["Visa Payment","visa"],
|
||||
["Master Payment","master"], ["JCB Payment","jcb"],["UnionPay Payment","unionpay"],
|
||||
["Alipay Payment","alipay"]]
|
||||
@sales = Sale.all
|
||||
# byebug
|
||||
payment_type = params[:payment_type]
|
||||
sale_id = params[:sale_id]
|
||||
status_type = params[:status_type]
|
||||
|
||||
# from = params[:from]
|
||||
# to = params[:to]
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
if sale_id.nil? && from.nil? && to.nil? && payment_method.nil? && status_type.nil?
|
||||
|
||||
@cardSettles = CardSettleTran.order("sale_id desc")
|
||||
|
||||
@cardSettles = Kaminari.paginate_array(@cardSettles).page(params[:page]).per(20)
|
||||
else
|
||||
cardSettle = CardSettleTran.search(sale_id,from,to,payment_type,status_type)
|
||||
if cardSettle.count > 0
|
||||
@cardSettles = cardSettle
|
||||
@cardSettles = Kaminari.paginate_array(@cardSettles).page(params[:page]).per(20)
|
||||
else
|
||||
@cardSettles = 0
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# date range
|
||||
PERIOD = {
|
||||
"today" => 0,
|
||||
"yesterday" => 1,
|
||||
"this_week" => 2,
|
||||
"last_week" => 3,
|
||||
"last_7" => 4,
|
||||
"this_month" => 5,
|
||||
"last_month" => 6,
|
||||
"last_30" => 7,
|
||||
"this_year" => 8,
|
||||
"last_year" => 9
|
||||
}
|
||||
|
||||
def get_date_range_from_params
|
||||
period_type = params[:period_type]
|
||||
period = params[:period]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
day_ref = Time.now.utc.getlocal
|
||||
if from.present? && to.present?
|
||||
f_date = DateTime.parse(from)
|
||||
t_date = DateTime.parse(to)
|
||||
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
|
||||
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
|
||||
from = f_time.beginning_of_day.utc.getlocal
|
||||
to = t_time.end_of_day.utc.getlocal
|
||||
else
|
||||
case period.to_i
|
||||
when PERIOD["today"]
|
||||
from = day_ref.beginning_of_day.utc
|
||||
to = day_ref.end_of_day.utc
|
||||
|
||||
when PERIOD["yesterday"]
|
||||
from = (day_ref - 1.day).beginning_of_day.utc
|
||||
to = (day_ref - 1.day).end_of_day.utc
|
||||
|
||||
when PERIOD["this_week"]
|
||||
from = Time.now.beginning_of_week.utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["last_week"]
|
||||
from = (day_ref - 7.day).beginning_of_week.utc
|
||||
to = (day_ref - 7.day).end_of_week.utc
|
||||
when PERIOD["last_7"]
|
||||
from = (day_ref - 7.day).utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["this_month"]
|
||||
from = Time.now.beginning_of_month.utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["last_month"]
|
||||
from = (day_ref - 1.month).beginning_of_month.utc
|
||||
to = (day_ref - 1.month).end_of_month.utc
|
||||
when PERIOD["last_30"]
|
||||
from = (day_ref - 30.day).utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["this_year"]
|
||||
from = Time.now.beginning_of_year.utc
|
||||
to = Time.now.utc
|
||||
when PERIOD["last_year"]
|
||||
from = (day_ref - 1.year).beginning_of_year.utc
|
||||
to = (day_ref - 1.year).end_of_year.utc
|
||||
end
|
||||
end
|
||||
|
||||
return from, to
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,2 +1,81 @@
|
||||
class CardSettleTran < ApplicationRecord
|
||||
|
||||
belongs_to :shift_sale
|
||||
|
||||
def self.search(filter,from,to,payment_type,status_type)
|
||||
if filter.blank?
|
||||
keyword = ''
|
||||
else
|
||||
keyword = " e.name LIKE ?","%#{filter}%"
|
||||
end
|
||||
|
||||
if payment_type.blank?
|
||||
payment = ''
|
||||
else
|
||||
if payment_type == 'unionpay'
|
||||
payment = " req_type LIKE 'cup'"
|
||||
else
|
||||
payment = " req_type LIKE '#{payment_type}'"
|
||||
end
|
||||
end
|
||||
|
||||
if status_type.blank?
|
||||
status = ''
|
||||
else
|
||||
status = " status = '#{status_type}'"
|
||||
end
|
||||
|
||||
if from.present? && to.present?
|
||||
|
||||
from_date = from.strftime("%Y-%m-%d")
|
||||
to_date = to.strftime("%Y-%m-%d")
|
||||
query = CardSettleTran.joins("Join shift_sales ss ON ss.id = card_settle_trans.shift_sale_id"+
|
||||
" JOIN employees e ON e.id = ss.employee_id")
|
||||
cardSettle = query.where("req_date >= ? and req_date <= ?",from_date,to_date)
|
||||
query1 = cardSettle.where(keyword)
|
||||
query2 = query1.where(payment)
|
||||
query3 = query2.where(status)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def self.searchReport(from,to,payment_type,shift_sale_range,shift)
|
||||
|
||||
if payment_type.blank?
|
||||
payment = ''
|
||||
else
|
||||
if payment_type == 'unionpay'
|
||||
payment = " req_type LIKE 'cup'"
|
||||
else
|
||||
payment = " req_type LIKE '#{payment_type}'"
|
||||
end
|
||||
end
|
||||
|
||||
if from.present? && to.present?
|
||||
|
||||
from_date = from.strftime("%Y-%m-%d")
|
||||
to_date = to.strftime("%Y-%m-%d")
|
||||
query = CardSettleTran.joins("Join shift_sales ss ON ss.id = card_settle_trans.shift_sale_id"+
|
||||
" JOIN employees e ON e.id = ss.employee_id")
|
||||
cardSettle = query.where("req_date >= ? and req_date <= ? and status = 'Approved'",from_date,to_date)
|
||||
|
||||
if shift.present?
|
||||
query1 = cardSettle.where("ss.id in (?)", shift.to_a)
|
||||
elsif shift_sale_range.present?
|
||||
query1 = cardSettle.where("ss.id in (?)",shift_sale_range.to_a)
|
||||
else
|
||||
query1 = cardSettle.where("req_date between ? and ?",from,to)
|
||||
end
|
||||
query2 = query1.where(payment)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def self.get_by_shift_sale_by_card(from,to,status)
|
||||
query = ShiftSale.select("shift_sales.id ,shift_started_at AS opening_date,
|
||||
shift_closed_at As closing_date,")
|
||||
.order("shift_sales.id DESC")
|
||||
return query = query.where("shift_sales.shift_started_at >= ?" , from)
|
||||
byebug
|
||||
end
|
||||
end
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_card_sale_trans_path %>"><%= t :cb_settlement %></a>
|
||||
<a href="<%= transactions_card_settle_trans_path %>"><%= t :cb_settlement %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -187,6 +187,9 @@
|
||||
<li>
|
||||
<a href="<%= reports_card_sale_tran_index_path %>">CB Payments</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_card_settle_tran_index_path %>">CB Settlement</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<%end%>
|
||||
|
||||
@@ -59,7 +59,13 @@
|
||||
<td><%= cardSale.res_date %> <%= cardSale.res_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td><%= cardSale.ref_no %></td>
|
||||
<td><%= cardSale.res_amt %></td>
|
||||
<td><%= cardSale.app %></td>
|
||||
<td>
|
||||
<% if cardSale.app == 'cup' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSale.app %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSale.sale.customer.name rescue '-' %></td>
|
||||
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
|
||||
<td>TID : <%= cardSale.terminal_id %>
|
||||
|
||||
@@ -47,7 +47,13 @@
|
||||
<td><%= cardSale.res_date %> <%= cardSale.res_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td><%= cardSale.ref_no %></td>
|
||||
<td><%= cardSale.res_amt %></td>
|
||||
<td><%= cardSale.app %></td>
|
||||
<td>
|
||||
<% if cardSale.app == 'cup' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSale.app %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSale.sale.customer.name rescue '-' %></td>
|
||||
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
|
||||
<td>TID : <%= cardSale.terminal_id %>
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
<div class="p-l-15">
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
|
||||
<% if defined? @payment_method %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
<option value="1">Yesterday</option>
|
||||
<option value="2">This week</option>
|
||||
<option value="3">Last week</option>
|
||||
<option value="4">Last 7 days</option>
|
||||
<option value="5">This month</option>
|
||||
<option value="6">Last month</option>
|
||||
<option value="7">Last 30 days</option>
|
||||
<option value="8">This year</option>
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
<% if not defined? payments %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
|
||||
<select name="payment_type" id="payment_type" class="form-control">
|
||||
<% @payments.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
<%end %>
|
||||
<% @payment_method.each do |pm| %>
|
||||
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
shift_id = '<%= params[:shift_name] %>'
|
||||
local_date = '<%= @shift_from %> - <%= @shift_to %> '
|
||||
var shift = $('#shift_name');
|
||||
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
|
||||
shift.append(str);
|
||||
<% end %>
|
||||
|
||||
$('#sale_id').val("<%= params[:sale_id] %>");
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
|
||||
$(".<%=params[:payment_type]%>").attr('selected','selected')
|
||||
|
||||
|
||||
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||
$("#rd_period_type_1").attr("checked","checked");
|
||||
<% else %>
|
||||
$("#rd_period_type_0").attr("checked","checked");
|
||||
<% end %>
|
||||
$(".btn-group button").removeClass("active");
|
||||
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||
|
||||
$('#item').change(function(){
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
191
app/views/reports/card_settle_tran/index.html.erb
Normal file
191
app/views/reports/card_settle_tran/index.html.erb
Normal file
@@ -0,0 +1,191 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.cb_payments") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', dashboard_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<%= render :partial=>'shift_card_settle_tran_report_filter',
|
||||
:locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_card_settle_tran_index_path} %>
|
||||
<hr />
|
||||
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_card_settle_tran_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card" style="width:115%;">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th colspan="9"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.shift_sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.req_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.req_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.res_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.res_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.employee_name") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_cnt") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.void_cnt") %></th>
|
||||
<th><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.status") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @cardSettles != 0 %>
|
||||
<% @cardSettles.each do |cardSettle| %>
|
||||
<tr>
|
||||
<td><%= cardSettle.shift_sale.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> - <%= cardSettle.shift_sale.shift_closed_at ? cardSettle.shift_sale.shift_closed_at.strftime("%e %b %I:%M%p") : '-' %></td>
|
||||
<td><%= cardSettle.req_date %> <%= cardSettle.req_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td>
|
||||
<% if cardSettle.req_type == 'CUP' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSettle.req_type %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSettle.res_date %> <%= cardSettle.res_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td>
|
||||
<% if cardSettle.res_type == 'CUP' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSettle.res_type %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSettle.shift_sale.employee.name %></td>
|
||||
<td><%= cardSettle.sale_cnt %></td>
|
||||
<td><%= cardSettle.sale_amt %></td>
|
||||
<td><%= cardSettle.void_cnt %></td>
|
||||
<td><%= cardSettle.void_amt %></td>
|
||||
<td><%= cardSettle.status %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="10"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
search_by_period();
|
||||
|
||||
});
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
if(param_shift != ''){
|
||||
if(shift_id == param_shift){
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
79
app/views/reports/card_settle_tran/index.xls.erb
Normal file
79
app/views/reports/card_settle_tran/index.xls.erb
Normal file
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-type" content="application/vnd.ms-excel; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="9"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to ? @to.utc.getlocal.strftime("%Y-%b-%d") : '-'%></th>
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.shift_sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.req_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.req_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.res_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.res_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.employee_name") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_cnt") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.void_cnt") %></th>
|
||||
<th><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.status") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @cardSettles != 0 %>
|
||||
<% @cardSettles.each do |cardSettle| %>
|
||||
<tr>
|
||||
<td><%= cardSettle.shift_sale.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> - <%= cardSettle.shift_sale.shift_closed_at ? cardSettle.shift_sale.shift_closed_at.strftime("%e %b %I:%M%p") : '-' %></td>
|
||||
<td><%= cardSettle.req_date %> <%= cardSettle.req_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td>
|
||||
<% if cardSettle.req_type == 'CUP' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSettle.req_type %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSettle.res_date %> <%= cardSettle.res_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td>
|
||||
<% if cardSettle.res_type == 'CUP' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSettle.res_type %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSettle.shift_sale.employee.name %></td>
|
||||
<td><%= cardSettle.sale_cnt %></td>
|
||||
<td><%= cardSettle.sale_amt %></td>
|
||||
<td><%= cardSettle.void_cnt %></td>
|
||||
<td><%= cardSettle.void_amt %></td>
|
||||
<td><%= cardSettle.status %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="10"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -96,7 +96,13 @@
|
||||
<td><%= cardSale.res_date %> <%= cardSale.res_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td><%= cardSale.ref_no %></td>
|
||||
<td><%= cardSale.res_amt %></td>
|
||||
<td><%= cardSale.app %></td>
|
||||
<td>
|
||||
<% if cardSale.app == 'cup' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSale.app %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSale.sale.customer.name rescue '-' %></td>
|
||||
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
|
||||
|
||||
@@ -176,7 +182,7 @@
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
function search_by_date(){
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
@@ -196,9 +202,50 @@
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
if(param_shift != ''){
|
||||
if(shift_id == param_shift){
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
json.partial! "transactions_sales/transactions_sale", transactions_sale: @transactions_sale
|
||||
233
app/views/transactions/card_settle_trans/index.html.erb
Normal file
233
app/views/transactions/card_settle_trans/index.html.erb
Normal file
@@ -0,0 +1,233 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t :sale %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to 'Back', dashboard_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<%= form_tag transactions_card_settle_trans_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="sale_id" name="sale_id" class="form-control" placeholder="Cashier Name" style="margin-right: 10px;height: 34px;">
|
||||
</div>
|
||||
|
||||
<% if defined? @payment_method %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if not defined? status %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_status") %></label>
|
||||
|
||||
<select name="status_type" id="status_type" class="form-control">
|
||||
<% @status.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="card" style="width:112%;">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.shift_sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.req_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.req_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.res_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.res_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.employee_name") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_cnt") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.void_cnt") %></th>
|
||||
<th><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.status") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% if @cardSettles != 0 %>
|
||||
<% @cardSettles.each do |cardSettle| %>
|
||||
<tr>
|
||||
<td><%= cardSettle.shift_sale.shift_started_at.strftime("%e %b %I:%M%p") rescue '-' %> - <%= cardSettle.shift_sale.shift_closed_at ? cardSettle.shift_sale.shift_closed_at.strftime("%e %b %I:%M%p") : '-' %></td>
|
||||
<td><%= cardSettle.req_date %> <%= cardSettle.req_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td>
|
||||
<% if cardSettle.req_type == 'CUP' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSettle.req_type %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSettle.res_date %> <%= cardSettle.res_time.utc.getlocal.strftime("%I:%M %p") %></td>
|
||||
<td>
|
||||
<% if cardSettle.res_type == 'CUP' %>
|
||||
UNION
|
||||
<% else %>
|
||||
<%= cardSettle.res_type %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSettle.shift_sale.employee.name %></td>
|
||||
<td><%= cardSettle.sale_cnt %></td>
|
||||
<td><%= cardSettle.sale_amt %></td>
|
||||
<td><%= cardSettle.void_cnt %></td>
|
||||
<td><%= cardSettle.void_amt %></td>
|
||||
<td><%= cardSettle.status %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="10"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<% if @cardSettles != 0 %>
|
||||
<%= paginate @cardSettles %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
search_by_period();
|
||||
|
||||
});
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
from = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#from').val(from)
|
||||
search_by_date();
|
||||
});
|
||||
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
month = parseInt(new_date.getMonth()+1)
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
if(param_shift != ''){
|
||||
if(shift_id == param_shift){
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -29,6 +29,8 @@ en:
|
||||
top: "Top"
|
||||
orders: "Orders"
|
||||
shiftsale: "ShiftSale"
|
||||
cb_payments: "CB Payments"
|
||||
cb_settlement: "CB Settlement"
|
||||
credit: "Credit"
|
||||
bookings: "Booking"
|
||||
home: "Home"
|
||||
|
||||
@@ -26,6 +26,8 @@ mm:
|
||||
top: "အရောင်းရဆုံး"
|
||||
orders: "အော်ဒါများ"
|
||||
credit: "အကြွေး"
|
||||
cb_payments: "CB Payments"
|
||||
cb_settlement: "CB Settlement"
|
||||
bookings: "ကြိုတင်စာရင်းသွင်းခြင်း"
|
||||
home: "မူလစာမျက်နှာ"
|
||||
simple_menu_item: "ဟင်းလျာများ"
|
||||
|
||||
@@ -465,6 +465,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
resources :surveys
|
||||
resources :order_reservations
|
||||
resources :card_sale_trans
|
||||
resources :card_settle_trans
|
||||
|
||||
get "/sales/:sale_id/manual_complete_sale" => "manual_sales#manual_complete_sale", :as => "manual_complete_sale"
|
||||
get "/sales/:sale_id/void" => "manual_sales#void", :as => "void"
|
||||
@@ -489,6 +490,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
resources :order_reservation, :only => [:index, :show]
|
||||
resources :induty, :only => [:index, :show]
|
||||
resources :card_sale_tran
|
||||
resources :card_settle_tran
|
||||
|
||||
get "saleitem/get_shift_by_date", to: "saleitem#show", as: "get_shift_by_sale_item"
|
||||
get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date"
|
||||
|
||||
Reference in New Issue
Block a user