diff --git a/Gemfile b/Gemfile index b423167a..3c72eab1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,6 @@ source 'https://rubygems.org' - -#ruby '2.5.0' +ruby '2.4.1' #ruby '2.5.7' diff --git a/Gemfile.lock b/Gemfile.lock index 50647fba..bbcc1085 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -380,5 +380,8 @@ DEPENDENCIES web-console (>= 3.3.0) whenever +RUBY VERSION + ruby 2.4.1p111 + BUNDLED WITH 2.0.2 diff --git a/README.md b/README.md index 629492b3..398634d2 100755 --- a/README.md +++ b/README.md @@ -288,6 +288,10 @@ For Number Formats => settings/lookups => { lookup_type: number_format, name: strip_insignificant_zeros, value: {true: => ['1', 't', 'true', 'on', 'y', 'yes'], false: => ['0', 'f', 'false', 'off', 'n', 'no', ...] } +For Booking checkin time limit + settings/lookups => + { lookup_type: checkin_time_limit, name: CheckinTimeLimit, value: total hours before checkout (e.g., '48')) } + /* Customer Types in lookups */ 1) settings/lookups => { type:customer_type, name: Dinein, value:Dinein } 2) settings/lookups => { type:customer_type, name: Takeaway, value: Takeaway } diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index c40db476..ee0e7567 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -629,7 +629,7 @@ $(function() { status = "selected-attribute"; } if(parseInt(jQuery.inArray(value[i], instance_attributes)) == -1){ - disabled = "disabled"; + // disabled = "disabled"; } row +=" <%elsif !modify_order && type%> - + <% if current_user.role != "waiter"%> <% if @quick_service_only %> @@ -794,6 +805,8 @@ $(document).on('click', '#clear_all', function(event){ $(".summary-items tbody").empty(); $('#sub_total').text("0.00"); + $('#total_qty').text("0"); + $('#total_tax').text("0"); $(".create").attr("disabled","disabled"); customer_display_view(null,"reload"); }); diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 72650ba3..08b28ab7 100644 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -22,7 +22,7 @@
- +
<% end %> --> @@ -72,7 +72,7 @@ - <% if @crm_customers.count > 0 %> + <% if @crm_customers.count > 0 %> <% @i = 0 %> <% @crm_customers.each do |crm_customer| %> @@ -80,7 +80,7 @@ - <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> + <% if crm_customer.customer_id != "" && crm_customer.customer_id != "" %> <%= @i += 1 %> <%else%> - @@ -156,7 +156,7 @@ <%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %> <%= f.error_notification %> - <%= f.hidden_field :id, :class => "form-control col-md-6 " %> + <%= f.hidden_field :id, :class => "form-control col-md-6 " %>
@@ -225,7 +225,7 @@
-
+
@@ -238,12 +238,12 @@ <% if f.object.image_path? %>

<%= f.object.name %>

<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %> - <% else %> + <% else %> <%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %> - <% end %> + <% end %>
<%= f.file_field :image_path, :class => "img-thumbnail" %> -
+
@@ -291,7 +291,7 @@ <%end %> - +
@@ -316,7 +316,7 @@
-
+
@@ -332,7 +332,7 @@ <%end %> - +
@@ -363,7 +363,7 @@
- diff --git a/app/views/origami/dashboard/_menu.json.jbuilder b/app/views/origami/dashboard/_menu.json.jbuilder index 19b05aa5..027561e7 100644 --- a/app/views/origami/dashboard/_menu.json.jbuilder +++ b/app/views/origami/dashboard/_menu.json.jbuilder @@ -41,21 +41,21 @@ if (menu.menu_categories) attr_format = [] # Format for attributes json if item.item_attributes.count > 0 - item_attributes = @item_attributes.select{ |x| item.item_attributes.include?(x.id.to_s) } - attr_format = item_attributes.group_by {|att| att.attribute_type }.map { |type, values| {type: type, values: values.map(&:name)} } + item_attributes = item.item_attributes.map(&:to_s) + attr_format = @item_attributes.select { |x| item_attributes.include?(x.id.to_s) }.group_by {|att| att.attribute_type.strip }.map { |type, values| {type: type, values: values.map { |x| x.name.strip } } } end # Format for option json opt_format = [] # Format for attributes json if item.item_options.count > 0 - item_options = @item_options.select{ |x| item.item_options.include?(x.id.to_s) } - opt_format = item_options.group_by {|opt| opt.option_type }.map { |type, values| {type: type, values: values.map(&:name)} } + item_options = item.item_options.map(&:to_s) + opt_format = @item_options.select { |x| item_options.include?(x.id.to_s) }.group_by {|opt| opt.option_type.strip }.map { |type, values| {type: type, values: values.map { |x| x.name.strip } } } end #Menu Item Information json.id item.id - json.code item.item_code + json.code item.item_code json.name item.name json.alt_name item.alt_name json.image item.image_path.url @@ -69,15 +69,14 @@ if (menu.menu_categories) json.unit item.unit # Item Sets of Menu Item - json.item_sets item.item_sets.map { |its| - { id: its.id, - name: its.name, - alt_name: its.alt_name, - min_selectable_qty: its.min_selectable_qty, - max_selectable_qty: its.max_selectable_qty, - instances: its.menu_item_instances.map { |i| {id: i.id} } - } - } + json.item_sets item.item_sets do |its| + json.id its.id + json.name its.name + json.alt_name its.alt_name + json.min_selectable_qty its.min_selectable_qty + json.max_selectable_qty its.max_selectable_qty + json.instances its.menu_item_instances.map { |i| {id: i.id} } + end json.attributes attr_format json.options opt_format @@ -85,7 +84,8 @@ if (menu.menu_categories) json.instances item.menu_item_instances do |is| if is.is_available # Convert id to name for attributes - instance_attr = @item_attributes.select{ |x| item.item_attributes.include?(x.id) }.pluck(:name) + item_attributes = is.item_attributes.map(&:to_s) + instance_attr = @item_attributes.select{ |x| item_attributes.include?(x.id.to_s) }.pluck(:name) json.id is.id json.code is.item_instance_code diff --git a/app/views/origami/dinga/index.html.erb b/app/views/origami/dinga/index.html.erb index 8c326ac2..fd345d4e 100644 --- a/app/views/origami/dinga/index.html.erb +++ b/app/views/origami/dinga/index.html.erb @@ -264,8 +264,7 @@ $("#is_paymemberModal").hide(); $("#sxModal").show(); setTimeout(function(){ - getCardNo(); - $("#sxModal").hide(); + getCardNo(); customer_mamber_card_no = $("#paypar_account_no").val(); if(sale_id != 0 && customer_mamber_card_no != 0){ @@ -332,6 +331,7 @@ function setCardNo(cardNo){ if(cardNo.length == 16){ $("#paypar_account_no").val(cardNo); + $("#sxModal").hide(); } } diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index a5269dc2..00631cae 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -813,8 +813,10 @@ if ($("#server_mode").val() != "cloud") { // first bill not used in cloud if (discount) { if(checkReceiptNoInFirstBillData(receipt_no,"")){ + $("button.change_tax").hide(); $("#pay").show(); }else{ + $("button.change_tax").show(); $("#pay").hide(); } } diff --git a/app/views/origami/paymal/index.html.erb b/app/views/origami/paymal/index.html.erb index 802c1ce4..734a0924 100644 --- a/app/views/origami/paymal/index.html.erb +++ b/app/views/origami/paymal/index.html.erb @@ -258,8 +258,7 @@ $("#is_paymemberModal").hide(); $("#sxModal").show(); setTimeout(function(){ - getCardNo(); - $("#sxModal").hide(); + getCardNo(); customer_mamber_card_no = $("#paypar_account_no").val(); if (customer_mamber_card_no == 0) { customer_mamber_card_no = $("#membership_id").text() || 0; @@ -328,6 +327,7 @@ function setCardNo(cardNo){ if(cardNo.length == 16){ $("#paypar_account_no").val(cardNo); + $("#sxModal").hide(); } } diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index a7737724..42152e20 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -1305,7 +1305,6 @@ $(document).ready(function(){ $("#sxModal").show(); setTimeout(function(){ getCardNo(); - $("#sxModal").hide(); customer_mamber_card_no = $("#paypar_account_no").val(); if(sale_id != 0 && customer_mamber_card_no != 0){ @@ -1342,6 +1341,7 @@ $(document).ready(function(){ function setCardNo(cardNo){ if(cardNo.length == 16){ $("#paypar_account_no").val(cardNo); + $("#sxModal").hide(); } } @@ -1686,9 +1686,8 @@ $(document).ready(function(){ $("#customer_name").on("click",function(){ //start customer modal popup if((cashier_type=='quick_service' || cashier_type=='food_court') && (customer_id!=undefined) && (customer_id!=null) && (customer_id!="")){ - // if((customer_id == 'CUS-000000000001') && (customer_name == 'WALK-IN')){ - $("#is_memberModal").modal({show : true, backdrop: false, keyboard : false}); - // } + + $("#is_memberModal").modal({show : true, backdrop: false, keyboard : false}); } }); @@ -1708,7 +1707,6 @@ $(document).ready(function(){ $("#sxModal").show(); setTimeout(function(){ getCardNo(); - $("#sxModal").hide(); customer_mamber_card_no = $("#paypar_account_no").val(); if (customer_mamber_card_no == 0) { customer_mamber_card_no = $("#membership_id").text() || 0; diff --git a/app/views/reports/dailysale/index.html.erb b/app/views/reports/dailysale/index.html.erb index 8eb0455d..13b315de 100755 --- a/app/views/reports/dailysale/index.html.erb +++ b/app/views/reports/dailysale/index.html.erb @@ -24,15 +24,15 @@ - + <% @count = 1 %> <% @payment_methods.each_slice(10) do |slice| %> - + - + + + <% if @tax.blank? %> + + + <% end %> @@ -148,6 +159,10 @@ <% total = 0 %> <% grand_total = 0 %> <% old_grand_total = 0 %> + <% gross_sale = 0 %> + <% total_sale = 0 %> + <% tax = 0 %> + <% net_sale = 0 %> <% count = 1 %> <% rounding_adj = 0 %> <% @sale_data.each do |sale| %> <% void += sale[:void_amount] %> @@ -171,6 +186,10 @@ <% grand_total += sale[:grand_total].to_f %> <% old_grand_total += sale[:old_grand_total].to_f %> <% rounding_adj += sale[:rounding_adj].to_f %> + <% gross_sale += sale[:gross_sale].to_f %> + <% total_sale += sale[:total_sale].to_f %> + <% tax += sale[:tax].to_f %> + <% net_sale += sale[:net_sale].to_f %> @@ -218,7 +237,12 @@ - + + + <% if @tax.blank? %> + + + <% end %> <% count = count + 1 %> @@ -303,7 +327,12 @@ - + + + <% if @tax.blank? %> + + + <% end %> @@ -315,19 +344,23 @@ <% @tax.each do |tax| total_tax += tax.tax_amount.to_f %> - - + + <% end %> - <% end %> - - <% net = grand_total %> - <% net = net - rounding_adj%> - <% net = net - total_tax %> + <% net = grand_total %> + <% net = net - rounding_adj%> + <% net = net - total_tax %> + + + + + <% else %> - - + + + <% end %> <% end %>
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
<%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.gross_sales") %><%= t("views.right_panel.detail.total_sales") %><%= t("views.right_panel.detail.tax") %><%= t("views.right_panel.detail.net_sales") %>
<%= count %> <%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>) <%= number_format(sale[:rounding_adj].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:grand_total], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:gross_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:total_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:tax], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%>
(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>) <%= number_format(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(grand_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(gross_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(total_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(tax, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
<%= tax.tax_name rescue '-'%><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= tax.tax_name rescue '-'%><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
<%= t("views.right_panel.detail.net_amount") %><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
<%= t("views.right_panel.detail.net_amount") %><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= t("views.right_panel.detail.net_amount") %><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
diff --git a/app/views/reports/dailysale/index.xls.erb b/app/views/reports/dailysale/index.xls.erb index 52b6a539..f3d0aa2b 100755 --- a/app/views/reports/dailysale/index.xls.erb +++ b/app/views/reports/dailysale/index.xls.erb @@ -7,249 +7,307 @@
-
+
- + - + <% @count = 1 %> + <% @payment_methods.each_slice(10) do |slice| %> + <% end %> + + + + + + + + <% if @payment_methods.include? ("MPU") %> - + <% end %> <% if @payment_methods.include? ("Master") %> - + <% end %> <% if @payment_methods.include? ("VISA") %> - + <% end %> <% if @payment_methods.include? ("JCB") %> - + <% end %> <% if @payment_methods.include? ("UNIONPAY") %> - + <% end %> <% if @payment_methods.include? ("KBZPay") %> <% end %> <% if @payment_methods.include? ("Alipay") %> - + <% end %> <% if @payment_methods.include? ("PAYMAL") %> - + <% end %> <% if @payment_methods.include? ("DINGA") %> - + <% end %> <% if @payment_methods.include? ("JunctionPay") %> - + <% end %> <% if @payment_methods.include? ("Redeem") %> - + + <% end %> + <% if @payment_methods.include? ("GiftVoucher") %> + <% end %> - <% if @payment_methods.include? ("GiftVoucher") %> - - <% end %> - - - - + + + + + + <% if @tax.blank? %> + + <% end %> + - <% unless @sale_data.blank? %> - - - <% void = 0 %> - <% mpu = 0 %> - <% master = 0 %> - <% visa = 0 %> - <% jcb = 0 %> - <% unionpay = 0 %> - <% alipay = 0 %> - <% paymal = 0 %> - <% dinga = 0 %> - <% junctionpay = 0 %> - <% giftvoucher = 0 %> - <% paypar = 0 %> - <% cash = 0 %> - <% credit = 0 %> - <% foc = 0 %> - <% discount = 0 %> - <% kbzpay = 0 %> - <% total = 0 %> - <% grand_total = 0 %> - <% old_grand_total = 0 %> - <% count = 1 %> <% rounding_adj = 0 %> - <% @sale_data.each do |sale| %> - <% void += sale[:void_amount] %> - <% mpu += sale[:mpu_amount] %> - <% master += sale[:master_amount] %> - <% visa += sale[:visa_amount] %> - <% jcb += sale[:jcb_amount] %> - <% unionpay += sale[:unionpay_amount] %> - <% alipay += sale[:alipay_amount] %> - <% paymal += sale[:paymal_amount] %> - <% dinga += sale[:dinga_amount] %> - <% junctionpay += sale[:junctionpay_amount] %> - <% giftvoucher += sale[:giftvoucher_amount] %> - <% paypar += sale[:paypar_amount] %> - <% cash += sale[:cash_amount]-sale[:total_change_amount] %> - <% credit += sale[:credit_amount] %> - <% foc += sale[:foc_amount] %> - <% discount += sale[:total_discount] %> - <% kbzpay += sale[:kbzpay_amount] %> - <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> - <% grand_total += sale[:grand_total].to_f %> - <% old_grand_total += sale[:old_grand_total].to_f %> - <% rounding_adj += sale[:rounding_adj].to_f %> - - - - <% if @payment_methods.include? ("MPU") %> - - <% end %> - <% if @payment_methods.include? ("Master") %> - - <% end %> - <% if @payment_methods.include? ("VISA") %> - - <% end %> - <% if @payment_methods.include? ("JCB") %> - - <% end %> - <% if @payment_methods.include? ("UNIONPAY") %> - - <% end %> - <% if @payment_methods.include? ("Alipay") %> - - <% end %> - <% if @payment_methods.include? ("KBZPay") %> + <% unless @sale_data.blank? %> + + <% void = 0 %> + <% mpu = 0 %> + <% master = 0 %> + <% visa = 0 %> + <% jcb = 0 %> + <% unionpay = 0 %> + <% alipay = 0 %> + <% paymal = 0 %> + <% dinga = 0 %> + <% junctionpay = 0 %> + <% giftvoucher = 0 %> + <% paypar = 0 %> + <% cash = 0 %> + <% credit = 0 %> + <% foc = 0 %> + <% discount = 0 %> + <% kbzpay = 0 %> + <% total = 0 %> + <% grand_total = 0 %> + <% old_grand_total = 0 %> + <% gross_sale = 0 %> + <% total_sale = 0 %> + <% tax = 0 %> + <% net_sale = 0 %> + <% count = 1 %> <% rounding_adj = 0 %> + <% @sale_data.each do |sale| %> + <% void += sale[:void_amount] %> + <% mpu += sale[:mpu_amount] %> + <% master += sale[:master_amount] %> + <% visa += sale[:visa_amount] %> + <% jcb += sale[:jcb_amount] %> + <% unionpay += sale[:unionpay_amount] %> + <% alipay += sale[:alipay_amount] %> + <% paymal += sale[:paymal_amount] %> + <% dinga += sale[:dinga_amount] %> + <% junctionpay += sale[:junctionpay_amount] %> + <% giftvoucher += sale[:giftvoucher_amount] %> + <% paypar += sale[:paypar_amount] %> + <% cash += sale[:cash_amount]-sale[:total_change_amount] %> + <% credit += sale[:credit_amount] %> + <% foc += sale[:foc_amount] %> + <% discount += sale[:total_discount] %> + <% kbzpay += sale[:kbzpay_amount] %> + <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> + <% grand_total += sale[:grand_total].to_f %> + <% old_grand_total += sale[:old_grand_total].to_f %> + <% rounding_adj += sale[:rounding_adj].to_f %> + <% gross_sale += sale[:gross_sale].to_f %> + <% total_sale += sale[:total_sale].to_f %> + <% tax += sale[:tax].to_f %> + <% net_sale += sale[:net_sale].to_f %> + + + + <% if @payment_methods.include? ("MPU") %> + + <% end %> + <% if @payment_methods.include? ("Master") %> + + <% end %> + <% if @payment_methods.include? ("VISA") %> + + <% end %> + <% if @payment_methods.include? ("JCB") %> + + <% end %> + <% if @payment_methods.include? ("UNIONPAY") %> + + <% end %> + <% if @payment_methods.include? ("Alipay") %> + + <% end %> + <% if @payment_methods.include? ("KBZPay") %> <% end %> - <% if @payment_methods.include? ("PAYMAL") %> - - <% end %> - <% if @payment_methods.include? ("DINGA") %> - - <% end %> - <% if @payment_methods.include? ("JunctionPay") %> - - <% end %> - <% if @payment_methods.include? ("Redeem") %> - - <% end %> - - - - - <% if @payment_methods.include? ("GiftVoucher") %> - - <% end %> - - - - + <% if @payment_methods.include? ("PAYMAL") %> + + <% end %> + <% if @payment_methods.include? ("DINGA") %> + + <% end %> + <% if @payment_methods.include? ("JunctionPay") %> + + <% end %> + <% if @payment_methods.include? ("Redeem") %> + + <% end %> + <% if @payment_methods.include? ("GiftVoucher") %> + + <% end %> + + + + - - <% count = count + 1 %> - <% end %> - <% colspan = 7 %> - - - <% if @payment_methods.include? ("MPU") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("Master") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("VISA") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("JCB") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("UNIONPAY") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("Alipay") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("KBZPay") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("PAYMAL") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("DINGA") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("JunctionPay") %> - <% colspan += 1 %> - - <% end %> - <% if @payment_methods.include? ("Redeem") %> - <% colspan += 1 %> - - <% end %> - - - - - <% if @payment_methods.include? ("GiftVoucher") %> - <% colspan += 1 %> - - <% end %> - - - + + + + + + <% if @tax.blank? %> + + <% end %> + - - - + + <% count = count + 1 %> + <% end %> + <% colspan = 7 %> + + + <% if @payment_methods.include? ("MPU") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("Master") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("VISA") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("JCB") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end%> + <% if @payment_methods.include? ("UNIONPAY") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("Alipay") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("KBZPay") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("PAYMAL") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("DINGA") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("JunctionPay") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("Redeem") %> + <% if !request.user_agent.include? "Mobile" %> + <% colspan += 1 %> + <% end %> + + <% end %> + <% if @payment_methods.include? ("GiftVoucher") %> + <% colspan += 1 %> + + <% end %> + + + + + + + + + + + + + + + + + <% total_tax = 0 %> + <% net = 0 %> + <% unless @tax.blank? %> + <% @tax.each do |tax| + total_tax += tax.tax_amount.to_f %> + + + + + <% end %> + <% net = grand_total %> + <% net = net - rounding_adj%> + <% net = net - total_tax %> + + + - <% total_tax = 0 %> - <% net = 0 %> - <% unless @tax.blank? %> - <% @tax.each do |tax| - total_tax += tax.tax_amount.to_f %> - - - - - <% end %> - <% end %> - - <% net = grand_total %> - <% net = net - rounding_adj%> - <% net = net - total_tax %> - - - - - - <% end %> -
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
IncomeOutgoing
<%= t("views.right_panel.detail.sr") %> <%= t("views.right_panel.detail.date") %><%= t("views.right_panel.detail.mpu_sales") %><%= t("views.right_panel.detail.mpu_sales") %><%= t("views.right_panel.detail.master_sales") %><%= t("views.right_panel.detail.master_sales") %><%= t("views.right_panel.detail.visa_sales") %><%= t("views.right_panel.detail.visa_sales") %><%= t("views.right_panel.detail.jcb_sales") %><%= t("views.right_panel.detail.jcb_sales") %><%= t("views.right_panel.detail.unionpay_sales") %><%= t("views.right_panel.detail.unionpay_sales") %><%= t("views.right_panel.detail.kbzpay_sales") %><%= t("views.right_panel.detail.alipay_sales") %><%= t("views.right_panel.detail.alipay_sales") %><%= t("views.right_panel.detail.paymal_sales") %><%= t("views.right_panel.detail.paymal_sales") %><%= t("views.right_panel.detail.dinga_sales") %><%= t("views.right_panel.detail.dinga_sales") %><%= t("views.right_panel.detail.junctionpay_sales") %><%= t("views.right_panel.detail.junctionpay_sales") %><%= t("views.right_panel.detail.redeem_sales") %><%= t("views.right_panel.detail.redeem_sales") %><%= t("views.right_panel.detail.giftvoucher_sales") %><%= t("views.right_panel.detail.cash_sales") %> <%= t("views.right_panel.detail.credit_sales") %> <%= t("views.right_panel.detail.void_amount") %> <%= t("views.right_panel.detail.foc_sales") %><%= t("views.right_panel.detail.giftvoucher_sales") %>(<%= t("views.right_panel.detail.discount") %>)<%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %>(<%= t("views.right_panel.detail.discount") %>)<%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.gross_sales") %><%= t("views.right_panel.detail.total_sales") %><%= t("views.right_panel.detail.tax") %><%= t("views.right_panel.detail.net_sales") %>
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_with_delimiter(sprintf("%.2f",sale[:mpu_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:master_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:visa_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:jcb_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:unionpay_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:alipay_amount]),delimiter => ',') rescue '-'%>
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_format(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:kbzpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:paymal_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:dinga_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:junctionpay_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:paypar_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]-sale[:total_change_amount]), delimiter: delimiter) rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:giftvoucher_amount]),delimiter => ',') rescue '-'%>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]),delimiter => ',') rescue '-'%><%= number_format(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%><%= number_format(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%>
Total<%= number_with_delimiter(sprintf("%.2f",mpu),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa), delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",unionpay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",alipay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",kbzpay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paymal),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",dinga),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",junctionpay),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",cash),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",credit),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",void),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",foc), delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",giftvoucher), delimiter => ',') rescue '-'%>(<%= number_with_delimiter(discount,delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",rounding_adj),delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",grand_total),delimiter => ',') rescue '-'%>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)<%= number_format(sale[:rounding_adj].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:gross_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:total_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:tax], precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%>
 
Total<%= number_format(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(kbzpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(void, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%>(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)<%= number_format(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(gross_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(total_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(tax, precision:precision.to_i,delimiter:delimiter) rescue '-'%><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
 
<%= tax.tax_name rescue '-'%><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
<%= t("views.right_panel.detail.net_amount") %><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
<%= tax.tax_name rescue '-'%><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount),delimiter => ',') rescue '-'%>
<%= t("views.right_panel.detail.net_amount") %><%= number_with_delimiter(sprintf("%.2f",net),delimiter => ',') rescue '-'%>
-
+ <% else %> + + <%= t("views.right_panel.detail.net_amount") %> + <%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%> + + <% end %> + + <% end %> +
+
diff --git a/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb b/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb index 3814746e..9dc60e4c 100644 --- a/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb +++ b/app/views/reports/hourly_saleitem/_hourly_saleitem_report_filter.html.erb @@ -2,6 +2,57 @@ <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <% if period_type != false %>
+
+ <%= form_tag reports_hourly_saleitem_index_path, :id => "filter_form", :method => :get do %> + + +
+ + + <% end %> +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ + +
- -
- - -
- -
- - - -
-
- - -