diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index a1342846..66c28e8d 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -105,12 +105,12 @@ $(function() { var ref_no = $('#ref_no').text(); var callback = $('#callback_url').text(); var requested_time = new Date($("#requested_date_time").text()); - if(type == '+'){ + if(type == 'plus'){ requested_time.setMinutes(requested_time.getMinutes() + minutes); }else{ requested_time.setMinutes(requested_time.getMinutes() - minutes); } - console.log(requested_time); + // console.log(requested_time); callback_url(callback,ref_no,order_id,status,type,minutes,requested_time); }); diff --git a/app/views/origami/order_reservation/index.html.erb b/app/views/origami/order_reservation/index.html.erb index b6648bab..19f78519 100644 --- a/app/views/origami/order_reservation/index.html.erb +++ b/app/views/origami/order_reservation/index.html.erb @@ -465,8 +465,9 @@ - <% if defined? provider %> + <% if defined? providers %>
- + <%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control" %>
<% end %> @@ -49,17 +49,6 @@ diff --git a/app/views/reports/order_reservation/index.html.erb b/app/views/reports/order_reservation/index.html.erb index 37157392..77e03adc 100755 --- a/app/views/reports/order_reservation/index.html.erb +++ b/app/views/reports/order_reservation/index.html.erb @@ -12,14 +12,14 @@ <%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => true,:payments => true, :report_path =>reports_receipt_no_index_path} %> + :locals=>{ :period_type => true, :shift_name => true,:providers => true, :report_path =>reports_order_reservation_index_path} %>
- <%= t("views.btn.exp_to_excel") %> + <%= t("views.btn.exp_to_excel") %>
diff --git a/app/views/reports/order_reservation/index.xls.erb b/app/views/reports/order_reservation/index.xls.erb index c8521b0d..0b6ddcd6 100755 --- a/app/views/reports/order_reservation/index.xls.erb +++ b/app/views/reports/order_reservation/index.xls.erb @@ -6,98 +6,118 @@ - + <% if @shift_from %> <% if @shift_data.employee %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% end %> - + <% end %> - - - - - <% @tax_profiles.each do |tax| %> - - <% end %> - + + + + + + + + + + + + + + - - - <% grand_total = 0 %> - <% old_grand_total = 0 %> - <% total_tax = 0 %> - <% guest_count = 0 %> - <% total_sum = 0 %> - <% discount_amt = 0 %> - <% other_amt = 0 %> - <% total_nett = 0 %> - <% rounding_adj = 0%> <% gov_tax = 0 %> <% service_charge = 0 %> - <%if @sale_data %> - <% @sale_data.each do |result| %> + <% + + discount_amount = 0.0 + delivery_fee = 0.0 + convenience_charge = 0.0 + delivery_tax = 0.0 + convenience_tax = 0.0 + commercial_tax = 0.0 - <% grand_total = grand_total.to_f + result.grand_total.to_f %> - <% old_grand_total = old_grand_total.to_f + result.old_grand_total.to_f %> - <% total_tax += result.total_tax.to_f %> - <% total_sum += result.total_amount.to_f %> - <% discount_amt += result.total_discount.to_f %> - <% rounding_adj += result.rounding_adjustment.to_f %> + total_discount_amount = 0 + total_delivery_fee = 0 + total_convenience_charge = 0 + total_delivery_tax = 0 + total_convenience_tax = 0 + total_commercial_tax = 0 + total_tax = 0.0 + total_amount = 0.0 + grand_total = 0.0 + %> + <% unless @order_reservation_data.blank? %> + <% @order_reservation_data.each do |order_reservation| %> + <% + 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 + + (order_reservation.taxes).each do |tax| %> + + <% end + + total_discount_amount += discount_amount.to_f + total_delivery_fee += delivery_fee.to_f + total_convenience_charge += convenience_charge + total_delivery_tax += delivery_tax + total_convenience_tax += convenience_tax + total_commercial_tax += commercial_tax + total_tax += order_reservation.total_tax + total_amount += order_reservation.total_amount + grand_total += order_reservation.grand_total + %> + <% + if order_reservation.provider == 'pick_up' + provider = "Pick-Up" + elsif order_reservation.provider == 'direct_delivery' + provider = "Direct Delivery" + else + provider = order_reservation.provider + end + %> + + + + + + + + + + + + + + + + + + <% end + end %> - - - - - - <%if result.customer.customer_type == "Takeaway"%> - - <%end%> - <% result.sale_taxes.each do |tax| %> - - <%end%> - - - - + + + + + + + + + + - - <% end %> - - - - - <% @sale_taxes.each do |tax| %> - - <% end %> - - - - - - - - - - <% @tax_profiles.each do |tax| %> - - <% 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.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )<%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )
<%= t("views.right_panel.detail.receipt_no") %><%= t :cashier %> <%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %> <%= tax.name %><%= t :customer %><%= t("views.right_panel.detail.type") %><%= t("views.right_panel.detail.requested_time") %><%= t("views.right_panel.detail.provider") %><%= t :payment_method %><%= t :payment %> <%= t("views.right_panel.detail.status")%><%= t("views.right_panel.detail.sub_total") %><%= t("views.right_panel.detail.discount_amount") %><%= t("views.right_panel.detail.delivery_fee") %><%= t("views.right_panel.detail.convenience_charge") %><%= t("views.right_panel.detail.delivery_tax") %><%= t("views.right_panel.detail.convenience_tax") %><%= t("views.right_panel.detail.commercial_tax") %><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> <%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
- <%= t("views.right_panel.detail.rnd_adj_sh") %> -
<%= order_reservation.email %><%= order_reservation.order_reservation_type %><%= order_reservation.requested_time.utc.getlocal.strftime("%d %m %Y %I:%M %p") %><%= provider%><%= order_reservation.payment_type%><%= order_reservation.payment_status%><%= order_reservation.total_amount rescue '0.0'%><%= discount_amount rescue '0.0'%><%= delivery_fee rescue '0.0'%><%= convenience_charge rescue '0.0'%><%= delivery_tax rescue '0.0'%><%= convenience_tax rescue '0.0'%><%= commercial_tax rescue '0.0'%><%= order_reservation.total_tax rescue '0.0'%><%= order_reservation.grand_total rescue '0.0' %>
<%= result.receipt_no rescue '-' %> <%= result.cashier_name rescue '-' %><%= result.total_amount rescue '-' %><%= result.total_discount rescue '-' %>0.0<%= tax.tax_payable_amount rescue '-' %><%= result.grand_total %><%= result.rounding_adjustment.to_f rescue '-' %><%= result.grand_total_after_rounding() rescue '-'%><%= total_amount rescue '0.0'%><%= total_discount_amount rescue '0.0'%><%= total_delivery_fee rescue '0.0'%><%= total_convenience_charge rescue '0.0'%><%= total_delivery_tax rescue '0.0'%><%= total_convenience_tax rescue '0.0'%><%= total_commercial_tax rescue '0.0'%><%= total_tax rescue '0.0'%><%= grand_total rescue '0.0'%>
 <%= total_sum rescue '-'%><%= discount_amt rescue '-'%><%= tax.st_amount.round(2) %><%= grand_total.to_f.round(2) rescue '-'%><%= rounding_adj rescue '-'%><%= grand_total.to_f.round + rounding_adj %>
 <%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %><%= t("views.right_panel.detail.discount") %> <%= t("views.right_panel.detail.amount") %><%= tax.name %><%= t("views.right_panel.detail.grand_total") %><%= t("views.right_panel.detail.rnd_adj_sh") %><%= t("views.right_panel.detail.grand_total") %> +
- <%= t("views.right_panel.detail.rnd_adj_sh") %> -
diff --git a/config/locales/en.yml b/config/locales/en.yml index 8c19c4ee..1c03285a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -479,6 +479,7 @@ en: convenience_charge: "Convenience Charge" convenience_tax: "Convenience Tax" commercial_tax: "Commercial Tax" + select_providers: "Select Providers" code_txt: "code " charge_txt: "charge" diff --git a/config/locales/mm.yml b/config/locales/mm.yml index e6bdc2cf..3a1aa2b6 100644 --- a/config/locales/mm.yml +++ b/config/locales/mm.yml @@ -473,6 +473,7 @@ mm: convenience_charge: "Convenience Charge" convenience_tax: "Convenience Tax" commercial_tax: "Commercial Tax" + select_providers: "Select Providers" code_txt: "ကုတ်ဒ် " charge_txt: "ကောက်ခံသည်"