Mobile responsive for Transaction View

This commit is contained in:
code2lab
2019-05-30 15:27:30 +06:30
parent 0016318611
commit 5a1bbb3fb4
14 changed files with 353 additions and 296 deletions

View File

@@ -24,8 +24,8 @@
<!-- </div> -->
<!-- </div> -->
<div class="margin-top-20">
<div class="card">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card">
<table class="table table-striped" border="0">
<thead>

View File

@@ -15,10 +15,10 @@
<hr />
<div class="text-right">
<a href="javascript:export_to('<%=reports_receipt_no_detail_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
</div>
</div>
<div class="margin-top-20">
<div class="card">
<div class="margin-top-20 mbl-table">
<div class="card mbl-table-card">
<table class="table table-striped" border="0">
<thead>
<tr>
@@ -27,9 +27,9 @@
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<% end %>
<th colspan="7"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr>
<% end %>
@@ -37,9 +37,9 @@
<th><b><%= t("views.right_panel.detail.shift_name") %></b></th>
<th><b><%= t("views.right_panel.detail.table") %></b></th>
<th><b><%= t("views.right_panel.detail.receipt_no") %></b></th>
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
<th><b><%= t("views.right_panel.detail.revenue") %></b></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -48,7 +48,7 @@
<% table_name=nil
table_type =nil
if result.table_id.to_i>0
table = DiningFacility.find(result.table_id)
table = DiningFacility.find(result.table_id)
table_type = table.type
table_name = table.name
end %>
@@ -57,7 +57,7 @@
<td><%= @shift_from %> - <%= @shift_to %></td>
<td><%= table_type %> - <%= table_name %></td>
<td><%= result.receipt_no rescue '-' %> </td>
<td><%= result.cashier_name rescue '-' %></td>
<td><%= result.cashier_name rescue '-' %></td>
<td><%=result.grand_total%></td>
<!-- <td>&nbsp;</td> -->
</tr>
@@ -76,8 +76,8 @@
<% if item.price.to_i < 0.to_i %>
<% if item.qty.to_i < 0.to_i%>
[PROMO QTY]<%= item.product_name rescue '-' %>
<% else %>
[PROMO PRICE]<%= item.product_name rescue '-' %>
<% else %>
[PROMO PRICE]<%= item.product_name rescue '-' %>
<% end %>
<% else %>
<%= item.product_name rescue '-' %>
@@ -86,70 +86,70 @@
<td><%= item.qty rescue '-' %></td>
<td><%= item.unit_price rescue '-' %></td>
<td><%= item.price rescue '-' %></td>
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
</tr>
<% end %>
<tr><td colspan="5">&nbsp;</td></tr>
<%survey = Survey.find_by_receipt_no(result.receipt_no)%>
<% if !survey.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>No. of Guest</td>
<td><%= survey.total_customer rescue '-' %></td>
<td>&nbsp;</td>
</tr>
<% end %>
<td>&nbsp;</td>
</tr>
<% end %>
<% if !result.total_amount.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td><%= result.total_amount %></td>
<td>&nbsp;</td>
</tr>
<td>&nbsp;</td>
</tr>
<% end %>
<% if result.total_discount.to_f > 0 %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.total") %>
<%= t("views.right_panel.detail.discount") %>
<%= t("views.right_panel.detail.discount") %>
<%= t("views.right_panel.detail.amount") %></td>
<td> - <%= result.total_discount %> </td>
<td>&nbsp;</td>
</tr>
<td>&nbsp;</td>
</tr>
<% end %>
<% if !result.total_tax.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Tax Amount </td>
<td><%= result.total_tax %> </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<% end %>
<% sale_payments = SalePayment.get_sale_payments(result) %>
<% if sale_payments.length > 0%>
<% if sale_payments.length > 0%>
<% sale_payments.each do |rec| %>
<%if rec.payment_amount.to_f > 0 %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment <%= rec.payment_method.upcase %></td>
<td><%= rec.payment_amount %> ( <%= rec.payment_status %> )</td>
<td>&nbsp;</td>
</tr>
</tr>
<% if !rec.payment_reference.nil? %>
<% if !rec.payment_reference.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Payment Ref.</td>
<td><%= rec.payment_reference %></td>
<td>&nbsp;</td>
@@ -157,10 +157,10 @@
<% end %>
<% end %>
<% end %>
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %></td>
<td><%= result.amount_changed %></td>
<td>&nbsp;</td>
@@ -169,25 +169,25 @@
<% if !result.customer_id.nil?%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Customer</td>
<td><%= result.customer.name rescue '-'%>
<td><%= result.customer.name rescue '-'%>
(<%= result.customer.company rescue '-' %>)
</td>
<td>&nbsp;</td>
</tr>
<% end %>
<% end %>
<% end %>
<tr style="border-top:4px double #666;">
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><b>Total Nett</b> - <b><%= grand_total %></b></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
@@ -201,20 +201,20 @@
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');
}
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) ;
@@ -229,50 +229,50 @@
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;
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');
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 = '';
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){
$(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 ;
@@ -281,18 +281,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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">
@@ -17,20 +24,20 @@
<td colspan="8">
<%= form_tag transactions_bookings_path, :method => :get do %>
<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 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Booking/ Sale ID/ Table/ Room" 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>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<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>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<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">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -96,7 +103,3 @@
});
</script>

View File

@@ -23,7 +23,7 @@
<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">
@@ -78,7 +78,7 @@
</table>
</div>
</div>
<div class="tab-pane" id="order" role="tabpanel">
<div class="table-responsive">
<table class="table table-striped">
@@ -167,7 +167,7 @@
if(order_id!=undefined && order_id!=null && order_id!=""){
if($('#request_bill').is(":visible")) {
$('#request_bill').prop("disabled",true);
}
}
$.ajax({
type: "GET",
url: ajax_url,
@@ -176,11 +176,11 @@
$('#request_bill').prop("disabled",false);
swal("Information!", result.error_message);
}
else {
else {
location.reload();
}
}
});
});
}else{
swal("Opps","There is no orders!","warning");
}
@@ -198,10 +198,10 @@
$('#change_booking_status').prop("disabled",false);
swal("Opps",result.error_message,"warning");
}
else {
else {
swal({
title: "Information",
text: result.message,
title: "Information",
text: result.message,
type: "success",
html: true,
closeOnConfirm: false,
@@ -213,8 +213,6 @@
});
}
}
});
});
});
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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">
@@ -17,40 +24,40 @@
<td colspan="8">
<%= form_tag transactions_card_sale_trans_path, :method => :get do %>
<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 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="sale_id" name="sale_id" class="form-control" placeholder="Sale ID/ Customer Name/ Cashier Name" style="margin-right: 10px;height: 34px;">
</div>
<% if defined? @payment_method %>
<div class="col-lg-2 col-md-2 col-sm-2">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<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" %>
<%= 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">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<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>
</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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -58,12 +65,12 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card" style="width:122%;">
<div class="table-responsive">
@@ -102,7 +109,7 @@
UnionPay
<% else %>
<%= cardSale.app %>
<% end %>
<% end %>
</td>
<td><%= cardSale.sale.customer.name rescue '-' %></td>
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
@@ -111,18 +118,18 @@
TID : <%= cardSale.terminal_id %>
<br>
<% end %>
<% if cardSale.merchant_id != '' %>
<% if cardSale.merchant_id != '' %>
MID : <%= cardSale.merchant_id %>
<br>
<% end %>
<% if cardSale.batch_no != '' %>
<% if cardSale.batch_no != '' %>
Batch : <%= cardSale.batch_no %>
<br>
<% end %>
<% if cardSale.trace != '' %>
<% if cardSale.trace != '' %>
Trace : <%= cardSale.trace %>
<% end %>
</td>
<% end %>
</td>
<td><%= cardSale.status %></td>
</tr>
<% end %>
@@ -150,24 +157,24 @@
$('#status_type').val("<%= params[:status_type] %>");
$('#sale_id').val("<%= params[:sale_id] %>");
$('#sel_period').val("<%= params[:period] %>");
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');
}
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) ;
@@ -182,32 +189,32 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to);
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
console.log(check_arr.length)
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
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');
if (from == '' && to == '') {
@@ -215,18 +222,18 @@
to = $("#to").val();
}
shift.empty();
var str = '';
var param_shift = '';
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){
$(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 ;
@@ -235,18 +242,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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">
@@ -17,40 +24,40 @@
<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">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="cashier_name" name="cashier_name" 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">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<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" %>
<%= 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">
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
<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>
</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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -58,14 +65,14 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card" style="width:112%;">
<div class="card">
<div class="table-responsive">
<table class="table table-striped">
<thead>
@@ -128,20 +135,20 @@
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');
}
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) ;
@@ -156,50 +163,50 @@
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;
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');
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 = '';
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){
$(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 ;
@@ -208,19 +215,19 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -5,7 +5,7 @@
<li class="active">
<a href="<%= transactions_credit_notes_path %>">Credit Note</a>
</li>
</ol>
</div>
</div> -->
@@ -18,6 +18,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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">
@@ -28,11 +35,11 @@
<td colspan="">
<%= form_tag transactions_credit_notes_path, :method => :get do %>
<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 mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" name="receipt_no" class="form-control m-t-3" placeholder="Receipt No/Cashier Name/Status" style="margin-right: 10px">
</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 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.select_customer") %></label>
<select class="selectpicker form-control col-md-12" name="customer">
<option value=""><%= t("views.right_panel.detail.select_customer") %></option>
@@ -40,22 +47,22 @@
<option value="<%= customer.customer_id %>">
<%= customer.name %></option>
<%end %>
</select>
</select>
</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 col-mbl-view mbl-style">
<label class="font-14"><%= t("views.right_panel.detail.order_source") %></label>
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<input class="form-control datepicker m-t-3" name="from" id="date" type="text" placeholder="From date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<input class="form-control datepicker m-t-3" name="to" id="date" type="text" placeholder="To date">
</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 mbl-right-btn mbl-style">
<label class="font-14"> &nbsp;</label><br>
<input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -63,10 +70,10 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card">
@@ -109,14 +116,14 @@
</td>
<td><%= sale.cashier_name rescue '-' %></td>
<td><%= link_to sale.customer.name, crm_customer_path(sale.customer_id) %></td>
<td>
<td>
<%if sale.source == "cashier" || sale.source == "emenu" %>
Cashier
<% elsif sale.source == "quick_service" %>
Quick Service
<% else %>
Online Order
<% end %>
<% end %>
</td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y %I:%M %p") %> </td>
</tr>
@@ -152,7 +159,7 @@
}
// console.log(arr_sale);
});
$(".credit_payment").on('click', function(){
$.ajax({
type: 'POST',
@@ -194,8 +201,3 @@
return arr_item;
}
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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">
@@ -17,13 +24,13 @@
<td colspan="14">
<%= form_tag transactions_order_reservations_path, :method => :get do %>
<div class="row clearfix">
<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 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="filter" name="filter" class="form-control" placeholder="Status/Payment Type" style="margin-right: 10px;height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= 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>
@@ -39,16 +46,16 @@
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -56,18 +63,18 @@
<% 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.order_reservation_id") %></th>
<th><%= t("views.right_panel.detail.sale_id") %></th>
@@ -112,8 +119,8 @@
%>
<% if @order_reservations != 0 %>
<% @order_reservations.each do |order_reservation| %>
<%
provider = ""
<%
provider = ""
discount_amount = order_reservation.discount_amount
delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0
convenience_charge = order_reservation.convenience_charge
@@ -187,4 +194,4 @@
$('#sel_period').val("<%= params[:period] %>");
$('#filter').val("<%= params[:filter] %>");
});
</script>
</script>

View File

@@ -8,12 +8,19 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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-15 p-r-15">
<%= form_tag transactions_orders_path, :method => :get do %>
<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 mbl-style">
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
<input type="text" id="receipt_no" name="filter" placeholder="Order ID" class="form-control input-md" >
</div>
@@ -24,31 +31,31 @@
<span class="highlight"></span>
<output id="rangevalue">0</output>
</div>
</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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<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">
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label > &nbsp;</label>
<br> <input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
</div>
</div>
</div>
<% end %>
<div class="card">
<div class="table-responsive">
<table class="table ">
<thead>
<tr>
<th><%= t("views.right_panel.detail.order_id") %></th>
<th><%= t :table %>/<%= t :room %></th>
<th><%= t("views.right_panel.detail.order_by") %></th>
<th><%= t("views.right_panel.detail.type") %></th>
@@ -60,7 +67,7 @@
</thead>
<tbody>
<% @orders.each do |order|
<% @orders.each do |order|
@dining = BookingOrder.find_by_order_id(order.order_id).booking.dining_facility
%>
@@ -73,13 +80,13 @@
<td><%= order.status %></td>
<td> <%= order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
<td> <%= order.item_count %> </td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%if !@orders.nil?%>
<%= paginate @orders %>
<%end%>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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">
@@ -17,13 +24,13 @@
<td colspan="8">
<%= form_tag transactions_sales_path, :method => :get do %>
<div class="row clearfix">
<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 mbl-style">
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Receipt No/Cashier Name/Status" style="margin-right: 10px;height: 34px;">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= 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>
@@ -39,22 +46,22 @@
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
<label class=""><%= t("views.right_panel.detail.from") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="mbl_lbl"><%= 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-2 col-md-2 col-sm-2">
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
<label class="font-14 mbl_lbl"><%= 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-1 col-md-1 col-sm-1 col-xs-1">
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label></label>
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
@@ -62,18 +69,18 @@
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<div class="card">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.sale_id") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
@@ -144,24 +151,24 @@
$('#from').val("<%= params[:from] %>");
$('#to').val("<%= params[:to] %>");
$('#sel_period').val("<%= params[:period] %>");
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');
}
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) ;
@@ -176,32 +183,32 @@
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
$('#to').val(to);
search_by_date();
});
});
function search_by_date(){
from = $("#from").val();
to = $("#to").val();
to = $("#to").val();
var period = 0;
var period_type = 1;
var period_type = 1;
if(to != '' && from != ''){
shift_name = from + ',' + to;
check_arr.push(to);
console.log(check_arr.length)
if(check_arr.length == 1){
show_shift_name(period,period_type,from,to,'shift_item');
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');
if (from == '' && to == '') {
@@ -209,18 +216,18 @@
to = $("#to").val();
}
shift.empty();
var str = '';
var param_shift = '';
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){
$(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 ;
@@ -229,18 +236,18 @@
selected = 'selected = "selected"';
}
else{
selected = '';
}
selected = '';
}
}else{
selected = '';
}
selected = '';
}
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
// console.log(sh_date)
})
})
shift.append(str);
});
}
});
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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">
@@ -21,7 +28,7 @@
<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">
<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>
@@ -29,7 +36,7 @@
<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'>
@@ -107,6 +114,3 @@
});
</script>

View File

@@ -1,25 +1,25 @@
<%= form_tag transactions_surveys_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<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 mbl-style">
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
<input type="text" id="dining_name" name="filter" placeholder="Dining Name" class="form-control input-md" >
</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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
<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>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
<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">
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
<label > &nbsp;</label>
<br> <input type="submit" value="Search" class='btn btn-primary btn-md'>
</div>
</div>
</div>
</div>
<% end %>
<script type="text/javascript">
$(function(){
@@ -38,4 +38,4 @@ $("#dining_name").val("<%=params[:filter]%>");
$("#from").val("<%=params[:from]%>");
$("#to").val("<%=params[:to]%>");
</script>
</script>

View File

@@ -7,6 +7,13 @@
</span>
</ol>
</div>
<style>
@media screen and (max-width: 785px) {
section.content{
margin: 80px 5px 0 5px !important;
}
}
</style>
<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-15 p-r-15">
@@ -67,8 +74,8 @@
<% foreigner_lists = foreign.split(",") %>
<% if !foreigner_lists.empty? %>
<% foreigner_lists.each do |fgn| %>
<% unless fgn.match(/[^[:digit:]]+/)
total_foreigner = total_foreigner.to_i + fgn.to_i
<% unless fgn.match(/[^[:digit:]]+/)
total_foreigner = total_foreigner.to_i + fgn.to_i
end %>
<% if !fgn.scan(/\D/).empty? %>
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
@@ -104,4 +111,4 @@
$("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>");
});
</script>
</script>