Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes

This commit is contained in:
phyusin
2017-11-22 10:23:39 +06:30
14 changed files with 248 additions and 222 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -11,6 +11,21 @@ class SaleItem < ApplicationRecord
def compute_item def compute_item
end end
# Add Sale Items
def self.add_sale_items(sale_items, )
sale_items.each do|saleitemObj|
saleitemObj.remark = 'foc'
saleitemObj.save
@newsaleitem = SaleItem.new
@newsaleitem = saleitemObj.dup
@newsaleitem.save
@newsaleitem.qty = saleitemObj.qty * -1
@newsaleitem.price = saleitemObj.price * -1
@newsaleitem.is_taxable = 1
@newsaleitem.product_name = saleitemObj.product_name + ' (FOC)'
@newsaleitem.save
end
end
def self.get_order_items_details(sale_id) def self.get_order_items_details(sale_id)
order_details = SaleItem.select("sales.total_tax as tax_amount, sales.grand_total as grand_total_amount , sales.total_discount as discount_amount,sales.receipt_date as receipt_date, order_details = SaleItem.select("sales.total_tax as tax_amount, sales.grand_total as grand_total_amount , sales.total_discount as discount_amount,sales.receipt_date as receipt_date,

View File

@@ -169,12 +169,18 @@ class SalePayment < ApplicationRecord
def foc_payment def foc_payment
payment_status = false payment_status = false
# add to sale item with foc
sale_items = SaleItem.find_by_sale_id(self.sale)
SaleItem.add_sale_items(sale_items)
self.payment_method = "foc" self.payment_method = "foc"
self.payment_amount = self.received_amount self.payment_amount = self.received_amount
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
self.payment_status = "paid" self.payment_status = "paid"
payment_method = self.save! payment_method = self.save!
sale_update_payment_status(self.received_amount) sale_update_payment_status(self.received_amount)
return payment_status return payment_status
end end

View File

@@ -1,57 +1,118 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8"> <div class="col-xs-12 col-sm-12 col-md-7 col-lg-7">
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %> <div class="card">
<%= f.error_notification %> <%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
<div class="form-inputs p-l-10"> <%= f.error_notification %>
<div class="form-inputs p-l-10">
<%= f.input :child , input_html: { class: 'col-md-8' }%> <%= f.input :child , input_html: { class: 'col-md-10' }%>
<%= f.input :adult , input_html: { class: 'col-md-8' }%> <%= f.input :adult , input_html: { class: 'col-md-10' }%>
<%= f.input :male , input_html: { class: 'col-md-8' }%> <%= f.input :male , input_html: { class: 'col-md-10' }%>
<%= f.input :female , input_html: { class: 'col-md-8' }%> <%= f.input :female , input_html: { class: 'col-md-10' }%>
<%= f.input :total_customer, input_html: { class: 'col-md-8'} %> <%= f.input :total_customer, input_html: { class: 'col-md-10'} %>
<%= f.input :local , input_html: { class: 'col-md-8' }%> <%= f.input :local , input_html: { class: 'col-md-10' }%>
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 "> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
<div class="form-group p-l-10 p-r-10"> <div class="form-group p-l-10 p-r-10">
<label class="p-l-10">Foreigner</label> <label class="p-l-10">Foreigner</label>
<!-- <input type="text" class="form-control" name="survey[foreigner][]"> --> <!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
<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| %> <% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
<option value="<%= ct.value %>"> <option value="<%= ct.value %>">
<%= ct.name %></option> <%= ct.name %></option>
<%end %> <%end %>
</select> </select>
</div> </div>
</div> </div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 "> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
<div class="form-group p-l-10 p-r-10"> <div class="form-group p-l-10 p-r-10">
<label class="p-l-10">Number</label> <label class="p-l-10">Number</label>
<input type="number" name="survey[foreigner][]" class="form-control"> <input type="number" name="survey[foreigner][]" class="form-control">
</div> </div>
</div> </div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 "> <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
<br> <br>
<button type="button" class="btn btn-success" id="addForeigner">Add</button> <button type="button" class="btn btn-success" id="addForeigner">Add</button>
</div> </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>
<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> </div>
</div>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>"> </div>
<%= 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 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="card">
<div class="body"> <div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5> <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"> <script type="text/javascript">
$(document).ready(function(){ $(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 //click add button for new row
$('#addForeigner').on('click',function(){ $('#addForeigner').on('click',function(){
$('#newTemplate').removeClass('hidden'); $('#newTemplate').removeClass('hidden');
@@ -131,5 +179,62 @@
$(this).parent().parent().remove() $(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> </script>

View File

@@ -19,15 +19,15 @@
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label> <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>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.from") %></label> <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>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.to") %></label> <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>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1"> <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
@@ -88,7 +88,14 @@
</div> </div>
</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> </thead>
<tbody> <tbody>
<% if @sales != 0 %> <% if @credit_notes != 0 %>
<% @sales.each do |sale| %> <% @credit_notes.each do |sale| %>
<tr> <tr>
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td> <td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
<td><%= sale.receipt_no %></td> <td><%= sale.receipt_no %></td>
@@ -99,9 +99,9 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<br> <br>
<% if @sales != 0 %> <% if @credit_notes != 0 %>
<%= paginate @sales %> <%= paginate @credit_notes %>
<% end %> <% end %>
</div> </div>
</div> </div>

View File

@@ -15,7 +15,7 @@
<div class="row clearfix"> <div class="row clearfix">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> <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> <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>
<!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2"> <!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label>Items Count</label> <label>Items Count</label>
@@ -28,11 +28,11 @@
</div> --> </div> -->
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2"> <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> <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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2"> <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> <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>
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1"> <div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1">
@@ -84,139 +84,10 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#from").val("<%=params[:from] rescue '-'%>"); $("#receipt_no").val("<%=params[:receipt_no]%>");
$("#to").val("<%=params[:to] rescue '-'%>"); $("#from").val("<%=params[:from]%>");
}); $("#to").val("<%=params[:to]%>");
});
</script> </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="row clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label> <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>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.from") %></label> <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>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<label class=""><%= t("views.right_panel.detail.to") %></label> <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>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1"> <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
@@ -96,14 +96,17 @@
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#from").val("<%=params[:from] rescue '-'%>"); $("#receipt_no").val("<%=params[:receipt_no]%>");
$("#to").val("<%=params[:to] rescue '-'%>"); $("#from").val("<%=params[:from]%>");
}); $("#to").val("<%=params[:to]%>");
});
</script> </script>

View File

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

View File

@@ -1,4 +1,4 @@
application_path = Rails.root application_path = ENV.fetch("SX_PATH") {'/home/superuser/Application/production/sxrestaurant'}
directory application_path directory application_path
environment ENV.fetch("RAILS_ENV") { "development" } environment ENV.fetch("RAILS_ENV") { "development" }
daemonize true daemonize true
@@ -6,5 +6,5 @@ pidfile "#{application_path}/tmp/puma/pid"
state_path "#{application_path}/tmp/puma/state" state_path "#{application_path}/tmp/puma/state"
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
port ENV.fetch("PORT") { 62158 } port ENV.fetch("PORT") { 62158 }
bind 'tcp://0.0.0.0:62158'
workers 2 workers 2
preload_app!