From faa6beb2436dae9a0b0c190298a54fd41d91bbb0 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Sun, 18 Jun 2017 20:23:39 +0630 Subject: [PATCH 01/10] update sale report --- .../_shift_sale_report_filter.html.erb | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb b/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb index 815cf24c..04e548da 100644 --- a/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb +++ b/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb @@ -145,68 +145,6 @@ $(function(){ // window.location = url; }); - var item = $('#item').val(); - var payment_type = $('#payment_type'); - - if(item == 'order'){ - $('#cashier').hide(); - $('#waiter').show(); - if(payment_type){ - $('#payment_type').hide(); - } - } - else if(item == 'sale'){ - $('#waiter').hide(); - $('#cashier').show(); - } - else{ - $('#waiter').hide(); - $('#cashier').show(); - $("#item").val('sale'); - } }); -//Reset the form to pervious values -$("#branch").val(<%=params[:branch]%>); -$("#waiter").val("<%=params[:waiter]%>"); -$("#cashier").val(<%=params[:cashier]%>); -$("#product").val(<%=params[:product]%>); -$("#singer").val(<%=params[:singer]%>); -$("#item").val('<%=params[:item]%>'); -$("#guest_role").val('<%=params[:guest_role]%>'); - - -$("#from").val("<%=params[:from]%>"); -$("#to").val("<%=params[:to]%>"); -$("#sel_period").val(<%=params[:period]%>); -$("#sel_sale_type").val(<%=params[:sale_type]%>); - -<% if params[:period_type] == 1 || params[:period_type] == "1" %> - $("#rd_period_type_1").attr("checked","checked"); -<% else %> - $("#rd_period_type_0").attr("checked","checked"); -<% end %> -$(".btn-group button").removeClass("active"); -<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> -$("#btn_report_type_<%= report_type %>").addClass("active"); - -$('#item').change(function(){ - var item = $('#item').val(); - var payment_type = $('#payment_type'); - - if(item == 'sale'){ - $('#waiter').hide(); - $('#cashier').show(); - if(payment_type){ - $('#payment_type').show(); - } - } - else{ - $('#cashier').hide(); - $('#waiter').show(); - if(payment_type){ - $('#payment_type').hide(); - } - } -}); \ No newline at end of file From 675d83c80fff58933c8d42c3c2d542cd1fb689e5 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 19 Jun 2017 11:54:34 +0630 Subject: [PATCH 02/10] sale item report and rebate balance --- app/assets/javascripts/application.js | 7 + app/assets/javascripts/origami.js | 2 +- app/controllers/crm/customers_controller.rb | 10 +- .../reports/daily_sale_controller.rb | 12 -- .../reports/sale_item_controller.rb | 14 ++ app/models/sale.rb | 42 ++++++ app/pdf/receipt_bill_pdf.rb | 47 +++--- app/views/origami/home/index.html.erb | 2 +- .../_shift_sale_report_filter.html.erb | 1 + app/views/reports/daily_sale/index.html.erb | 20 +-- app/views/reports/daily_sale/index.xls.erb | 20 +-- app/views/reports/daily_sale_report.html.erb | 20 --- .../_shift_sale_report_filter.html.erb | 73 ++------- app/views/reports/sale_item/index.html.erb | 141 ++++++++++++++++++ app/views/reports/sale_item/index.xls.erb | 116 ++++++++++++++ config/routes.rb | 1 + 16 files changed, 391 insertions(+), 137 deletions(-) create mode 100644 app/controllers/reports/sale_item_controller.rb delete mode 100644 app/views/reports/daily_sale_report.html.erb rename app/views/reports/{ => sale_item}/_shift_sale_report_filter.html.erb (77%) create mode 100644 app/views/reports/sale_item/index.html.erb create mode 100644 app/views/reports/sale_item/index.xls.erb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 202d4387..8604d3c8 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -25,6 +25,13 @@ $(document).on("focus", "[data-behaviour~='datepicker']", function(e){ $('.dropdown-toggle').dropdown(); }); +function export_to(path) +{ + var form_params = $("#frm_report").serialize(); + alert(form_params); + window.location = path+"?"+ form_params; +} + /* * ToDo Move to here from pages * diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 78a21c3b..88bd919d 100644 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -49,7 +49,7 @@ $(document).ready(function(){ control_button(order_status); var customer_id=$(this).find(".customer-id").text(); - show_customer_details(customer_id); + //show_customer_details(customer_id); $("#re-print").val(unique_id); diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 290f6ca1..d83d434f 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -95,6 +95,7 @@ class Crm::CustomersController < BaseCrmController auth_token = memberaction.auth_token.to_s url = membership.gateway_url.to_s + memberaction.gateway_url.to_s + begin response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, dob: dob, member_group_id: member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, @@ -103,6 +104,9 @@ class Crm::CustomersController < BaseCrmController 'Accept' => 'application/json' } ) + rescue Net::OpenTimeout + response = { status: false } + end if response["status"] == true @@ -159,7 +163,7 @@ end merchant_uid = memberaction.merchant_account_id.to_s auth_token = memberaction.auth_token.to_s url = membership.gateway_url.to_s + memberaction.gateway_url.to_s - + begin response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, dob: dob, id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, @@ -168,7 +172,9 @@ end 'Accept' => 'application/json' } ) - + rescue Net::OpenTimeout + response = { status: false } + end format.html { redirect_to crm_customers_path, notice: 'Customer was successfully updated.' } format.json { render :show, status: :ok, location: @crm_customer } diff --git a/app/controllers/reports/daily_sale_controller.rb b/app/controllers/reports/daily_sale_controller.rb index 86e60702..34a3b5e2 100644 --- a/app/controllers/reports/daily_sale_controller.rb +++ b/app/controllers/reports/daily_sale_controller.rb @@ -5,19 +5,7 @@ class Reports::DailySaleController < BaseReportController @sale_data = Sale.daily_sales_list(from,to) @tax = SaleTax.get_tax(from,to) end - - # @locations = Location.all - # branch,from, to, report_type = get_date_range_from_params - - # @location = Location.find_by_id(current_location) - # @sale_data = Sale.daily_sales_report(current_location,from,to) - # @tax = SaleT.get_tax(current_location,from,to) - - # if @sale_data.blank? && @tax.blank? && request.post? - # flash.now[:notice] = "No data available for selected filters" - # end - def show end diff --git a/app/controllers/reports/sale_item_controller.rb b/app/controllers/reports/sale_item_controller.rb new file mode 100644 index 00000000..40aea618 --- /dev/null +++ b/app/controllers/reports/sale_item_controller.rb @@ -0,0 +1,14 @@ +class Reports::SaleItemController < BaseReportController + + def index + + from, to, report_type = get_date_range_from_params + + @sale_data = Sale.get_by_range_by_saleitems(from,to,Sale::SALE_STATUS_COMPLETED,report_type) + end + + def show + + end + +end \ No newline at end of file diff --git a/app/models/sale.rb b/app/models/sale.rb index 999577d7..5e0691f4 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -16,6 +16,14 @@ class Sale < ApplicationRecord scope :open_invoices, -> { where("sale_status = 'new' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") } + REPORT_TYPE = { + "daily" => 0, + "monthly" => 1, + "yearly" => 2 + } + + SALE_STATUS_COMPLETED = "completed" + def generate_invoice_from_booking(booking_id, requested_by) booking = Booking.find(booking_id) status = false @@ -328,6 +336,40 @@ class Sale < ApplicationRecord return daily_total end +def self.get_by_range_by_saleitems(from,to,status,report_type) + + query = Sale.select(" + mi.item_code as code,(SUM(i.qty) * i.unit_price) as grand_total, + SUM(i.qty) as total_item," + + " i.unit_price as unit_price, + mi.name as product_name, + mc.name as menu_category_name, + mc.id as menu_category_id ") + .group('mi.id') + .order("mi.menu_category_id") + + query = query.joins("JOIN sale_items i ON i.sale_id = sales.sale_id + JOIN menu_items mi ON i.product_code = mi.item_code" + + " JOIN menu_categories mc ON mc.id = mi.menu_category_id + JOIN employees ea ON ea.id = sales.cashier_id") + + + query = query.where("receipt_date between ? and ? and sale_status=?",from,to,status) + + + + case report_type.to_i + when REPORT_TYPE["daily"] + return query + when REPORT_TYPE["monthly"] + + return query.group("MONTH(date)") + when REPORT_TYPE["yearly"] + return query.group("YEAR(date)") + end + +end + private def generate_custom_id diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 6cacc391..dfecfdf0 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -33,7 +33,7 @@ class ReceiptBillPdf < Prawn::Document all_total(sale_data) if member_info != nil - member_info(member_info) + member_info(member_info,customer_name) end footer end @@ -61,14 +61,14 @@ class ReceiptBillPdf < Prawn::Document end move_down 5 - y_position = cursor - bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do - text "Customer:", :size => self.item_font_size,:align => :left - end - bounding_box([self.label_width,y_position], :width =>self.item_width) do - text "#{customer_name}" , :size => self.item_font_size,:align => :left - end - move_down 5 + # y_position = cursor + # bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do + # text "Customer:", :size => self.item_font_size,:align => :left + # end + # bounding_box([self.label_width,y_position], :width =>self.item_width) do + # text "#{customer_name}" , :size => self.item_font_size,:align => :left + # end + # move_down 5 y_position = cursor bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do @@ -203,19 +203,32 @@ class ReceiptBillPdf < Prawn::Document end # show member information - def member_info(member_info) + def member_info(member_info,customer_name) move_down 7 + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + text "Customer", :size => self.item_font_size,:align => :left + end + bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + text "#{ customer_name }" , :size => self.item_font_size,:align => :right + end + move_down 5 + if member_info["status"] == true member_info["data"].each do |res| - move_down 5 - y_position = cursor - bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "#{ res["accountable_type"] }", :size => self.item_font_size,:align => :left - end - bounding_box([self.item_description_width,y_position], :width =>self.label_width) do - text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right + if res["accountable_type"]== "RebateAccount" + + move_down 5 + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + text "Rebate Balance", :size => self.item_font_size,:align => :left + end + bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right + end + end end diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index ff83dad4..6b7b0c20 100644 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -364,7 +364,7 @@ <%=@selected_item.grand_total rescue 0%> --> - + diff --git a/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb b/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb index 04e548da..3a5d788c 100644 --- a/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb +++ b/app/views/reports/daily_sale/_shift_sale_report_filter.html.erb @@ -147,4 +147,5 @@ $(function(){ }); + \ No newline at end of file diff --git a/app/views/reports/daily_sale/index.html.erb b/app/views/reports/daily_sale/index.html.erb index 4aa0c841..a2403045 100644 --- a/app/views/reports/daily_sale/index.html.erb +++ b/app/views/reports/daily_sale/index.html.erb @@ -32,16 +32,16 @@ Sr.no Date - Daily Void Amount - Daily mpu Sales - Daily master Sales - Daily visa Sales - Daily jcb Sales - Daily paypar Sales - Daily Cash Sales - Daily Credit Sales - Daily FOC Sales - (Daily Discount) + Void Amount + Mpu Sales + Master Sales + Visa Sales + Jcb Sales + Paypar Sales + Cash Sales + Credit Sales + FOC Sales + (Discount) Grand Total +
Rounding Adj. Rounding Adj. Grand Total diff --git a/app/views/reports/daily_sale/index.xls.erb b/app/views/reports/daily_sale/index.xls.erb index dfcc18d4..67e76e3c 100644 --- a/app/views/reports/daily_sale/index.xls.erb +++ b/app/views/reports/daily_sale/index.xls.erb @@ -10,16 +10,16 @@ Sr.no Date - Daily Void Amount - Daily mpu Sales - Daily master Sales - Daily visa Sales - Daily jcb Sales - Daily paypar Sales - Daily Cash Sales - Daily Credit Sales - Daily FOC Sales - (Daily Discount) + Void Amount + Mpu Sales + Master Sales + Visa Sales + Jcb Sales + Paypar Sales + Cash Sales + Credit Sales + FOC Sales + (Discount) Grand Total +
Rounding Adj. Rounding Adj. Grand Total diff --git a/app/views/reports/daily_sale_report.html.erb b/app/views/reports/daily_sale_report.html.erb deleted file mode 100644 index 786951f5..00000000 --- a/app/views/reports/daily_sale_report.html.erb +++ /dev/null @@ -1,20 +0,0 @@ - - -
- <%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_receipt_no_index_path} %> -
-
- -
-
- -
-
diff --git a/app/views/reports/_shift_sale_report_filter.html.erb b/app/views/reports/sale_item/_shift_sale_report_filter.html.erb similarity index 77% rename from app/views/reports/_shift_sale_report_filter.html.erb rename to app/views/reports/sale_item/_shift_sale_report_filter.html.erb index 1b4082f5..7f95b6b9 100644 --- a/app/views/reports/_shift_sale_report_filter.html.erb +++ b/app/views/reports/sale_item/_shift_sale_report_filter.html.erb @@ -18,7 +18,8 @@ -
+ +
@@ -143,69 +144,13 @@ $(function(){ $('#frm_report').submit(); // window.location = url; }); + + function export_to(path) +{ + var form_params = $("#frm_report").serialize(); + window.location = path+"?"+ form_params; +} - var item = $('#item').val(); - var payment_type = $('#payment_type'); - - if(item == 'order'){ - $('#cashier').hide(); - $('#waiter').show(); - if(payment_type){ - $('#payment_type').hide(); - } - } - else if(item == 'sale'){ - $('#waiter').hide(); - $('#cashier').show(); - } - else{ - $('#waiter').hide(); - $('#cashier').show(); - $("#item").val('sale'); - } }); -//Reset the form to pervious values -$("#branch").val(<%=params[:branch]%>); -$("#waiter").val("<%=params[:waiter]%>"); -$("#cashier").val(<%=params[:cashier]%>); -$("#product").val(<%=params[:product]%>); -$("#singer").val(<%=params[:singer]%>); -$("#item").val('<%=params[:item]%>'); -$("#guest_role").val('<%=params[:guest_role]%>'); - - -$("#from").val("<%=params[:from]%>"); -$("#to").val("<%=params[:to]%>"); -$("#sel_period").val(<%=params[:period]%>); -$("#sel_sale_type").val(<%=params[:sale_type]%>); - -<% if params[:period_type] == 1 || params[:period_type] == "1" %> - $("#rd_period_type_1").attr("checked","checked"); -<% else %> - $("#rd_period_type_0").attr("checked","checked"); -<% end %> -$(".btn-group button").removeClass("active"); -<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> -$("#btn_report_type_<%= report_type %>").addClass("active"); - -$('#item').change(function(){ - var item = $('#item').val(); - var payment_type = $('#payment_type'); - - if(item == 'sale'){ - $('#waiter').hide(); - $('#cashier').show(); - if(payment_type){ - $('#payment_type').show(); - } - } - else{ - $('#cashier').hide(); - $('#waiter').show(); - if(payment_type){ - $('#payment_type').hide(); - } - } -}); \ No newline at end of file diff --git a/app/views/reports/sale_item/index.html.erb b/app/views/reports/sale_item/index.html.erb new file mode 100644 index 00000000..cce5a210 --- /dev/null +++ b/app/views/reports/sale_item/index.html.erb @@ -0,0 +1,141 @@ + + +
+ <%= render :partial=>'shift_sale_report_filter', + :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_sale_item_index_path} %> +
+
+ +
+
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + +
Date
Menu CategoryCodeProductTotal ItemUnit PriceRevenue
+
+
+
+ + \ No newline at end of file diff --git a/app/views/reports/sale_item/index.xls.erb b/app/views/reports/sale_item/index.xls.erb new file mode 100644 index 00000000..dfcc18d4 --- /dev/null +++ b/app/views/reports/sale_item/index.xls.erb @@ -0,0 +1,116 @@ +
+
+ + + <% if params[:from]%> + + + + <% end %> + + + + + + + + + + + + + + + + + + + <% unless @sale_data.empty? %> + + + <% void = 0 %> + <% mpu = 0 %> + <% master = 0 %> + <% visa = 0 %> + <% jcb = 0 %> + <% paypar = 0 %> + <% cash = 0 %> + <% credit = 0 %> + <% foc = 0 %> + <% discount = 0 %> + <% total = 0 %> + <% 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] %> + <% paypar += sale[:paypar_amount] %> + <% cash += sale[:cash_amount] %> + <% credit += sale[:credit_amount] %> + <% foc += sale[:foc_amount] %> + <% discount += sale[:total_discount] %> + <% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %> + <% grand_total += sale[:grand_total].to_f %> + <% rounding_adj += sale[:rounding_adj].to_f %> + + + + + + + + + + + + + + + + + + <% count = count + 1 %> + <% end %> + + + + + + + + + + + + + + + + + + <% total_tax = 0 %> + <% unless @tax.empty? %> + <% @tax.each do |tax| %> + <% total_tax += tax.tax_amount.to_f %> + + + + + + + <% end %> + <% net = total - total_tax %> + + + + + + <% end %> + + <% end %> +
Sale (<%= params[:from] rescue '-' %> - <%= params[:to] rescue '-'%>)
Sr.noDateDaily Void AmountDaily mpu SalesDaily master SalesDaily visa SalesDaily jcb SalesDaily paypar SalesDaily Cash SalesDaily Credit SalesDaily FOC Sales(Daily Discount)Grand Total +
Rounding Adj.
Rounding Adj.Grand Total
<%= count %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_with_delimiter(sprintf("%.2f",sale[:void_amount]), :delimiter => ',') 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[:paypar_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount]), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount]), :delimiter => ',') rescue '-'%>(<%= number_with_delimiter(sprintf("%.2f",sale[:total_discount]), :delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",sale[:grand_total].to_f + sale[:rounding_adj].to_f ), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:rounding_adj].to_f), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",sale[:grand_total]), :delimiter => ',') rescue '-'%>
Total<%= number_with_delimiter(sprintf("%.2f",mpu_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",master_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",visa_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",jcb_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",paypar_amount), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",credit), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",foc), :delimiter => ',') rescue '-'%>(<%= number_with_delimiter(sprintf("%.2f",discount), :delimiter => ',') rescue '-'%>)<%= number_with_delimiter(sprintf("%.2f",total), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",rounding_adj), :delimiter => ',') rescue '-'%><%= number_with_delimiter(sprintf("%.2f",grand_total), :delimiter => ',') rescue '-'%>
<%= tax.tax_name rescue '-'%><%= number_with_delimiter(sprintf("%.2f",tax.tax_amount), :delimiter => ',') rescue '-'%> 
Net Amount<%= number_with_delimiter(sprintf("%.2f",net), :delimiter => ',') rescue '-'%> 
+
+
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 6253a95f..7bb463ee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -212,6 +212,7 @@ Rails.application.routes.draw do namespace :reports do resources :receipt_no, :only => [:index, :show] resources :daily_sale, :only => [:index, :show] + resources :sale_item, :only => [:index, :show] # resources :sales, :only => [:index, :show] # resources :orders, :only => [:index, :show] # resources :customers, :only => [:index, :show] From 33cb8b64a32d25c093bf89cb44d545999adaf26f Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 20 Jun 2017 17:57:50 +0630 Subject: [PATCH 03/10] finished customer form and update --- app/assets/stylesheets/CRM.scss | 3 + app/controllers/crm/customers_controller.rb | 33 +++--- .../origami/payments_controller.rb | 5 +- app/models/customer.rb | 42 ++----- app/models/sale_payment.rb | 4 +- app/views/api/customers/index.json.jbuilder | 4 +- app/views/api/customers/show.json.jbuilder | 4 +- app/views/crm/customers/index.html.erb | 107 +++++++++++++++--- app/views/crm/customers/show.json.jbuilder | 5 +- app/views/origami/customers/index.html.erb | 93 +++++++++++++-- app/views/reports/receipt_no/index.html.erb | 9 +- app/views/transactions/sales/show.html.erb | 2 +- ....rb => 20170620091919_create_customers.rb} | 8 +- 13 files changed, 235 insertions(+), 84 deletions(-) rename db/migrate/{20170403135121_create_customers.rb => 20170620091919_create_customers.rb} (73%) diff --git a/app/assets/stylesheets/CRM.scss b/app/assets/stylesheets/CRM.scss index 8ddc1605..e2b88eaa 100644 --- a/app/assets/stylesheets/CRM.scss +++ b/app/assets/stylesheets/CRM.scss @@ -23,3 +23,6 @@ .assign .text-muted{ color: #fff !important; } +.required abbr{ + color: red !important; +} \ No newline at end of file diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index d83d434f..0adefbf4 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -7,23 +7,19 @@ class Crm::CustomersController < BaseCrmController filter = params[:filter] if filter.nil? - @crm_customers = Customer.order("customer_id").page(params[:page]) - #@products = Product.order("name").page(params[:page]).per(5) + @crm_customers = Customer.all else @crm_customers = Customer.search(filter) end #@crm_customers = Customer.all - @crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50) + @crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50) @crm_customer = Customer.new + @count_customer = Customer.count_customer # if flash["errors"] # @crm_customer.valid? # end - # @membership = Customer.get_member_group - # if @membership["status"] == true - # @member_group = @membership["data"] - # end respond_to do |format| format.html # index.html.erb format.json { render json: @crm_customers } @@ -50,14 +46,14 @@ class Crm::CustomersController < BaseCrmController end #get customer amount - @customer = Customer.find(params[:id]) - response = Customer.get_member_account(@customer) + # @customer = Customer.find(params[:id]) + # response = Customer.get_member_account(@customer) - if(response["status"] == true) - @membership = response["data"] - else + # if(response["status"] == true) + # @membership = response["data"] + # else @membership = 0 - end + # end #end customer amount @@ -87,6 +83,8 @@ class Crm::CustomersController < BaseCrmController phone = customer_params[:contact_no] email = customer_params[:email] dob = customer_params[:date_of_birth] + address = customer_params[:address] + nrc = customer_params[:nrc_no] member_group_id = params[:member_group_id] membership = MembershipSetting.find_by_membership_type("paypar_url") @@ -97,7 +95,7 @@ class Crm::CustomersController < BaseCrmController begin response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, - dob: dob, + dob: dob,address: address,nrc:nrc, member_group_id: member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { 'Content-Type' => 'application/json', @@ -155,6 +153,8 @@ end phone = customer_params[:contact_no] email = customer_params[:email] dob = customer_params[:date_of_birth] + address = customer_params[:address] + nrc = customer_params[:nrc_no] id = @crm_customer.membership_id member_group_id = params[:member_group_id] @@ -165,7 +165,7 @@ end url = membership.gateway_url.to_s + memberaction.gateway_url.to_s begin response = HTTParty.post(url, :body => { name: name,phone: phone,email: email, - dob: dob, + dob: dob,address: address,nrc:nrc, id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json, :headers => { 'Content-Type' => 'application/json', @@ -207,6 +207,7 @@ end # Never trust parameters from the scary internet, only allow the white list through. def customer_params - params.require(:customer).permit(:name, :company, :contact_no, :email, :date_of_birth) + params.require(:customer).permit(:name, :company, :contact_no, :email, + :date_of_birth,:salution,:gender,:nrc_no,:address,:card_no) end end diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index e8ce6a96..6a6f4ca6 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -10,10 +10,9 @@ class Origami::PaymentsController < BaseOrigamiController if(Sale.exists?(sale_id)) saleObj = Sale.find(sale_id) sale_payment = SalePayment.new - rebate_amount = sale_payment.process_payment(saleObj, @user, cash, "cash") + sale_payment.process_payment(saleObj, @user, cash, "cash") - puts "resssssssssssssssssss" - puts rebate_amount.to_json + rebate_amount = nil unique_code = "ReceiptBillPdf" customer= Customer.find(saleObj.customer_id) diff --git a/app/models/customer.rb b/app/models/customer.rb index de9846f2..0924d232 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -45,43 +45,19 @@ class Customer < ApplicationRecord end end -# require "net/http" -# def self.url_exist?(url_string) -# url = URI.parse(url_string) - - -# req = Net::HTTP.new(url.host, url.port) -# puts "hhhhhhhhhhhh" -# puts req.to_json -# req.use_ssl = (url.scheme == 'https') -# puts "aaaaaaaaaaaa" -# puts req.use_ssl? -# path = url.path if url.path.present? -# puts "bbbbbbbbbbbbb" -# puts path -# res = req.request_head(path || '/') -# puts "cccccccccccccc" -# puts res.to_json -# puts "ddddddddd" -# puts res.kind_of?(Net::HTTPRedirection) -# if res.kind_of?(Net::HTTPRedirection) -# url_exist?(res['location']) # Go after any redirect and make sure you can access the redirected URL -# else -# ! %W(4 5).include?(res.code[0]) # Not from 4xx or 5xx families -# end -# rescue Errno::ENOENT -# false #false if can't find the server -# end - - - # def self.search(search) - # where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",) - # end - def lastest_invoices sales.where(:customer_id => self.id).order("created_at desc").limit(5) end + def self.count_customer + all = self.all.count+1 + count = all-2 + + end + + WALKIN = "CUS-000000000001" + TAKEAWAY = "CUS-000000000002" + private def generate_custom_id self.customer_id = SeedGenerator.generate_id(self.class.name, "CUS") diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 92bebd59..c31ed341 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -54,10 +54,8 @@ class SalePayment < ApplicationRecord #record an payment in sale-audit remark = "Payment #{payment_method}- for Invoice #{invoice.receipt_no} Due [#{amount_due}]| pay amount -> #{cash_amount} | Payment Status ->#{payment_status}" sale_audit = SaleAudit.record_payment(invoice.id, remark, action_by) - sObj = Sale.find(self.sale_id) - response = rebat(sObj) - return true, response + return true, self.save else #record an payment in sale-audit remark = "No outstanding Amount - Grand Total [#{invoice.grand_total}] | Due [#{amount_due}] | Paid [#{invoice.amount_received}]" diff --git a/app/views/api/customers/index.json.jbuilder b/app/views/api/customers/index.json.jbuilder index 900e6c6b..2c3c07a7 100644 --- a/app/views/api/customers/index.json.jbuilder +++ b/app/views/api/customers/index.json.jbuilder @@ -1 +1,3 @@ -json.array! @customers, :id, :name, :company, :contact_no, :email, :membership_id, :membership_type +json.array! @customers, :id, :name, :company, :contact_no,:salution, + :gender,:nrc_no,:address,:card_no, :membership_type, + :membership_id, :created_at diff --git a/app/views/api/customers/show.json.jbuilder b/app/views/api/customers/show.json.jbuilder index 79397308..db56961b 100644 --- a/app/views/api/customers/show.json.jbuilder +++ b/app/views/api/customers/show.json.jbuilder @@ -1,4 +1,6 @@ -json.extract! @customer, :id, :name, :company, :contact_no, :membership_type, :membership_id, :created_at +json.extract! @customer, :id, :name, :company, :contact_no,:salution, + :gender,:nrc_no,:address,:card_no, :membership_type, + :membership_id, :created_at json.invoices do json.array! @customer.lastest_invoices ,:id, :receipt_no, :receipt_date, :sale_status, :payment_status end diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index f97de091..532857f9 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -34,6 +34,7 @@ Select + Sr.no Name Company Contact no @@ -43,11 +44,13 @@ <% if @crm_customers.count > 0 %> + <% @i = 0 %> <% @crm_customers.each do |crm_customer| %> <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> + <%= @i += 1 %> <%= crm_customer.name %> <%= crm_customer.company rescue '-' %> <%= crm_customer.contact_no %> @@ -75,32 +78,89 @@ <%= f.hidden_field :id, :class => "form-control col-md-6 " %> + +
+
+ + + + +
"> - <%= f.input :name, :class => "form-control col-md-6 name" %> + <%= f.input :name, :class => "form-control col-md-6 name", :required => true %> + <% flash.each do |name, msg| %> - <%= msg['name'] %> + <% str="[\"#{msg['name']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> <% end -%> -
+
- <%= f.input :company, :class => "form-control col-md-6 company" %> +
+ + +
+ +
+ <%= f.input :nrc_no, :class => "form-control nrc_no" %> +
+ +
+ <%= f.input :company, :class => "form-control col-md-6 company",:required => true%> + + <% flash.each do |name, msg| %> + <% str="[\"#{msg['company']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> + <% end -%>
"> - <%= f.input :contact_no, :class => "form-control col-md-6 contact_no" %> + <%= f.input :contact_no, :class => "form-control col-md-6 contact_no" ,:required => true%> + <% flash.each do |name, msg| %> - <%= msg['contact_no'] %> + <% str="[\"#{msg['contact_no']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> <% end -%>
"> - <%= f.input :email, :class => "form-control col-md-6 email" %> + <%= f.input :email, :class => "form-control col-md-6 email" ,:required => true%> <% flash.each do |name, msg| %> - <%= msg['email'] %> + <% str="[\"#{msg['contact_no']}\"]" + str.gsub!('["', '') + str.gsub!('"]', '') %> + <%= str %> <% end -%>
+
+ <%= f.input :address, :class => "form-control col-md-6 address" %> +
+ +
+ + +
+
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%> @@ -137,12 +197,12 @@ + + + diff --git a/app/views/crm/dining_queues/index.html.erb b/app/views/crm/dining_queues/index.html.erb index 7050885d..502bcd3f 100644 --- a/app/views/crm/dining_queues/index.html.erb +++ b/app/views/crm/dining_queues/index.html.erb @@ -9,39 +9,38 @@
-
+ +
-
- <% @i = 0 %> . - <% @dining_queues.each do |queue| %> -
-
" style="border:1px solid #ccc;margin-bottom: 10px "> -
- - -

<%= @i += 1 %> . Queue No

-

<%= queue.queue_no %>

-

- Name : <%= queue.name %>
- Contact : <%= queue.contact_no %> -
- Status : <%= queue.status rescue '-' %> -

-
-
+
-
- <% end %> -
- - -
+ +
+
+
+ <% @i =0 %> + <% @dining_queues.each do |queue| %> +
" data-id="<%= queue.id %>"> +
+ + + <%= @i += 1 %> . Queue No +

<%= queue.queue_no %>

+ +
+
+ + <% end %> +
+
+
+
+ +
- -
\ No newline at end of file diff --git a/db/migrate/20170620091919_create_customers.rb b/db/migrate/20170621085729_create_customers.rb similarity index 85% rename from db/migrate/20170620091919_create_customers.rb rename to db/migrate/20170621085729_create_customers.rb index f3f73742..57553010 100644 --- a/db/migrate/20170620091919_create_customers.rb +++ b/db/migrate/20170621085729_create_customers.rb @@ -1,5 +1,4 @@ - - class CreateCustomers < ActiveRecord::Migration[5.1] +class CreateCustomers < ActiveRecord::Migration[5.1] def change create_table :customers, :id => false do |t| t.string :customer_id, :limit => 16, :primary_key => true #custom foreign_key to prevent conflict during sync @@ -15,7 +14,7 @@ t.string :gender t.string :nrc_no t.string :address - t.string :card_no + t.string :card_no, :unique => true t.timestamps end diff --git a/db/seeds.rb b/db/seeds.rb index 56591e2c..a646bdad 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -161,7 +161,8 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance", {membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, {membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, {membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, - {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"} + {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"}, + {membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"vWSsseoZCzxd6xcNf_uS",auth_token:"code2lab"} ]) payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http://192.168.1.47:3006"}) From d2549df2e941101fd49624f2dde204708b4a9811 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 21 Jun 2017 17:37:16 +0630 Subject: [PATCH 06/10] update receipt bill payment --- app/assets/javascripts/application.js | 1 - app/controllers/origami/payments_controller.rb | 6 +++--- .../reports/daily_sale_controller.rb | 2 +- .../reports/receipt_no_controller.rb | 2 +- .../reports/sale_item_controller.rb | 2 +- app/models/customer.rb | 2 +- app/pdf/receipt_bill_pdf.rb | 18 ++++++++++++++---- app/views/layouts/_header.html.erb | 2 +- 8 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8604d3c8..63c871d9 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -28,7 +28,6 @@ $(document).on("focus", "[data-behaviour~='datepicker']", function(e){ function export_to(path) { var form_params = $("#frm_report").serialize(); - alert(form_params); window.location = path+"?"+ form_params; } diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 6a6f4ca6..38225fae 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -16,7 +16,7 @@ class Origami::PaymentsController < BaseOrigamiController unique_code = "ReceiptBillPdf" customer= Customer.find(saleObj.customer_id) - + rebate_amount = Customer.get_membership_transactions(customer) # get member information member_info = Customer.get_member_account(customer) @@ -90,7 +90,7 @@ class Origami::PaymentsController < BaseOrigamiController # get member information member_info = Customer.get_member_account(customer) - + rebate_amount = Customer.get_membership_transactions(customer) # get printer info print_settings=PrintSetting.find_by_unique_code(unique_code) @@ -98,7 +98,7 @@ class Origami::PaymentsController < BaseOrigamiController food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items) printer = Printer::ReceiptPrinter.new(print_settings) - printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info) + printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info,rebate_amount) end diff --git a/app/controllers/reports/daily_sale_controller.rb b/app/controllers/reports/daily_sale_controller.rb index 34a3b5e2..6e1eb85a 100644 --- a/app/controllers/reports/daily_sale_controller.rb +++ b/app/controllers/reports/daily_sale_controller.rb @@ -1,7 +1,7 @@ class Reports::DailySaleController < BaseReportController def index - from, to = get_date_range_from_params + from, to ,report_type = get_date_range_from_params @sale_data = Sale.daily_sales_list(from,to) @tax = SaleTax.get_tax(from,to) end diff --git a/app/controllers/reports/receipt_no_controller.rb b/app/controllers/reports/receipt_no_controller.rb index 6f501fd1..86c8d981 100644 --- a/app/controllers/reports/receipt_no_controller.rb +++ b/app/controllers/reports/receipt_no_controller.rb @@ -1,5 +1,5 @@ class Reports::ReceiptNoController < BaseReportController - load_and_authorize_resource + def index from, to = get_date_range_from_params puts "from..." diff --git a/app/controllers/reports/sale_item_controller.rb b/app/controllers/reports/sale_item_controller.rb index 9e2b728b..1da31aff 100644 --- a/app/controllers/reports/sale_item_controller.rb +++ b/app/controllers/reports/sale_item_controller.rb @@ -1,5 +1,5 @@ class Reports::SaleItemController < BaseReportController - load_and_authorize_resource + def index from, to, report_type = get_date_range_from_params diff --git a/app/models/customer.rb b/app/models/customer.rb index 32422185..e5dfb668 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -64,7 +64,7 @@ class Customer < ApplicationRecord def self.search(search) if search # find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"]) - where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",) + where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%",) else find(:all) end diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 2b1ae2ae..516f5668 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -260,17 +260,27 @@ class ReceiptBillPdf < Prawn::Document if rebate_amount["status"] == true rebate_amount["data"].each do |res| - if res["receipt_no"]== sale_data.receipt_no + if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Rebate" move_down 5 y_position = cursor bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Rebate Balance", :size => self.item_font_size,:align => :left + text "Rebate Amount", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do text "#{ res["rebate"] }" , :size => self.item_font_size,:align => :right end - + end + if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Redeem" + + move_down 5 + y_position = cursor + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + text "Redeem Amount", :size => self.item_font_size,:align => :left + end + bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + text "#{ res["redeem"] }" , :size => self.item_font_size,:align => :right + end end end @@ -301,7 +311,7 @@ class ReceiptBillPdf < Prawn::Document move_down 5 y_position = cursor bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do - text "Customer", :size => self.item_font_size,:align => :left + text "Customer Name", :size => self.item_font_size,:align => :left end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do text "#{ customer_name }" , :size => self.item_font_size,:align => :right diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 40ddae1f..c528003d 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -39,7 +39,7 @@ From d9d07a1cdcbc07a27b3873ace33d1675a66778fc Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 21 Jun 2017 18:19:44 +0630 Subject: [PATCH 07/10] update reprint --- .../origami/request_bills_controller.rb | 2 +- app/pdf/receipt_bill_pdf.rb | 4 +++- app/views/crm/customers/index.html.erb | 2 +- app/views/crm/dining_queues/index.html.erb | 15 +++++++++------ app/views/origami/sales/show.html.erb | 8 +++++++- config/routes.rb | 2 +- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 360274fa..37eef687 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -37,7 +37,7 @@ class Origami::RequestBillsController < BaseOrigamiController printer = Printer::ReceiptPrinter.new(print_settings) printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total,member_info) - redirect_to origami_path(@sale_data.sale_id) + # redirect_to origami_path(@sale_data.sale_id) end end diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 516f5668..bdeb58a3 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -250,14 +250,16 @@ class ReceiptBillPdf < Prawn::Document end move_down 5 end - stroke_horizontal_rule + end # show member information def member_info(member_info,customer_name,rebate_amount,sale_data) if rebate_amount != nil + if rebate_amount["status"] == true + stroke_horizontal_rule rebate_amount["data"].each do |res| if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Rebate" diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index a8f02920..e7b47460 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -28,7 +28,7 @@ - +
<% end %> diff --git a/app/views/crm/dining_queues/index.html.erb b/app/views/crm/dining_queues/index.html.erb index 502bcd3f..ac247771 100644 --- a/app/views/crm/dining_queues/index.html.erb +++ b/app/views/crm/dining_queues/index.html.erb @@ -12,20 +12,23 @@
-
+
-
-
-
+
+
+
<% @i =0 %> <% @dining_queues.each do |queue| %>
" data-id="<%= queue.id %>">
- <%= @i += 1 %> . Queue No -

<%= queue.queue_no %>

+ + <%= @i += 1 %> . Queue No +

+ <%= queue.queue_no %> +

diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb index 81face96..e896a50a 100644 --- a/app/views/origami/sales/show.html.erb +++ b/app/views/origami/sales/show.html.erb @@ -175,7 +175,7 @@
- +
@@ -206,4 +206,10 @@ $('#pay').on('click',function() { $('#back').on('click',function(){ window.location.href = '/origami/'; }) +$('#re-print').click(function() { + var sale_id = $('#sale_id').val(); + window.location.href = '/origami/'+ sale_id + "/reprint" + + return false; + }); diff --git a/config/routes.rb b/config/routes.rb index 90c7b0e8..29c1960e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -89,7 +89,7 @@ Rails.application.routes.draw do get "/:id/discount" => "discounts#index" post "/:id/discount" => "discounts#create" - post "/:id/request_bills" => "request_bills#print" + post "/:id/request_bills" => "request_bills#print" ,:defaults => { :format => 'json' } get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' } #--------- Payment ------------# get 'sale/:sale_id/payment' => 'payments#show' From 3ba836b4466193fff94e13bfa9f60af1f12f15f9 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 21 Jun 2017 18:29:02 +0630 Subject: [PATCH 08/10] update customer transaction --- .../transactions/sales_controller.rb | 8 +- app/views/crm/customers/show.html.erb | 4 +- app/views/transactions/sales/show.html.erb | 114 +++++++++--------- 3 files changed, 60 insertions(+), 66 deletions(-) diff --git a/app/controllers/transactions/sales_controller.rb b/app/controllers/transactions/sales_controller.rb index fed62a34..0a069b1b 100644 --- a/app/controllers/transactions/sales_controller.rb +++ b/app/controllers/transactions/sales_controller.rb @@ -53,13 +53,7 @@ class Transactions::SalesController < ApplicationController #get customer amount @customer = Customer.find(@sale.customer_id) - response = Customer.get_member_account(@customer) - - if(response["status"] == true) - @membership = response["data"] - else - @membership = 0 - end + @response = Customer.get_membership_transactions(@customer) #end customer amount respond_to do |format| diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 6f61e3cb..5bdb9703 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -47,7 +47,7 @@ Redeem Rebate Balance - Account No + Status Receipt No @@ -60,7 +60,7 @@ <%= transaction["redeem"]%> <%= transaction["rebate"] %> <%= transaction["balance"] %> - <%= transaction["account_no"] %> + <%= transaction["status"] %> <%= transaction["receipt_no"] %> diff --git a/app/views/transactions/sales/show.html.erb b/app/views/transactions/sales/show.html.erb index 7fdec433..04343380 100644 --- a/app/views/transactions/sales/show.html.erb +++ b/app/views/transactions/sales/show.html.erb @@ -175,63 +175,63 @@
- -
-
-
-
-

Customer Profile

-
- - - - - - - - - - - - - - - - - - - - - - - -
Name<%= @customer.name %>
Email<%= @customer.email %>
Contact no<%= @customer.contact_no %>
Company<%= @customer.company %>
Date Of Birth<%= @customer.date_of_birth %>
-
-
-
-
-

Membership Detail

-
- - - <% if @membership == 0 %> - - - - <% else %> - <% @membership.each do |member| %> - - - - - <% end %> - - <% end %> - -
"There is no membership data"
<%= member["accountable_type"] %><%= member["balance"] %>
-
-
-
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + if @response["status"] == true %> + <% @response["data"].each do |transaction| %> + + + + + + + + + + + <% end %> + <% end %> + +
Card NoNameCompanyContact noEmailNRC/Passport NoAddressDOB
<%= @customer.card_no rescue '-'%><%= @customer.name %><%= @customer.company rescue '-' %><%= @customer.contact_no %><%= @customer.email %><%= @customer.nrc_no %><%= @customer.address%><%= @customer.date_of_birth %>
Membership Transactions
DateRedeemRebateBalanceStatusReceipt No
<%= transaction["date"]%><%= transaction["redeem"]%><%= transaction["rebate"] %><%= transaction["balance"] %><%= transaction["status"] %><%= transaction["receipt_no"] %>
From a6912d4e5bd99b7d665cc1436b7d0decd57d8d46 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 21 Jun 2017 18:30:51 +0630 Subject: [PATCH 09/10] update customer search in card no --- app/models/customer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index e5dfb668..4e25c9bc 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -64,7 +64,7 @@ class Customer < ApplicationRecord def self.search(search) if search # find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"]) - where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%",) + where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%", "%#{search}%",) else find(:all) end From d95b7c7abcec0e1210228c1177f22a12d1b76639 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 21 Jun 2017 19:20:10 +0630 Subject: [PATCH 10/10] add confirm js and css --- app/assets/javascripts/jquery-confirm.js | 10 ++++++++++ app/assets/stylesheets/jquery-confirm.scss | 10 ++++++++++ app/views/crm/dining_queues/assign.html.erb | 4 ++-- app/views/layouts/CRM.html.erb | 2 ++ app/views/layouts/origami.html.erb | 2 ++ app/views/origami/customers/index.html.erb | 2 -- config/initializers/assets.rb | 4 ++++ 7 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 app/assets/javascripts/jquery-confirm.js create mode 100644 app/assets/stylesheets/jquery-confirm.scss diff --git a/app/assets/javascripts/jquery-confirm.js b/app/assets/javascripts/jquery-confirm.js new file mode 100644 index 00000000..43d8889b --- /dev/null +++ b/app/assets/javascripts/jquery-confirm.js @@ -0,0 +1,10 @@ +/*! + * jquery-confirm v3.2.3 (http://craftpip.github.io/jquery-confirm/) + * Author: Boniface Pereira + * Website: www.craftpip.com + * Contact: hey@craftpip.com + * + * Copyright 2013-2017 jquery-confirm + * Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE) + */ +if(typeof jQuery==="undefined"){throw new Error("jquery-confirm requires jQuery");}var jconfirm,Jconfirm;(function($,window){$.fn.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}$(this).each(function(){var $this=$(this);$this.on("click",function(e){e.preventDefault();var jcOption=$.extend({},options);if($this.attr("data-title")){jcOption.title=$this.attr("data-title");}if($this.attr("data-content")){jcOption.content=$this.attr("data-content");}if(typeof jcOption.buttons=="undefined"){jcOption.buttons={};}jcOption["$target"]=$this;if($this.attr("href")&&Object.keys(jcOption.buttons).length==0){var buttons=$.extend(true,{},jconfirm.pluginDefaults.defaultButtons,(jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];jcOption.buttons=buttons;jcOption.buttons[firstBtn].action=function(){location.href=$this.attr("href");};}jcOption.closeIcon=false;$.confirm(jcOption);});});return $(this);};$.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}if(typeof options.buttons!="object"){options.buttons={};}if(Object.keys(options.buttons).length==0){var buttons=$.extend(true,{},jconfirm.pluginDefaults.defaultButtons,(jconfirm.defaults||{}).defaultButtons||{});options.buttons=buttons;}return jconfirm(options);};$.alert=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}if(typeof options.buttons!="object"){options.buttons={};}if(Object.keys(options.buttons).length==0){var buttons=$.extend(true,{},jconfirm.pluginDefaults.defaultButtons,(jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];options.buttons[firstBtn]=buttons[firstBtn];}return jconfirm(options);};$.dialog=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false,closeIcon:function(){}};}options.buttons={};if(typeof options.closeIcon=="undefined"){options.closeIcon=function(){};}options.confirmKeys=[13];return jconfirm(options);};jconfirm=function(options){if(typeof options==="undefined"){options={};}var pluginOptions=$.extend(true,{},jconfirm.pluginDefaults);if(jconfirm.defaults){pluginOptions=$.extend(true,pluginOptions,jconfirm.defaults);}pluginOptions=$.extend(true,{},pluginOptions,options);var instance=new Jconfirm(pluginOptions);jconfirm.instances.push(instance);return instance;};Jconfirm=function(options){$.extend(this,options);this._init();};Jconfirm.prototype={_init:function(){var that=this;if(!jconfirm.instances.length){jconfirm.lastFocused=$("body").find(":focus");}this._id=Math.round(Math.random()*99999);if(!this.lazyOpen){setTimeout(function(){that.open();},0);}},_buildHTML:function(){var that=this;this._parseAnimation(this.animation,"o");this._parseAnimation(this.closeAnimation,"c");this._parseBgDismissAnimation(this.backgroundDismissAnimation);this._parseColumnClass(this.columnClass);this._parseTheme(this.theme);this._parseType(this.type);var template=$(this.template);template.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed);if(this.typeAnimated){template.find(".jconfirm-box").addClass("jconfirm-type-animated");}if(this.useBootstrap){template.find(".jc-bs3-row").addClass(this.bootstrapClasses.row);template.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center");template.find(".jconfirm-box-container").addClass(this.columnClassParsed);if(this.containerFluid){template.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid);}else{template.find(".jc-bs3-container").addClass(this.bootstrapClasses.container);}}else{template.find(".jconfirm-box").css("width",this.boxWidth);}if(this.titleClass){template.find(".jconfirm-title-c").addClass(this.titleClass);}template.addClass(this.themeParsed);var ariaLabel="jconfirm-box"+this._id;template.find(".jconfirm-box").attr("aria-labelledby",ariaLabel).attr("tabindex",-1);template.find(".jconfirm-content").attr("id",ariaLabel);if(this.bgOpacity!=null){template.find(".jconfirm-bg").css("opacity",this.bgOpacity);}if(this.rtl){template.addClass("jconfirm-rtl");}this.$el=template.appendTo(this.container);this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container");this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box");this.$jconfirmBg=this.$el.find(".jconfirm-bg");this.$title=this.$el.find(".jconfirm-title");this.$titleContainer=this.$el.find(".jconfirm-title-c");this.$content=this.$el.find("div.jconfirm-content");this.$contentPane=this.$el.find(".jconfirm-content-pane");this.$icon=this.$el.find(".jconfirm-icon-c");this.$closeIcon=this.$el.find(".jconfirm-closeIcon");this.$btnc=this.$el.find(".jconfirm-buttons");this.$scrollPane=this.$el.find(".jconfirm-scrollpane");this._contentReady=$.Deferred();this._modalReady=$.Deferred();this.setTitle();this.setIcon();this._setButtons();this._parseContent();this.initDraggable();if(this.isAjax){this.showLoading(false);}$.when(this._contentReady,this._modalReady).then(function(){if(that.isAjaxLoading){setTimeout(function(){that.isAjaxLoading=false;that.setContent();that.setTitle();that.setIcon();setTimeout(function(){that.hideLoading(false);},100);if(typeof that.onContentReady=="function"){that.onContentReady();}},50);}else{that.setContent();that.setTitle();that.setIcon();if(typeof that.onContentReady=="function"){that.onContentReady();}}if(that.autoClose){that._startCountDown();}});that._contentHash=this._hash(that.$content.html());that._contentHeight=this.$content.height();this._watchContent();this.setDialogCenter();if(this.animation=="none"){this.animationSpeed=1;this.animationBounce=1;}this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce));this.$contentPane.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1));},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(type){this.typeParsed=this._typePrefix+type;},setType:function(type){var oldClass=this.typeParsed;this._parseType(type);this.$jconfirmBox.removeClass(oldClass).addClass(this.typeParsed);},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(theme){var previous=this.theme;this.theme=theme||this.theme;this._parseTheme(this.theme);if(previous){this.$el.removeClass(previous);}this.$el.addClass(this.themeParsed);this.theme=theme;},_parseTheme:function(theme){var that=this;theme=theme.split(",");$.each(theme,function(k,a){if(a.indexOf(that._themePrefix)==-1){theme[k]=that._themePrefix+$.trim(a);}});this.themeParsed=theme.join(" ").toLowerCase();},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(bgDismissAnimation){var animation=bgDismissAnimation.split(",");var that=this;$.each(animation,function(k,a){if(a.indexOf(that._bgDismissPrefix)==-1){animation[k]=that._bgDismissPrefix+$.trim(a);}});this.backgroundDismissAnimationParsed=animation.join(" ").toLowerCase();},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(animation){this.animation=animation||this.animation;this._parseAnimation(this.animation,"o");},_parseAnimation:function(animation,which){which=which||"o";var animations=animation.split(",");var that=this;$.each(animations,function(k,a){if(a.indexOf(that._animationPrefix)==-1){animations[k]=that._animationPrefix+$.trim(a);}});var a_string=animations.join(" ").toLowerCase();if(which=="o"){this.animationParsed=a_string;}else{this.closeAnimationParsed=a_string;}return a_string;},setCloseAnimation:function(closeAnimation){this.closeAnimation=closeAnimation||this.closeAnimation;this._parseAnimation(this.closeAnimation,"c");},setAnimationSpeed:function(speed){this.animationSpeed=speed||this.animationSpeed;},columnClassParsed:"",setColumnClass:function(colClass){if(!this.useBootstrap){console.warn("cannot set columnClass, useBootstrap is set to false");return;}this.columnClass=colClass||this.columnClass;this._parseColumnClass(this.columnClass);this.$jconfirmBoxContainer.addClass(this.columnClassParsed);},setBoxWidth:function(){if(this.useBootstrap){console.warn("cannot set boxWidth, useBootstrap is set to true");return;}this.$jconfirmBox.css("width",this.boxWidth);},_parseColumnClass:function(colClass){colClass=colClass.toLowerCase();var p;switch(colClass){case"xl":case"xlarge":p="col-md-12";break;case"l":case"large":p="col-md-8 col-md-offset-2";break;case"m":case"medium":p="col-md-6 col-md-offset-3";break;case"s":case"small":p="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":p="col-md-2 col-md-offset-5";break;default:p=colClass;}this.columnClassParsed=p;},initDraggable:function(){var that=this;var $t=this.$titleContainer;this.resetDrag();if(this.draggable){$t.addClass("jconfirm-hand");$t.on("mousedown",function(e){that.mouseX=e.clientX;that.mouseY=e.clientY;that.isDrag=true;});$(window).on("mousemove."+this._id,function(e){if(that.isDrag){that.movingX=e.clientX-that.mouseX+that.initialX;that.movingY=e.clientY-that.mouseY+that.initialY;that.setDrag();}});$(window).on("mouseup."+this._id,function(){if(that.isDrag){that.isDrag=false;that.initialX=that.movingX;that.initialY=that.movingY;}});}},resetDrag:function(){this.isDrag=false;this.initialX=0;this.initialY=0;this.movingX=0;this.movingY=0;this.movingXCurrent=0;this.movingYCurrent=0;this.mouseX=0;this.mouseY=0;this.$jconfirmBoxContainer.css("transform","translate("+0+"px, "+0+"px)");},setDrag:function(){if(!this.draggable){return;}this.alignMiddle=false;this._boxWidth=this.$jconfirmBox.outerWidth();var ww=$(window).width();var that=this;if(that.movingX%2==0||that.movingY%2==0){var tb=that._boxTopMargin-that.dragWindowGap;if(tb+that.movingY<0){that.movingY=-tb;}else{that.movingYCurrent=that.movingY;}var lb=(ww/2)-that._boxWidth/2;var rb=(ww/2)+(that._boxWidth/2)-that._boxWidth;rb-=that.dragWindowGap;lb-=that.dragWindowGap;if(lb+that.movingX<0){that.movingX=-lb;}else{if(rb-that.movingX<0){that.movingX=rb;}else{that.movingXCurrent=that.movingX;}}that.$jconfirmBoxContainer.css("transform","translate("+that.movingX+"px, "+that.movingY+"px)");}},_hash:function(a){var string=a.toString();var h=0;if(string.length==0){return h;}for(var i=0;i').html(that.buttons[key].text).addClass(that.buttons[key].btnClass).prop("disabled",that.buttons[key].isDisabled).css("display",that.buttons[key].isHidden?"none":"").click(function(e){e.preventDefault();var res=that.buttons[key].action.apply(that);that.onAction(key);that._stopCountDown();if(typeof res==="undefined"||res){that.close();}});that.buttons[key].el=button_element;that.buttons[key].setText=function(text){button_element.html(text);};that.buttons[key].addClass=function(className){button_element.addClass(className);};that.buttons[key].removeClass=function(className){button_element.removeClass(className);};that.buttons[key].disable=function(){that.buttons[key].isDisabled=true;button_element.prop("disabled",true);};that.buttons[key].enable=function(){that.buttons[key].isDisabled=false;button_element.prop("disabled",false);};that.buttons[key].show=function(){that.buttons[key].isHidden=false;button_element.css("display","");that.setDialogCenter();};that.buttons[key].hide=function(){that.buttons[key].isHidden=true;button_element.css("display","none");that.setDialogCenter();};that["$_"+key]=that["$$"+key]=button_element;that.$btnc.append(button_element);});if(total_buttons===0){this.$btnc.hide();}if(this.closeIcon===null&&total_buttons===0){this.closeIcon=true;}if(this.closeIcon){if(this.closeIconClass){var closeHtml='';this.$closeIcon.html(closeHtml);}this.$closeIcon.click(function(e){e.preventDefault();var buttonName=false;var shouldClose=false;var str;if(typeof that.closeIcon=="function"){str=that.closeIcon();}else{str=that.closeIcon;}if(typeof str=="string"&&typeof that.buttons[str]!="undefined"){buttonName=str;shouldClose=false;}else{if(typeof str=="undefined"||!!(str)==true){shouldClose=true;}else{shouldClose=false;}}if(buttonName){var btnResponse=that.buttons[buttonName].action.apply(that);shouldClose=(typeof btnResponse=="undefined")||!!(btnResponse);}if(shouldClose){that.close();}});this.$closeIcon.show();}else{this.$closeIcon.hide();}},setTitle:function(string,force){force=force||false;if(typeof string!=="undefined"){if(typeof string=="string"){this.title=string;}else{if(typeof string=="function"){if(typeof string.promise=="function"){console.error("Promise was returned from title function, this is not supported.");}var response=string();if(typeof response=="string"){this.title=response;}else{this.title=false;}}else{this.title=false;}}}if(this.isAjaxLoading&&!force){return;}this.$title.html(this.title||"");},setIcon:function(iconClass,force){force=force||false;if(typeof iconClass!=="undefined"){if(typeof iconClass=="string"){this.icon=iconClass;}else{if(typeof iconClass==="function"){var response=iconClass();if(typeof response=="string"){this.icon=response;}else{this.icon=false;}}else{this.icon=false;}}}if(this.isAjaxLoading&&!force){return;}this.$icon.html(this.icon?'':"");},setContentPrepend:function(string,force){this.contentParsed=string+this.contentParsed;if(this.isAjaxLoading&&!force){return;}this.$content.prepend(string);},setContentAppend:function(string,force){this.contentParsed=this.contentParsed+string;if(this.isAjaxLoading&&!force){return;}this.$content.append(string);},setContent:function(string,force){force=force||false;var that=this;this.contentParsed=(typeof string=="undefined")?this.contentParsed:string;if(this.isAjaxLoading&&!force){return;}this.$content.html(this.contentParsed);this.setDialogCenter();setTimeout(function(){that.$body.find("input[autofocus]:visible:first").focus();},100);},loadingSpinner:false,showLoading:function(disableButtons){this.loadingSpinner=true;this.$jconfirmBox.addClass("loading");if(disableButtons){this.$btnc.find("button").prop("disabled",true);}this.setDialogCenter();},hideLoading:function(enableButtons){this.loadingSpinner=false;this.$jconfirmBox.removeClass("loading");if(enableButtons){this.$btnc.find("button").prop("disabled",false);}this.setDialogCenter();},ajaxResponse:false,contentParsed:"",isAjax:false,isAjaxLoading:false,_parseContent:function(){var that=this;var e=" ";if(typeof this.content=="function"){var res=this.content.apply(this);if(typeof res=="string"){this.content=res;}else{if(typeof res=="object"&&typeof res.always=="function"){this.isAjax=true;this.isAjaxLoading=true;res.always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded=="function"){that.contentLoaded(data,status,xhr);}});this.content=e;}else{this.content=e;}}}if(typeof this.content=="string"&&this.content.substr(0,4).toLowerCase()==="url:"){this.isAjax=true;this.isAjaxLoading=true;var u=this.content.substring(4,this.content.length);$.get(u).done(function(html){that.contentParsed=html;}).always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded=="function"){that.contentLoaded(data,status,xhr);}});}if(!this.content){this.content=e;}if(!this.isAjax){this.contentParsed=this.content;this.setContent(this.contentParsed);that._contentReady.resolve();}},_stopCountDown:function(){clearInterval(this.autoCloseInterval);if(this.$cd){this.$cd.remove();}},_startCountDown:function(){var that=this;var opt=this.autoClose.split("|");if(opt.length!==2){console.error("Invalid option for autoClose. example 'close|10000'");return false;}var button_key=opt[0];var time=parseInt(opt[1]);if(typeof this.buttons[button_key]==="undefined"){console.error("Invalid button key '"+button_key+"' for autoClose");return false;}var seconds=Math.ceil(time/1000);this.$cd=$(' ('+seconds+")").appendTo(this["$_"+button_key]);this.autoCloseInterval=setInterval(function(){that.$cd.html(" ("+(seconds-=1)+") ");if(seconds<=0){that["$$"+button_key].trigger("click");that._stopCountDown();}},1000);},_getKey:function(key){switch(key){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space";}var initial=String.fromCharCode(key);if(/^[A-z0-9]+$/.test(initial)){return initial.toLowerCase();}else{return false;}},reactOnKey:function(e){var that=this;var a=$(".jconfirm");if(a.eq(a.length-1)[0]!==this.$el[0]){return false;}var key=e.which;if(this.$content.find(":input").is(":focus")&&/13|32/.test(key)){return false;}var keyChar=this._getKey(key);if(keyChar==="esc"&&this.escapeKey){if(this.escapeKey===true){this.$scrollPane.trigger("click");}else{if(typeof this.escapeKey==="string"||typeof this.escapeKey==="function"){var buttonKey;if(typeof this.escapeKey==="function"){buttonKey=this.escapeKey();}else{buttonKey=this.escapeKey;}if(buttonKey){if(typeof this.buttons[buttonKey]==="undefined"){console.warn("Invalid escapeKey, no buttons found with key "+buttonKey);}else{this["$_"+buttonKey].trigger("click");}}}}}$.each(this.buttons,function(key,button){if(button.keys.indexOf(keyChar)!=-1){that["$_"+key].trigger("click");}});},_boxTopMargin:0,_boxBottomMargin:0,_boxWidth:0,setDialogCenter:function(){var contentHeight;var paneHeight;var style;contentHeight=0;paneHeight=0;if(this.$contentPane.css("display")!="none"){contentHeight=this.$content.outerHeight()||0;paneHeight=this.$contentPane.height()||0;}var children=this.$content.children();if(children.length!=0){var marginTopChild=parseInt(children.eq(0).css("margin-top"));if(marginTopChild){contentHeight+=marginTopChild;}}if(paneHeight==0){paneHeight=contentHeight;}var windowHeight=$(window).height();var boxHeight;boxHeight=(this.$body.outerHeight()-paneHeight)+contentHeight;var topMargin=(windowHeight-boxHeight)/2;if(boxHeight>(windowHeight-(this.offsetTop+this.offsetBottom))||!this.alignMiddle){style={"margin-top":this.offsetTop,"margin-bottom":this.offsetBottom};this._boxTopMargin=this.offsetTop;this._boxBottomMargin=this.offsetBottom;$("body").addClass("jconfirm-no-scroll-"+this._id);}else{style={"margin-top":topMargin,"margin-bottom":this.offsetBottom};this._boxTopMargin=topMargin;this._boxBottomMargin=this.offsetBottom;$("body").removeClass("jconfirm-no-scroll-"+this._id);}this.$contentPane.css({height:contentHeight}).scrollTop(0);this.$body.css(style);this.setDrag();},_unwatchContent:function(){clearInterval(this._timer);},close:function(){var that=this;if(typeof this.onClose==="function"){this.onClose();}this._unwatchContent();clearInterval(this.imageLoadInterval);$(window).unbind("resize."+this._id);$(window).unbind("keyup."+this._id);$(window).unbind("jcKeyDown."+this._id);if(this.draggable){$(window).unbind("mousemove."+this._id);$(window).unbind("mouseup."+this._id);this.$titleContainer.unbind("mousedown");}$("body").removeClass("jconfirm-no-scroll-"+this._id);this.$body.addClass(this.closeAnimationParsed);this.$jconfirmBg.addClass("jconfirm-bg-h");var closeTimer=(this.closeAnimation=="none")?1:this.animationSpeed;that.$el.removeClass(that.loadedClass);setTimeout(function(){that.$el.remove();var l=jconfirm.instances;var i=jconfirm.instances.length-1;for(i;i>=0;i--){if(jconfirm.instances[i]._id==that._id){jconfirm.instances.splice(i,1);}}if(!jconfirm.instances.length){if(that.scrollToPreviousElement&&jconfirm.lastFocused&&jconfirm.lastFocused.length&&$.contains(document,jconfirm.lastFocused[0])){var $lf=jconfirm.lastFocused;if(that.scrollToPreviousElementAnimate){var st=$(window).scrollTop();var ot=jconfirm.lastFocused.offset().top;var wh=$(window).height();if(!(ot>st&&ot<(st+wh))){var scrollTo=(ot-Math.round((wh/3)));$("html, body").animate({scrollTop:scrollTo},that.animationSpeed,"swing",function(){$lf.focus();});}else{$lf.focus();}}else{$lf.focus();}jconfirm.lastFocused=false;}}if(typeof that.onDestroy=="function"){that.onDestroy();}},closeTimer*0.4);return true;},open:function(){if(this.isOpen()){return false;}this._buildHTML();this._bindEvents();this._open();return true;},_open:function(){var that=this;if(typeof that.onOpenBefore=="function"){that.onOpenBefore();}this.$body.removeClass(this.animationParsed);this.$jconfirmBg.removeClass("jconfirm-bg-h");this.$body.focus();setTimeout(function(){that.$body.css(that._getCSS(that.animationSpeed,1));that.$body.css({"transition-property":that.$body.css("transition-property")+", margin"});that._modalReady.resolve();if(typeof that.onOpen==="function"){that.onOpen();}that.$el.addClass(that.loadedClass);},this.animationSpeed);},loadedClass:"jconfirm-open",isClosed:function(){return !this.$el||this.$el.css("display")==="";},isOpen:function(){return !this.isClosed();},toggle:function(){if(!this.isOpen()){this.open();}else{this.close();}}};jconfirm.instances=[];jconfirm.lastFocused=false;jconfirm.pluginDefaults={template:'
',title:"Hello",titleClass:"",type:"default",typeAnimated:true,draggable:false,alignMiddle:true,content:"Are you sure to continue?",buttons:{},defaultButtons:{ok:{action:function(){}},close:{action:function(){}}},contentLoaded:function(){},icon:"",lazyOpen:false,bgOpacity:null,theme:"light",animation:"zoom",closeAnimation:"scale",animationSpeed:400,animationBounce:1.2,escapeKey:true,rtl:false,container:"body",containerFluid:false,backgroundDismiss:false,backgroundDismissAnimation:"shake",autoClose:false,closeIcon:null,closeIconClass:false,watchInterval:100,columnClass:"col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",boxWidth:"50%",scrollToPreviousElement:true,scrollToPreviousElementAnimate:true,useBootstrap:true,offsetTop:50,offsetBottom:50,dragWindowGap:15,bootstrapClasses:{container:"container",containerFluid:"container-fluid",row:"row"},onContentReady:function(){},onOpenBefore:function(){},onOpen:function(){},onClose:function(){},onDestroy:function(){},onAction:function(){}};var keyDown=false;$(window).on("keydown",function(e){if(!keyDown){var $target=$(e.target);var pass=false;if($target.closest(".jconfirm-box").length){pass=true;}if(pass){$(window).trigger("jcKeyDown");}keyDown=true;}});$(window).on("keyup",function(e){keyDown=false;});})(jQuery,window); \ No newline at end of file diff --git a/app/assets/stylesheets/jquery-confirm.scss b/app/assets/stylesheets/jquery-confirm.scss new file mode 100644 index 00000000..3c16dc8d --- /dev/null +++ b/app/assets/stylesheets/jquery-confirm.scss @@ -0,0 +1,10 @@ +/*! + * jquery-confirm v3.2.3 (http://craftpip.github.io/jquery-confirm/) + * Author: boniface pereira + * Website: www.craftpip.com + * Contact: hey@craftpip.com + * + * Copyright 2013-2017 jquery-confirm + * Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE) + */@-webkit-keyframes + jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}body[class*=jconfirm-no-scroll-]{overflow:hidden!important}.jconfirm{position:fixed;top:0;left:0;right:0;bottom:0;z-index:99999999;font-family:inherit;overflow:hidden}.jconfirm .jconfirm-bg{position:fixed;top:0;left:0;right:0;bottom:0;-webkit-transition:opacity .4s;transition:opacity .4s}.jconfirm .jconfirm-bg.jconfirm-bg-h{opacity:0!important}.jconfirm .jconfirm-scrollpane{position:fixed;top:0;left:0;right:0;bottom:0;overflow-y:auto;-webkit-perspective:500px;perspective:500px;-webkit-perspective-origin:center;perspective-origin:center}.jconfirm .jconfirm-box{background:white;border-radius:4px;position:relative;outline:0;padding:15px 15px 0;overflow:hidden;margin-left:auto;margin-right:auto}@-webkit-keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@-webkit-keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@-webkit-keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@-webkit-keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@-webkit-keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@-webkit-keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}@keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}.jconfirm .jconfirm-box.jconfirm-type-animated{-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.jconfirm .jconfirm-box.jconfirm-type-blue{border-top:solid 7px #3498db;-webkit-animation-name:type-blue;animation-name:type-blue}.jconfirm .jconfirm-box.jconfirm-type-green{border-top:solid 7px #2ecc71;-webkit-animation-name:type-green;animation-name:type-green}.jconfirm .jconfirm-box.jconfirm-type-red{border-top:solid 7px #e74c3c;-webkit-animation-name:type-red;animation-name:type-red}.jconfirm .jconfirm-box.jconfirm-type-orange{border-top:solid 7px #f1c40f;-webkit-animation-name:type-orange;animation-name:type-orange}.jconfirm .jconfirm-box.jconfirm-type-purple{border-top:solid 7px #9b59b6;-webkit-animation-name:type-purple;animation-name:type-purple}.jconfirm .jconfirm-box.jconfirm-type-dark{border-top:solid 7px #34495e;-webkit-animation-name:type-dark;animation-name:type-dark}.jconfirm .jconfirm-box.loading{height:120px}.jconfirm .jconfirm-box.loading:before{content:'';position:absolute;left:0;background:white;right:0;top:0;bottom:0;border-radius:10px;z-index:1}.jconfirm .jconfirm-box.loading:after{opacity:.6;content:'';height:30px;width:30px;border:solid 3px transparent;position:absolute;left:50%;margin-left:-15px;border-radius:50%;-webkit-animation:jconfirm-spin 1s infinite linear;animation:jconfirm-spin 1s infinite linear;border-bottom-color:dodgerblue;top:50%;margin-top:-15px;z-index:2}.jconfirm .jconfirm-box div.jconfirm-closeIcon{height:20px;width:20px;position:absolute;top:5px;right:5px;cursor:pointer;opacity:.6;text-align:center;-webkit-transition:opacity .3s ease-in;transition:opacity .3s ease-in;font-size:27px!important;line-height:14px!important;display:none}.jconfirm .jconfirm-box div.jconfirm-closeIcon:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-closeIcon .fa{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .glyphicon{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .zmdi{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon:hover{opacity:1}.jconfirm .jconfirm-box div.jconfirm-title-c{display:block;font-size:22px;line-height:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.jconfirm .jconfirm-box div.jconfirm-title-c.jconfirm-hand{cursor:move}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{font-size:inherit;padding-bottom:15px;display:inline-block;vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i{vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:inherit;font-family:inherit;display:inline-block;vertical-align:middle;padding-bottom:15px}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-content-pane{margin-bottom:15px;height:auto;-webkit-transition:height .4s ease-in;transition:height .4s ease-in;display:inline-block;width:100%;position:relative;overflow:hidden}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content img{max-width:100%;height:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content:empty{display:none}.jconfirm .jconfirm-box .jconfirm-buttons{padding-bottom:11px}.jconfirm .jconfirm-box .jconfirm-buttons>button{margin-bottom:4px;margin-left:2px;margin-right:2px}.jconfirm .jconfirm-box .jconfirm-buttons button{display:inline-block;padding:6px 12px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;border-radius:4px;min-height:1em;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;-webkit-tap-highlight-color:transparent;border:0;background-image:none}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue{background-color:#3498db;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue:hover{background-color:#2980b9;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green{background-color:#2ecc71;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green:hover{background-color:#27ae60;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red{background-color:#e74c3c;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red:hover{background-color:#c0392b;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange{background-color:#f1c40f;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange:hover{background-color:#f39c12;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default{background-color:#ecf0f1;color:#000;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default:hover{background-color:#bdc3c7;color:#000}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple{background-color:#9b59b6;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple:hover{background-color:#8e44ad;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark{background-color:#34495e;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark:hover{background-color:#2c3e50;color:#FFF}.jconfirm .jconfirm-box.jconfirm-type-red .jconfirm-title-c .jconfirm-icon-c{color:#e74c3c!important}.jconfirm .jconfirm-box.jconfirm-type-blue .jconfirm-title-c .jconfirm-icon-c{color:#3498db!important}.jconfirm .jconfirm-box.jconfirm-type-green .jconfirm-title-c .jconfirm-icon-c{color:#2ecc71!important}.jconfirm .jconfirm-box.jconfirm-type-purple .jconfirm-title-c .jconfirm-icon-c{color:#9b59b6!important}.jconfirm .jconfirm-box.jconfirm-type-orange .jconfirm-title-c .jconfirm-icon-c{color:#f1c40f!important}.jconfirm .jconfirm-box.jconfirm-type-dark .jconfirm-title-c .jconfirm-icon-c{color:#34495e!important}.jconfirm .jconfirm-clear{clear:both}.jconfirm.jconfirm-rtl{direction:rtl}.jconfirm.jconfirm-rtl div.jconfirm-closeIcon{left:5px;right:auto}.jconfirm.jconfirm-white .jconfirm-bg,.jconfirm.jconfirm-light .jconfirm-bg{background-color:#444;opacity:.2}.jconfirm.jconfirm-white .jconfirm-box,.jconfirm.jconfirm-light .jconfirm-box{box-shadow:0 2px 6px rgba(0,0,0,0.2);border-radius:5px}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default{box-shadow:none;color:#333}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#ddd}.jconfirm.jconfirm-white.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-black .jconfirm-bg,.jconfirm.jconfirm-dark .jconfirm-bg{background-color:darkslategray;opacity:.4}.jconfirm.jconfirm-black .jconfirm-box,.jconfirm.jconfirm-dark .jconfirm-box{box-shadow:0 2px 6px rgba(0,0,0,0.2);background:#444;border-radius:5px;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button{border:0;background-image:none;text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none;-webkit-transition:background .1s;transition:background .1s;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default{box-shadow:none;color:#fff;background:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#666}.jconfirm.jconfirm-black.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-shake{-webkit-animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-glow{-webkit-animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@-webkit-keyframes glow{0%,100%{box-shadow:0 0 3px red}50%{box-shadow:0 0 30px red}}@keyframes glow{0%,100%{box-shadow:0 0 3px red}50%{box-shadow:0 0 30px red}}.jconfirm{-webkit-perspective:400px;perspective:400px}.jconfirm .jconfirm-box{opacity:1;-webkit-transition-property:all;transition-property:all}.jconfirm .jconfirm-box.jconfirm-animation-top,.jconfirm .jconfirm-box.jconfirm-animation-left,.jconfirm .jconfirm-box.jconfirm-animation-right,.jconfirm .jconfirm-box.jconfirm-animation-bottom,.jconfirm .jconfirm-box.jconfirm-animation-opacity,.jconfirm .jconfirm-box.jconfirm-animation-zoom,.jconfirm .jconfirm-box.jconfirm-animation-scale,.jconfirm .jconfirm-box.jconfirm-animation-none,.jconfirm .jconfirm-box.jconfirm-animation-rotate,.jconfirm .jconfirm-box.jconfirm-animation-rotatex,.jconfirm .jconfirm-box.jconfirm-animation-rotatey,.jconfirm .jconfirm-box.jconfirm-animation-scaley,.jconfirm .jconfirm-box.jconfirm-animation-scalex{opacity:0}.jconfirm .jconfirm-box.jconfirm-animation-rotate{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.jconfirm .jconfirm-box.jconfirm-animation-rotatex{-webkit-transform:rotateX(90deg);transform:rotateX(90deg);-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatexr{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatey{-webkit-transform:rotatey(90deg);-ms-transform:rotatey(90deg);transform:rotatey(90deg);-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotateyr{-webkit-transform:rotatey(-90deg);-ms-transform:rotatey(-90deg);transform:rotatey(-90deg);-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scaley{-webkit-transform:scaley(1.5);-ms-transform:scaley(1.5);transform:scaley(1.5);-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scalex{-webkit-transform:scalex(1.5);-ms-transform:scalex(1.5);transform:scalex(1.5);-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-top{-webkit-transform:translate(0px,-100px);-ms-transform:translate(0px,-100px);transform:translate(0px,-100px)}.jconfirm .jconfirm-box.jconfirm-animation-left{-webkit-transform:translate(-100px,0px);-ms-transform:translate(-100px,0px);transform:translate(-100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-right{-webkit-transform:translate(100px,0px);-ms-transform:translate(100px,0px);transform:translate(100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-bottom{-webkit-transform:translate(0px,100px);-ms-transform:translate(0px,100px);transform:translate(0px,100px)}.jconfirm .jconfirm-box.jconfirm-animation-zoom{-webkit-transform:scale(1.2);-ms-transform:scale(1.2);transform:scale(1.2)}.jconfirm .jconfirm-box.jconfirm-animation-scale{-webkit-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5)}.jconfirm .jconfirm-box.jconfirm-animation-none{visibility:hidden}.jconfirm.jconfirm-supervan .jconfirm-bg{background-color:rgba(54,70,93,0.95)}.jconfirm.jconfirm-supervan .jconfirm-box{background-color:transparent}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-blue{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-green{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-red{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-orange{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-purple{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-dark{border:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-closeIcon{color:white}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c{text-align:center;color:white;font-size:28px;font-weight:normal}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c>*{padding-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content-pane{margin-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content{text-align:center;color:white}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons button{font-size:16px;border-radius:2px;background:#303f53;text-shadow:none;border:0;color:white;padding:10px;min-width:100px}.jconfirm.jconfirm-supervan.jconfirm-rtl .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-material .jconfirm-bg{background-color:rgba(0,0,0,0.67)}.jconfirm.jconfirm-material .jconfirm-box{background-color:white;box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 25px 10px 25px}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons{text-align:right}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-weight:500}.jconfirm.jconfirm-material.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-bootstrap .jconfirm-bg{background-color:rgba(0,0,0,0.21)}.jconfirm.jconfirm-bootstrap .jconfirm-box{background-color:white;box-shadow:0 3px 8px 0 rgba(0,0,0,0.2);border:solid 1px rgba(0,0,0,0.4);padding:15px 0 0}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold;padding-left:15px;padding-right:15px}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87);padding:0 15px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons{text-align:right;padding:10px;margin:-5px 0 0;border-top:solid 1px #ddd;overflow:hidden;border-radius:0 0 4px 4px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons button{font-weight:500}.jconfirm.jconfirm-bootstrap.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-modern .jconfirm-bg{background-color:slategray;opacity:.6}.jconfirm.jconfirm-modern .jconfirm-box{background-color:white;box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 30px 15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87);top:15px;right:15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:24px;font-weight:bold;text-align:center;margin-bottom:10px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{-webkit-transition:-webkit-transform .5s;transition:transform .5s;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);display:block;margin-right:0;margin-left:0;margin-bottom:10px;font-size:69px;color:#aaa}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-content{text-align:center;font-size:15px;color:#777;margin-bottom:25px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button{font-weight:bold;text-transform:uppercase;-webkit-transition:background .1s;transition:background .1s;padding:10px 20px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button+button{margin-left:4px}.jconfirm.jconfirm-modern.jconfirm-open .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)} \ No newline at end of file diff --git a/app/views/crm/dining_queues/assign.html.erb b/app/views/crm/dining_queues/assign.html.erb index 94fdc339..9310844b 100644 --- a/app/views/crm/dining_queues/assign.html.erb +++ b/app/views/crm/dining_queues/assign.html.erb @@ -41,8 +41,8 @@
- - +