Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-11-14 15:54:17 +06:30
41 changed files with 536 additions and 146 deletions

View File

@@ -16,7 +16,6 @@
//= require bootstrap/js/popper.min
//= require bootstrap/js/bootstrap-material-design.min
//= require jquery_nested_form
//= require cable
//= require momentjs/moment
//= require bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker
//= require multi-select/js/jquery.multi-select.js
@@ -52,7 +51,7 @@ $(document).ready(function() {
$('.datepicker').bootstrapMaterialDatePicker({
format: 'DD-MM-YYYY',
clearButton: false,
clearButton: true,
weekStart: 1,
time: false
});
@@ -343,6 +342,7 @@ $(document).ready(function(){
}
});
});
});

View File

@@ -6,7 +6,9 @@ class Origami::DiscountsController < BaseOrigamiController
sale_id = params[:id]
if Sale.exists?(sale_id)
@sale_data = Sale.find(sale_id)
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
end
@member_discount = MembershipSetting.find_by_discount(1)
@accounts = Account.all
end

View File

@@ -5,6 +5,7 @@ class Origami::OtherChargesController < BaseOrigamiController
sale_id = params[:sale_id]
if Sale.exists?(sale_id)
@sale_data = Sale.find(sale_id)
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
end
end

View File

@@ -0,0 +1,59 @@
class Transactions::BookingsController < ApplicationController
load_and_authorize_resource except: [:create]
before_action :set_transactions_booking, only: [:show, :edit, :update, :destroy]
def index
filter = params[:filter]
from = params[:from]
to = params[:to]
if filter.nil? && from.nil? && to.nil?
@bookings = Booking.all.order("sale_id desc")
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
else
sale = Sale.search(filter,from,to)
if sale.count > 0
@bookings = sale
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
else
@bookings = 0
end
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @bookings }
end
end
# GET /transactions/bookings/1
# GET /transactions/bookings/1.json
def show
@booking = Booking.find(params[:id])
@order_items = []
@booking.booking_orders.each do |booking_order|
@order = Order.find(booking_order.order_id)
#if (order.status == "new")
@order_items = @order_items + @order.order_items
#end
end
if @booking.sale_id.present?
@sale = Sale.find(@booking.sale_id)
end
respond_to do |format|
format.html # show.html.erb
format.json { render json: @booking }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_transactions_booking
@transactions_booking = Booking.find(params[:id])
end
end

View File

@@ -41,6 +41,22 @@ class Booking < ApplicationRecord
return new_dining.type
end
def self.search(filter,from,to)
if filter.blank?
keyword = ''
else
keyword = "booking_id LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%"
end
if from.present? && to.present?
sale = Sale.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and NOT sale_status = 'void' ", from,to)
query = sale.where(keyword)
else
where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%",)
end
end
private
def generate_custom_id
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")

View File

@@ -62,7 +62,7 @@
<td class="item-attr"><strong id="sub_total">0.00</strong></td>
</tr>
</table>
<button type="button" class="btn btn-success create" id="create_order" disabled="disabled">Create Order</button>
<button type="button" class="btn btn-success btn-block create" id="create_order" disabled="disabled">Create Order</button>
</div>
</div>
</div>

View File

@@ -112,7 +112,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -1,15 +1,14 @@
<div class="container-fluid">
<div class="page-header">
<!-- <div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li>
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<span class="float-right">
<a href="#" id="back">Back</a>
<!-- <%= link_to 'Back', dashboard_path %> -->
</span>
</ul>
</div>
</div> -->
<div class="row">
@@ -101,7 +100,7 @@
</div>
<!-- <div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll"> -->
<div class="col-lg-4 col-md-4 col-sm-4" >
<div class="col-lg-3 col-md-3 col-sm-3" >
<div id="custom-slimscroll">
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
@@ -113,14 +112,14 @@
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group">
<label>Salutation :</label><br>
<label>Mr</label>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr", :style=>"width: 30px"%>
<label>Miss</label>
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs", :style=>"width: 30px"%>
<label>Mrs</label>
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss", :style=>"width: 30px"%>
<label>Mdm</label>
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm", :style=>"width: 30px"%>
<label class="font-13">Mr</label>
<%= f.radio_button :salutation,"Mr", :class => "salutation mr", :value=>"Mr"%>
<label class="m-l--20">Miss</label>
<%= f.radio_button :salutation,"Mrs", :class => "salutation mrs", :value=>"Mrs"%>
<label class="m-l--20">Mrs</label>
<%= f.radio_button :salutation,"Miss", :class => "salutation miss", :value=>"Miss"%>
<label class="m-l--20">Mdm</label>
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm"%>
</div>
<div class="form-group <%= (flash["errors"]) ? "has-error" : "" %>">
@@ -238,7 +237,10 @@
</div>
<%end%>
</div>
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
</div>
</div>
<div id="sxModal">

View File

@@ -13,6 +13,8 @@
<div class="card-block">
<div class="card-title row">
<div class="col-lg-6 col-md-6 col-sm-6">
<span class="hidden" id ="table_id" value="<%=@table.id%>"><%=@table.id%></span>
<span class="hidden" id="table_type" value="<%=@table.type%>"><%=@table.type%></span>
<p id="sale-id" class="hidden"><%=@sale_data.sale_id %></p>
<p class="m-l-10">Receipt No: <span id="receipt_no"><%=@sale_data.receipt_no rescue ' '%></span></p>
<!-- <p>Cashier: <span id="cashier"><%=@sale_data.cashier_name rescue ' '%></span></p> -->
@@ -209,7 +211,7 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Action Panel -->
<div>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami';"><i class="material-icons">reply</i> Back </button>
<button type="button" class="btn bg-default btn-block" id="back" ><i class="material-icons">reply</i> Back </button>
<button id="remove-item-discount" class="btn btn-primary btn- action-btn">Remove Item Discount</button>
<button id="remove-all" class="btn bg-primary btn-block action-btn">Remove All</button>
<button id="pay-discount" class="btn bg-primary btn-block action-btn">Enter</button>
@@ -225,6 +227,19 @@
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
var id = $("#table_id").text();
var type = $("#table_type").text();
console.log(id);
console.log(type);
if (type=="Table") {
window.location.href = '/origami/table/'+id
}else{
window.location.href = '/origami/room/'+id
}
})
$(".cashier_number").on('click', function(event){
if(event.handled !== true) {
var original_value=0;

View File

@@ -107,17 +107,16 @@
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<!-- <button id="refreshbutton" type="button" class="btn btn-block radius-btn"> Refresh off </button> -->
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
<button id="back" type="button" class="btn btn-block btn-lg bg-default"> <i class="material-icons">reply</i> <%= t("views.btn.back") %>
</button>
<%end%>
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
<!-- Temporary Disabled -->
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
<button id="back" type="button" class="btn btn-block btn-lg bg-default"><i class="fa fa-home fa-lg"></i> <%= t("views.btn.back") %>
</button>
<%end%>
</div>
</div>
</div>

View File

@@ -16,7 +16,7 @@
<%= f.button :submit, "Update", :class => 'btn btn-primary ', :disabled => '', :id => 'update' %>
<%= f.button :button, "Reset", :class => 'btn btn-danger ', :id => 'reset' %>
<button type="button" class="btn btn-inverse pull-right" id='back'><i class="fa fa-arrow-left"></i> Back</button>
<button type="button" class="btn btn-inverse pull-right" id='back'> <button type="button" class="btn bg-default btn-block" onclick="window.location.href = "origami_index_in_duty_path(@table.id)"><i class="material-icons">reply</i> Back </button>Back</button>
</div>
<% end %>

View File

@@ -49,14 +49,14 @@
<%= paginate @duties_in %>
</div>
</div>
<div class="col-md-3 partial">
<%= render 'form', in_duty: @in_duty, table: @table %>
</div>
<div class="col-md-1">
<br>
<button type="button" class="form-control btn btn-default btn-block" id='back'>Back</button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons m-t--5">reply</i> Back </button>
<button class="form-control btn btn-info btn-block" id="reset">New</button>
</div>
</div>
@@ -103,9 +103,9 @@
});
});
$('#back').on('click', function () {
window.location.href = '/origami/table/' + "<%= @table.id %>";
});
// $('#back').on('click', function () {
// window.location.href = '/origami/table/' + "<%= @table.id %>";
// });
$('#reset').click(function () {
location.reload();
/*var url = "<%= origami_index_in_duty_path %>";

View File

@@ -99,7 +99,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn btn-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -99,7 +99,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn btn-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>
</div>

View File

@@ -101,7 +101,7 @@
</div>
<div class="col-md-1 col-lg-1 col-sm-1">
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>

View File

@@ -193,7 +193,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default btn-block" id='back'>Back</button>
<button type="button" class="btn bg-default btn-block " id='back'><i class="material-icons">reply</i>Back</button>
<% if @sale_status != 'completed' %>
<button type="button" class="btn bg-blue btn-block" id='move'>MOVE</button>
<% end %>

View File

@@ -192,7 +192,7 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Action Panel -->
<div>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami';"><i class="material-icons">reply</i> Back </button>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons">reply</i> Back </button>
<button id="charge_other" class="btn bg-success btn-block action-btn">Enter</button>
</div>
</div>

View File

@@ -21,7 +21,7 @@
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 m-t-10">
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> Back </button>
<button type="button" class="btn bg-default m- btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -102,7 +102,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
</div>

View File

@@ -312,7 +312,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Waiter Buttons -->
<button type="button" class="btn btn-default btn-block" id='back'><i class="fa fa-arrow-left"></i> Back</button>
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i> Back</button>
<button type="button" id="add_order" class="btn btn-block btn- bg-blue waves-effect">Add Order</button>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
<% if @room.bookings.length >= 1 %>
@@ -420,19 +420,17 @@ $(document).ready(function(){
window.location.href = '/origami/order/' + order_id;
});
// bind survey to order or sale
$("#survey").on('click', function () {
var sale = $('#sale_id').val();
if (sale) {
var sale_id = sale
} else {
var sale_id = $('#save_order_id').attr('data-order');
}
var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/survey"
});
// bind survey to order or sale
$("#survey").on('click', function () {
var sale = $('#sale_id').val();
if (sale) {
var sale_id = sale
} else {
var sale_id = "<%= @room.id %>";
}
//var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/surveys"
});
// bind customer to order or sale
$("#customer").on('click', function(){
var sale = $('#sale_id').val();

View File

@@ -197,7 +197,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'>Back</button>
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
<% if @sale.sale_status != 'void' %>
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
<% end %>

View File

@@ -1,72 +1,91 @@
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<%= f.input :child%>
<%= f.input :adult %>
<%= f.input :male %>
<%= f.input :female %>
<%= f.input :local %>
<%= f.input :child%>
<%= f.input :adult %>
<%= f.input :male %>
<%= f.input :female %>
<%= f.input :local %>
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Foreigner</label>
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][][]" style="height: " >
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][][]" style="height: " >
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
<option value="<%= ct.value %>">
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
<%end %>
</select>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Number</label>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<label>Number</label>
<input type="number" name="survey[foreigner][][]" class="form-control">
</div>
</div>
</div>
<%= f.input :total_customer %>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
</div>
<%= f.input :total_customer %>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<p>
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.title_txt") %> <br>
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.account_type_txt") %> <br>
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.title_txt") %> <br>
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.account_type_txt") %> <br>
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table_id = '<%=@dining_facility.id%>';
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
})
});
</script>

View File

@@ -9,7 +9,7 @@
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<div class="card">
<table class="table table-striped">
<thead>
@@ -70,5 +70,22 @@
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table = '<%=@dining_facility.id%>';
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
})
});
</script>

View File

@@ -1,4 +1,4 @@
<div class="page-header">
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= '/origami/table/@dining_facility.id' %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.survey") %></li>
@@ -7,6 +7,6 @@
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/table/'+@dining_facility.id.to_s %>
</span>
</ol>
</div>
</div> -->
<%= render 'form', survey: @survey %>

View File

@@ -99,7 +99,7 @@
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn bg-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"> Back </button>
<button type="button" class="btn bg-default m-t-10 btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/payment/others_payment';"><i class="material-icons m-t--5">reply</i> Back </button>
</div>
</div>
</div>

View File

@@ -145,6 +145,7 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
console.log(date);
$('#from').val(date.format("DD-MM-YYYY"))
search_by_date();
});

View File

@@ -0,0 +1,95 @@
<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 :booking %></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_orders_path, :method => :get do %>
<div class="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="from date" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="to date" type="text" placeholder="To date">
</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">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th><%= t("views.right_panel.detail.booking_id") %></th>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.table") %></th>
<th><%= t("views.right_panel.detail.checkin_time") %></th>
<th><%= t("views.right_panel.detail.checkout_time") %></th>
<th><%= t("views.right_panel.detail.checkin_by") %></th>
<th> <%= t("views.right_panel.detail.checkout_by") %></th>
<th><%= t("views.right_panel.detail.booking_status") %></th>
<th><%= t("views.right_panel.detail.booking_date") %></th>
</tr>
</thead>
<tbody>
<% if @bookings != 0 %>
<% @bookings.each do |booking| %>
<tr>
<td><%= link_to booking.booking_id, transactions_booking_path(booking) %></td>
<td><%= link_to booking.sale_id, transactions_sale_path(booking.sale_id) rescue '-' %></td>
<td><%= booking.dining_facility.name %></td>
<td><%= booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></td>
<td><%= booking.checkout_at.utc.getlocal.strftime("%I:%M %p") rescue '-' %></td>
<td><%= booking.checkin_by rescue '-' %></td>
<td><%= booking.checkout_by rescue '-' %></td>
<td> <%= booking.booking_status %> </td>
<td> <%= booking.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% end %>
<% else %>
<tr><td colspan="8"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
<% end %>
</tbody>
</table>
<br>
<% if @bookings != 0 %>
<%= paginate @bookings %>
<% end %>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
json.array! @transactions_sales, partial: 'transactions_sales/transactions_sale', as: :transactions_sale

View File

@@ -0,0 +1,59 @@
<p id="notice"><%= notice %></p>
<h1><%= t("views.right_panel.header.transactions_sales") %></h1>
<table>
<thead>
<tr>
<th><%= t :cashier %></th>
<th><%= t :cashier %> <%= t("views.right_panel.detail.name_txt2") %></th>
<th><%= t("views.right_panel.detail.requested_by") %></th>
<th><%= t("views.right_panel.detail.requested_at") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
<th><%= t :customer %></th>
<th><%= t("views.right_panel.detail.payment_status") %></th>
<th><%= t("views.right_panel.detail.sale_status") %></th>
<th><%= t("views.right_panel.detail.total_amount") %></th>
<th><%= t("views.right_panel.detail.total_discount") %></th>
<th><%= t("views.right_panel.detail.total_tax") %></th>
<th><%= t("views.right_panel.detail.tax_type") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t("views.right_panel.detail.rnd_adj") %></th>
<th><%= t("views.right_panel.detail.amt_received") %></th>
<th><%= t("views.right_panel.detail.amt_changed") %></th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @transactions_sales.each do |transactions_sale| %>
<tr>
<td><%= transactions_sale.cashier %></td>
<td><%= transactions_sale.cashier_name %></td>
<td><%= transactions_sale.requested_by %></td>
<td><%= transactions_sale.requested_at %></td>
<td><%= transactions_sale.receipt_no %></td>
<td><%= transactions_sale.receipt_date %></td>
<td><%= transactions_sale.customer %></td>
<td><%= transactions_sale.payment_status %></td>
<td><%= transactions_sale.sale_status %></td>
<td><%= transactions_sale.total_amount %></td>
<td><%= transactions_sale.total_discount %></td>
<td><%= transactions_sale.total_tax %></td>
<td><%= transactions_sale.tax_type %></td>
<td><%= transactions_sale.grand_total %></td>
<td><%= transactions_sale.rounding_adjustment %></td>
<td><%= transactions_sale.amount_received %></td>
<td><%= transactions_sale.amount_changed %></td>
<td><%= link_to t("views.btn.show"), transactions_sale %></td>
<td><%= link_to t("views.btn.edit"), edit_transactions_sale_path(transactions_sale) %></td>
<td><%= link_to t("views.btn.delete"), transactions_sale, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Transactions Sale', new_transactions_sale_path %>

View File

@@ -0,0 +1,140 @@
<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"><a href="<%= transactions_bookings_path %>"><%= t :booking %></a></li>
<li class="breadcrumb-item active"><%= t :details %></li>
<span class="float-right">
<%= link_to 'Back', transactions_bookings_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#booking" role="tab"><%= t :booking_details %></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#order" role="tab"><%= t :order_details %></a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#sale" role="tab"><%= t :sale_details %></a>
</li>
</ul>
<!-- Nav tabs - End -->
<div class="tab-content" style="min-height:670px; max-height:670px;">
<div class="tab-pane active" id="booking" role="tabpanel">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.booking_id") %></th>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.table") %></th>
<th><%= t("views.right_panel.detail.checkin_time") %></th>
<th><%= t("views.right_panel.detail.checkout_time") %></th>
<th><%= t("views.right_panel.detail.checkin_by") %></th>
<th> <%= t("views.right_panel.detail.checkout_by") %></th>
<th><%= t("views.right_panel.detail.booking_status") %></th>
<th><%= t("views.right_panel.detail.booking_date") %></th>
</tr>
</thead>
<tbody>
<tr>
<td><%= @booking.booking_id%></td>
<td><%= link_to @booking.sale_id, transactions_sale_path(booking.sale_id) rescue '-' %></td>
<td><%= @booking.dining_facility.name %></td>
<td><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></td>
<td><%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") rescue '-' %></td>
<td><%= @booking.checkin_by rescue '-' %></td>
<td><%= @booking.checkout_by rescue '-' %></td>
<td><%= @booking.booking_status %> </td>
<td><%= @booking.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="order" role="tabpanel">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.order_id") %></th>
<th><%= t("views.right_panel.header.menu_item") %></th>
<th><%= t("views.right_panel.detail.qty") %></th>
<th><%= t("views.right_panel.detail.unit_price") %></th>
<th><%= t("views.right_panel.detail.option") %></th>
<th><%= t("views.right_panel.detail.status") %></th>
<th><%= t("views.right_panel.detail.waiter") %></th>
<th><%= t("views.right_panel.detail.created_at") %></th>
</tr>
</thead>
<tbody>
<% @order_items.each do |order_item| %>
<tr>
<td><%= link_to order_item.order_id, transactions_order_path(order_item.order_id) %><%= %></td>
<td><%= order_item.item_name %></td>
<td><%= order_item.qty %></td>
<td><%= order_item.price %></td>
<td><%= order_item.options %></td>
<td><%= order_item.order_item_status %></td>
<td><%= order_item.item_order_by %> </td>
<td><%= order_item.created_at.strftime("%d-%m-%y %I:%M %p") %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="sale" role="tabpanel">
<div class="table-responsive">
<table class="table table- table-striped table-hover js-basic- ">
<thead>
<tr>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th><%= t("views.right_panel.detail.total_discount") %></th>
<th><%= t("views.right_panel.detail.tax_amount") %></th>
<th><%= t("views.right_panel.detail.sub_total") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
<th><%= t :cashier %></th>
<th><%= t("views.right_panel.detail.sales_status") %></th>
<th><%= t("views.right_panel.detail.receipt_date") %></th>
</tr>
</thead>
<tbody>
<% if @sale %>
<tr>
<td><%= link_to @sale.sale_id, transactions_sale_path(@sale) %></td>
<td><%= @sale.receipt_no %></td>
<td><%= @sale.total_discount %></td>
<td><%= @sale.total_tax %></td>
<td><%= @sale.total_amount %></td>
<td><%= @sale.grand_total rescue '-' %></td>
<td><%= @sale.cashier_name rescue '-' %></td>
<td> <%= @sale.sale_status %> </td>
<td> <%= @sale.receipt_date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
<% else %>
<tr><td colspan="9"><strong><p style="text-align: center">There is no data ....</p></strong></td></tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
json.partial! "transactions_sales/transactions_sale", transactions_sale: @transactions_sale

View File

@@ -100,7 +100,9 @@
</tbody>
</table>
<br>
<% if @sales != 0 %>
<%= paginate @sales %>
<% end %>
</div>
</div>
</div>

View File

@@ -73,7 +73,7 @@
</table>
<br>
<%if !@order.nil?%>
<%if !@orders.nil?%>
<%= paginate @orders %>
<%end%>
</div>

View File

@@ -1,27 +0,0 @@
<%= simple_form_for(@transactions_sale) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.association :cashier %>
<%= f.input :cashier_name %>
<%= f.input :requested_by %>
<%= f.input :requested_at %>
<%= f.input :receipt_no %>
<%= f.input :receipt_date %>
<%= f.association :customer %>
<%= f.input :payment_status %>
<%= f.input :sale_status %>
<%= f.input :total_amount %>
<%= f.input :total_discount %>
<%= f.input :total_tax %>
<%= f.input :tax_type %>
<%= f.input :grand_total %>
<%= f.input :rounding_adjustment %>
<%= f.input :amount_received %>
<%= f.input :amount_changed %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -1,2 +0,0 @@
json.extract! transactions_sale, :id, :cashier_id, :cashier_name, :requested_by, :requested_at, :receipt_no, :receipt_date, :customer_id, :payment_status, :sale_status, :total_amount, :total_discount, :total_tax, :tax_type, :grand_total, :rounding_adjustment, :amount_received, :amount_changed, :created_at, :updated_at
json.url transactions_sale_url(transactions_sale, format: :json)

View File

@@ -1,6 +0,0 @@
<h1>Editing Transactions Sale</h1>
<%= render 'form', transactions_sale: @transactions_sale %>
<%= link_to t("views.btn.show"), @transactions_sale %> |
<%= link_to 'Back', transactions_sales_path %>

View File

@@ -1,5 +0,0 @@
<h1>New Transactions Sale</h1>
<%= render 'form', transactions_sale: @transactions_sale %>
<%= link_to 'Back', transactions_sales_path %>

View File

@@ -142,7 +142,7 @@
<tbody>
<% @order_items.each do |order_item| %>
<tr>
<td><%= order_item.order_id %></td>
<td><%= link_to order_item.order_id, transactions_order_path(order_item.order_id) %><%= %></td>
<td><%= order_item.item_name %></td>
<td><%= order_item.qty %></td>
<td><%= order_item.price %></td>

View File

@@ -63,6 +63,7 @@ en:
customer_details: "Customer Details"
order_details: "Order Details"
sale_details: "Sale Details"
booking_details: "Booking Details"
inventory_definitions: "Inventory Definitions"
sale_audits: "Sale Audits"

View File

@@ -63,6 +63,7 @@ mm:
customer_details: "စားသုံးသူကိုယ်ရေးအသေးစိတ်"
order_details: "မှာကြားမှုအသေးစိတ်"
sale_details: "ရောင်းရငွေအသေးစိတ်"
booking_details: "ရောင်းရငွေအသေးစိတ်"
inventory_definitions: "ကုန်လှောင်ရုံပစ္စည်းဖွင့်ဆိုချက်များ"
sale_audits: "အရောင်းပြင်ဆင်ခြင်းများ"

View File

@@ -335,6 +335,7 @@ scope "(:locale)", locale: /en|mm/ do
resources :sales
resources :orders
resources :credit_notes
resources :bookings
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"