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

This commit is contained in:
Yan
2017-11-21 18:36:58 +06:30
11 changed files with 224 additions and 219 deletions

View File

@@ -59,11 +59,13 @@ select.form-control {
padding: 0px 0px 7px 0px;
}
/*
.order-info {
min-height:300px;
max-height:500px;
overflow:auto
}
*/
.others-payment{
line-height:100px;

View File

@@ -20,7 +20,9 @@ class Transactions::BookingsController < ApplicationController
@bookings = 0
end
end
@receipt_no = filter
@from = from
@to = to
respond_to do |format|
format.html # index.html.erb
format.json { render json: @bookings }

View File

@@ -14,20 +14,21 @@ class Transactions::CreditNotesController < ApplicationController
to = params[:to]
if filter.nil? && from.nil? && to.nil? && customer.nil?
@sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
else
sale = Sale.search_credit_sales(customer,filter,from,to)
if sale.count > 0
@sales = sale
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
@credit_notes = sale
@credit_notes = Kaminari.paginate_array(@credit_notes).page(params[:page]).per(20)
else
@sales = 0
@credit_notes = 0
end
end
puts "sssssssssssss"
puts @credit_notes.to_json
respond_to do |format|
format.html # index.html.erb
format.json { render json: @sales }
format.json { render json: @credit_notes }
end
end

View File

@@ -20,6 +20,10 @@ class Transactions::OrdersController < ApplicationController
else
@orders = []
end
@receipt_no = filter
@from = from
@to = to
respond_to do |format|
format.html # index.html.erb

View File

@@ -22,6 +22,9 @@ class Transactions::SalesController < ApplicationController
@sales = 0
end
end
@receipt_no = receipt_no
@from = from
@to = to
# if receipt_no.nil? && search_date.nil?
# @sales = Sale.where("NOT sale_status = 'void' " ).order("sale_id desc").limit(500)

View File

@@ -1,57 +1,118 @@
<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-7 col-lg-7">
<div class="card">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<%= f.input :child , input_html: { class: 'col-md-8' }%>
<%= f.input :adult , input_html: { class: 'col-md-8' }%>
<%= f.input :male , input_html: { class: 'col-md-8' }%>
<%= f.input :female , input_html: { class: 'col-md-8' }%>
<%= f.input :total_customer, input_html: { class: 'col-md-8'} %>
<%= f.input :local , input_html: { class: 'col-md-8' }%>
<%= f.input :child , input_html: { class: 'col-md-10' }%>
<%= f.input :adult , input_html: { class: 'col-md-10' }%>
<%= f.input :male , input_html: { class: 'col-md-10' }%>
<%= f.input :female , input_html: { class: 'col-md-10' }%>
<%= f.input :total_customer, input_html: { class: 'col-md-10'} %>
<%= f.input :local , input_html: { class: 'col-md-10' }%>
<div class="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
<div class="form-group p-l-10 p-r-10">
<label class="p-l-10">Foreigner</label>
<!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
<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 %>">
<%= ct.name %></option>
<%end %>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
<div class="form-group p-l-10 p-r-10">
<label class="p-l-10">Number</label>
<input type="number" name="survey[foreigner][]" class="form-control">
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
<br>
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
</div>
<div class="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
<div class="form-group p-l-10 p-r-10">
<label class="p-l-10">Foreigner</label>
<!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
<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 %>">
<%= ct.name %></option>
<%end %>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
<div class="form-group p-l-10 p-r-10">
<label class="p-l-10">Number</label>
<input type="number" name="survey[foreigner][]" class="form-control">
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
<br>
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
</div>
</div>
<div class="hidden" id="newTemplate" >
</div>
<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>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<div class="hidden" id="newTemplate" >
<% end %>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="p-l-70 m-b-10 m-t-10">
<div class="row bottom">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 m-l--5">
<div class="row m-l--5">
<div class="col-md-3 left cashier_number" data-value="1" data-type="num">1</div>
<div class="col-md-3 left cashier_number" data-value="2" data-type="num">2</div>
<div class="col-md-3 left cashier_number" data-value="3" data-type="num">3</div>
</div>
</div>
</div>
<div class="row bottom">
<div class="col-md-12 m-l--5">
<div class="row m-l--5">
<div class="col-md-3 left cashier_number" data-value="4" data-type="num">4</div>
<div class="col-md-3 left cashier_number" data-value="5" data-type="num">5</div>
<div class="col-md-3 left cashier_number" data-value="6" data-type="num">6</div>
</div>
</div>
</div>
<div class="row bottom">
<div class="col-md-12 m-l--5">
<div class="row m-l--5">
<div class="col-md-3 left cashier_number" data-value="7" data-type="num">7</div>
<div class="col-md-3 left cashier_number" data-value="8" data-type="num">8</div>
<div class="col-md-3 left cashier_number" data-value="9" data-type="num">9</div>
</div>
</div>
</div>
<div class="row bottom">
<div class="col-md-12 m-l--5">
<div class="row m-l--5">
<div class="col-md-3 left cashier_number" data-value="0" data-type="num">0</div>
<div class="col-md-3 left cashier_number" data-value="." data-type="num">.</div>
<div class="col-md-3 left cashier_number" data-value="00" data-type="num">00</div>
</div>
</div>
</div>
<div class="row bottom">
<div class="col-md-12 m-l--5">
<div class="row m-l--5">
<div class="col-md-3 left cashier_number"></div>
<div class="col-md-3 left cashier_number red" data-type="del">DEL</div>
<div class="col-md-3 left cashier_number green" data-type="clr">CLR</div>
</div>
</div>
</div>
</div>
</div>
<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>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3 hidden">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
@@ -85,19 +146,6 @@
<script type="text/javascript">
$(document).ready(function(){
// click back button for redirect
$('#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
}
});
//click add button for new row
$('#addForeigner').on('click',function(){
$('#newTemplate').removeClass('hidden');
@@ -131,5 +179,62 @@
$(this).parent().parent().remove()
});
$( "input" ).focusin(function() {
$('.addfocus').removeClass('addfocus');
$( this ).addClass('addfocus');
});
$(".cashier_number").on('click', function(event){
if(event.handled !== true) {
var original_value='';
original_value = $('.addfocus').val();
var input_type = $(this).attr("data-type");
switch (input_type) {
case 'num':
var input_value = $(this).attr("data-value");
if (original_value == "0.0"){
$('.addfocus').val(input_value);
}
else{
$('.addfocus').val(original_value + '' + input_value);
}
break;
case 'add':
var input_value = $(this).attr("data-value");
amount = parseInt(input_value);
$('.addfocus').val(amount);
break;
case 'del' :
var discount_text=$('.addfocus').val();
$('.addfocus').val(discount_text.substr(0,discount_text.length-1));
break;
case 'clr':
$('.addfocus').val("");
break;
}
event.handled = true;
} else {
return false;
}
});
// click back button for redirect
$('#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

@@ -19,15 +19,15 @@
<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">
<input type="text" id="receipt_no" 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">
<input class="form-control datepicker" name="from" id="from" 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">
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
@@ -88,7 +88,14 @@
</div>
</div>
<script type="text/javascript">
$(function(){
$("#receipt_no").val("<%=params[:receipt_no]%>");
$("#from").val("<%=params[:from]%>");
$("#to").val("<%=params[:to]%>");
});
</script>

View File

@@ -80,9 +80,9 @@
</thead>
<tbody>
<% if @sales != 0 %>
<% if @credit_notes != 0 %>
<% @sales.each do |sale| %>
<% @credit_notes.each do |sale| %>
<tr>
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
<td><%= sale.receipt_no %></td>
@@ -99,9 +99,9 @@
<% end %>
</tbody>
</table>
<br>
<% if @sales != 0 %>
<%= paginate @sales %>
<br>
<% if @credit_notes != 0 %>
<%= paginate @credit_notes %>
<% end %>
</div>
</div>

View File

@@ -15,7 +15,7 @@
<div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
<input type="text" name="filter" placeholder="Order ID" class="form-control input-md">
<input type="text" id="receipt_no" name="filter" placeholder="Order ID" class="form-control input-md" >
</div>
<!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label>Items Count</label>
@@ -28,11 +28,11 @@
</div> -->
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="form-control-label"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker" name="from" id="date from" type="text" placeholder="From date">
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="form-control-label"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker" name="to" id="date to" type="text" placeholder="To date">
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1">
@@ -84,139 +84,10 @@
</div>
<script type="text/javascript">
$(function(){
$("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>");
});
$(function(){
$("#receipt_no").val("<%=params[:receipt_no]%>");
$("#from").val("<%=params[:from]%>");
$("#to").val("<%=params[:to]%>");
});
</script>
<!-- <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>
-->

View File

@@ -19,15 +19,15 @@
<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="Receipt No/Cashier Name/Status" style="margin-right: 10px">
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Receipt No/Cashier Name/Status" 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">
<input class="form-control datepicker" name="from" id="from" 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">
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
@@ -96,14 +96,17 @@
<script type="text/javascript">
$(function(){
$("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>");
});
$(function(){
$("#receipt_no").val("<%=params[:receipt_no]%>");
$("#from").val("<%=params[:from]%>");
$("#to").val("<%=params[:to]%>");
});
</script>

View File

@@ -99,7 +99,14 @@
</div>
</div>
<script type="text/javascript">
$(function(){
$("#receipt_no").val("<%=params[:receipt_no]%>");
$("#from").val("<%=params[:from]%>");
$("#to").val("<%=params[:to]%>");
});
</script>