+
@@ -27,9 +27,9 @@
<% if @shift_from %>
- <% if @shift_data.employee %>
+ <% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
- <% end %>
+ <% end %>
<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
<% end %>
@@ -37,9 +37,9 @@
<%= t("views.right_panel.detail.shift_name") %>
<%= t("views.right_panel.detail.table") %>
<%= t("views.right_panel.detail.receipt_no") %>
- <%= t :cashier %> <%= t("views.right_panel.detail.name") %>
+ <%= t :cashier %> <%= t("views.right_panel.detail.name") %>
<%= t("views.right_panel.detail.revenue") %>
-
+
@@ -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 @@
<%= @shift_from %> - <%= @shift_to %>
<%= table_type %> - <%= table_name %>
<%= result.receipt_no rescue '-' %>
- <%= result.cashier_name rescue '-' %>
+ <%= result.cashier_name rescue '-' %>
<%=result.grand_total%>
@@ -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 @@
<%= item.qty rescue '-' %>
<%= item.unit_price rescue '-' %>
<%= item.price rescue '-' %>
- <%=l item.created_at.utc.getlocal, :format => :short rescue '-' %>
+ <%=l item.created_at.utc.getlocal, :format => :short rescue '-' %>
<% end %>
-
+
<%survey = Survey.find_by_receipt_no(result.receipt_no)%>
<% if !survey.nil?%>
-
+
No. of Guest
<%= survey.total_customer rescue '-' %>
-
-
- <% end %>
-
+
+
+ <% end %>
+
<% if !result.total_amount.nil?%>
-
+
<%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %>
<%= result.total_amount %>
-
-
+
+
<% end %>
<% if result.total_discount.to_f > 0 %>
-
+
<%= t("views.right_panel.detail.total") %>
- <%= t("views.right_panel.detail.discount") %>
+ <%= t("views.right_panel.detail.discount") %>
<%= t("views.right_panel.detail.amount") %>
- <%= result.total_discount %>
-
-
+
+
<% end %>
-
+
<% if !result.total_tax.nil? %>
-
+
Tax Amount
<%= result.total_tax %>
-
+
<% 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 %>
-
+
Payment <%= rec.payment_method.upcase %>
<%= rec.payment_amount %> ( <%= rec.payment_status %> )
-
+
- <% if !rec.payment_reference.nil? %>
+ <% if !rec.payment_reference.nil? %>
-
+
Payment Ref.
<%= rec.payment_reference %>
@@ -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? %>
-
+
<%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %>
<%= result.amount_changed %>
@@ -169,25 +169,25 @@
<% if !result.customer_id.nil?%>
-
+
Customer
- <%= result.customer.name rescue '-'%>
+ <%= result.customer.name rescue '-'%>
(<%= result.customer.company rescue '-' %>)
<% end %>
<% end %>
-
+
<% end %>
Total Nett - <%= grand_total %>
-
+
-
+
@@ -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 = '
--- All Shift --- ';
- $(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 += '
' + local_date + ' ';
-
+
// console.log(sh_date)
- })
+ })
shift.append(str);
});
}
});
-
\ No newline at end of file
+
diff --git a/app/views/transactions/bookings/index.html.erb b/app/views/transactions/bookings/index.html.erb
index 47cc60db..b5f598e5 100755
--- a/app/views/transactions/bookings/index.html.erb
+++ b/app/views/transactions/bookings/index.html.erb
@@ -7,6 +7,13 @@