diff --git a/Gemfile b/Gemfile index 227cfa72..22275707 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem 'rails', '~> 5.1.0' gem 'mysql2', '>= 0.3.18', '< 0.5' #Use PosgreSQL -gem 'pg' +# gem 'pg' # redis server for cable # gem 'redis', '~> 3.0' diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index 87121ea3..4c8300e2 100644 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -111,8 +111,9 @@ $(document).ready(function(){ // Print Order Item $('#print_order_item').on('click',function(){ - var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text(); - var params = { 'id':assigned_item_id }; + var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text(); + var options = $('.selected-item').children('.card-block').find('.item-options').text(); + var params = { 'options':options }; $.ajax({ type: 'GET', url: '/oqs/print/print/'+assigned_item_id, diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 6b350bf1..2670dcc4 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -179,3 +179,11 @@ select.form-control { tr.discount-item-row:hover { background-color: #e3e3e3 !important; } +.required abbr{ + color: red !important; +} +/* Jquery Confirm */ + +.jconfirm-box-container{ + margin-left:-40px !important +} \ No newline at end of file diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 646f6475..17012ad1 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -46,7 +46,7 @@ class Crm::CustomersController < BaseCrmController end #get customer amount - @customer = Customer.find(params[:id]) + @customer = Customer.find(params[:id]) @response = Customer.get_membership_transactions(@customer) #end customer amount @@ -93,7 +93,8 @@ class Crm::CustomersController < BaseCrmController :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json' - } + }, + :timeout => 10 ) rescue Net::OpenTimeout response = { status: false } @@ -163,7 +164,8 @@ end :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json' - } + }, + :timeout => 10 ) rescue Net::OpenTimeout response = { status: false } @@ -201,6 +203,6 @@ end def customer_params params.require(:customer).permit(:name, :company, :contact_no, :email, - :date_of_birth,:salution,:gender,:nrc_no,:address,:card_no) + :date_of_birth,:salutation,:gender,:nrc_no,:address,:card_no) end end diff --git a/app/controllers/oqs/home_controller.rb b/app/controllers/oqs/home_controller.rb index b4d564f2..18971247 100644 --- a/app/controllers/oqs/home_controller.rb +++ b/app/controllers/oqs/home_controller.rb @@ -2,8 +2,10 @@ class Oqs::HomeController < BaseOqsController def index queue_stations=OrderQueueStation.all + # Query for OQS with delivery status false @queue_items_details = queue_items_query(false) + # Query for OQS with delivery status true @queue_completed_item = queue_items_query(true) @queue_stations_items=Array.new @@ -79,29 +81,17 @@ class Oqs::HomeController < BaseOqsController render :json => removed_item.to_json end - # Query for OQS with status - def queue_items_query(status) - puts status - puts "put what is status" - # AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at") - # .joins(" left join order_queue_process_by_zones as oqpz ON oqpz.order_queue_station_id = assigned_order_items.order_queue_station_id - # left join dining_facilities as df on df.zone_id = oqpz.zone_id - # left join order_queue_stations as oqs ON oqs.id = assigned_order_items.order_queue_station_id - # left join orders as od ON od.order_id = assigned_order_items.order_id - # left join order_items as odt ON odt.item_code = assigned_order_items.item_code - # left join customers as cus ON cus.customer_id = od.customer_id") - # .where("assigned_order_items.delivery_status = #{status}") - # .group("assigned_order_items.assigned_order_item_id") - # .order("odt.item_name DESC") - AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, cus.name as customer_name, odt.created_at") + # Query for OQS with delivery status + def queue_items_query(status) + AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.station_name, oqs.is_active, df.name as zone, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at") .joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id left join orders as od ON od.order_id = assigned_order_items.order_id - left join order_items as odt ON odt.item_code = assigned_order_items.item_code + left join order_items as odt ON odt.item_code = assigned_order_items.item_code AND odt.order_id = assigned_order_items.order_id left join customers as cus ON cus.customer_id = od.customer_id left join booking_orders as bo on bo.order_id = assigned_order_items.order_id left join bookings as bk on bk.booking_id = bo.booking_id left join dining_facilities as df on df.id = bk.dining_facility_id") .where("assigned_order_items.delivery_status = #{status}") - .group("assigned_order_items.assigned_order_item_id,oqs.station_name,oqs.is_active,df.name,odt.item_code,odt.item_name,odt.price, odt.qty, odt.item_order_by,cus.name,odt.created_at") + .group("odt.order_items_id") end end diff --git a/app/controllers/oqs/print_controller.rb b/app/controllers/oqs/print_controller.rb index ff2cf98d..f3fd5675 100644 --- a/app/controllers/oqs/print_controller.rb +++ b/app/controllers/oqs/print_controller.rb @@ -2,9 +2,10 @@ class Oqs::PrintController < ApplicationController # Print Order Item def print unique_code="OrderItemPdf" - assigned_item_id=params[:id] - assigned_item=AssignedOrderItem.find(assigned_item_id) - assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'"); + assigned_item_id = params[:id] + options = params[:options] + assigned_item = AssignedOrderItem.find(assigned_item_id) + assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'"); # order queue stations oqs = assigned_item.order_queue_station @@ -13,9 +14,9 @@ class Oqs::PrintController < ApplicationController print_status = assigned_item.print_status == true ? " (Re-Print)" : "" # print when complete click - print_settings=PrintSetting.find_by_unique_code(unique_code) - order_queue_printer= Printer::OrderQueuePrinter.new(print_settings) - order_queue_printer.print_order_item(oqs, assigned_item.order_id, assigned_item.item_code, print_status ) + print_settings = PrintSetting.find_by_unique_code(unique_code) + order_queue_printer = Printer::OrderQueuePrinter.new(print_settings) + order_queue_printer.print_order_item(oqs, assigned_item.order_id, assigned_item.item_code, print_status, options ) # update print status for completed same order items assigned_items.each do |ai| @@ -27,10 +28,10 @@ class Oqs::PrintController < ApplicationController # Print Order Details with booking id def print_order_summary unique_code="OrderSummaryPdf" - assigned_item_id=params[:id] - table_name=params[:table_name] - assigned_item=AssignedOrderItem.find(assigned_item_id) - assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'"); + assigned_item_id = params[:id] + table_name = params[:table_name] + assigned_item = AssignedOrderItem.find(assigned_item_id) + assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'"); # order queue stations oqs = assigned_item.order_queue_station @@ -43,13 +44,13 @@ class Oqs::PrintController < ApplicationController booking = Booking.find_by_dining_facility_id(dining.id) # print when complete click - print_settings=PrintSetting.find_by_unique_code(unique_code) - order_queue_printer= Printer::OrderQueuePrinter.new(print_settings) + print_settings = PrintSetting.find_by_unique_code(unique_code) + order_queue_printer = Printer::OrderQueuePrinter.new(print_settings) order_queue_printer.print_booking_summary(oqs, booking.booking_id, print_status) # update print status for completed same order items assigned_items.each do |ai| - ai.print_status=true + ai.print_status = true ai.save end end diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb index 601055e5..373dc2f5 100644 --- a/app/controllers/origami/customers_controller.rb +++ b/app/controllers/origami/customers_controller.rb @@ -39,5 +39,29 @@ class Origami::CustomersController < BaseOrigamiController end end + def update_sale_by_customer + + id = params[:sale_id][0,3] + if(id == "SAL") + sale = Sale.find(params[:sale_id]) + status = sale.update_attributes(customer_id: params[:customer_id]) + else + @booking = BookingOrder.find_by_order_id(params[:sale_id]) + @orders = BookingOrder.where("booking_id = ? ", @booking.booking_id) + + @orders.each do |bo| + order = Order.find(bo.order_id) + status = order.update_attributes(customer_id: params[:customer_id]) + end + + end + + if status == true + render json: JSON.generate({:status => true}) + else + render json: JSON.generate({:status => false, :error_message => "Record not found"}) + end + end + end diff --git a/app/controllers/origami/redeem_payments_controller.rb b/app/controllers/origami/redeem_payments_controller.rb index 792cb7a4..802ba51b 100644 --- a/app/controllers/origami/redeem_payments_controller.rb +++ b/app/controllers/origami/redeem_payments_controller.rb @@ -6,8 +6,24 @@ class Origami::RedeemPaymentsController < BaseOrigamiController sale_data = Sale.find_by_sale_id(@sale_id) # limit redeem_amount - rebate_prices = SaleItem.calculate_food_beverage(sale_data.sale_items) - nonrebate_prices = sale_data.total_amount - rebate_prices + # rebate_prices = SaleItem.calculate_food_beverage(sale_data.sale_items) + # nonrebate_prices = sale_data.total_amount - rebate_prices + # @payparcount = 0 + # others = 0 + # sale_data.sale_payments.each do |sale_payment| + # if sale_payment.payment_method == "paypar" + # @payparcount = @payparcount + sale_payment.payment_amount + # else + # others = others + sale_payment.payment_amount + # end + # end + # non_rebate_exceed = others - (nonrebate_prices + sale_data.total_tax) + # if non_rebate_exceed < 0 + # @redeem_prices = rebate_prices - @payparcount + # else + # @redeem_prices = rebate_prices - @payparcount -non_rebate_exceed + # end + @payparcount = 0 others = 0 sale_data.sale_payments.each do |sale_payment| @@ -17,12 +33,8 @@ class Origami::RedeemPaymentsController < BaseOrigamiController others = others + sale_payment.payment_amount end end - non_rebate_exceed = others - (nonrebate_prices + sale_data.total_tax) - if non_rebate_exceed < 0 - @redeem_prices = rebate_prices - @payparcount - else - @redeem_prices = rebate_prices - @payparcount -non_rebate_exceed - end + @redeem_prices = sale_data.grand_total - @payparcount -others + if sale_data if sale_data.customer_id diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 37eef687..93453ffc 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -22,7 +22,7 @@ class Origami::RequestBillsController < BaseOrigamiController unique_code = "ReceiptBillPdf" # customer= Customer.where('customer_id=' +.customer_id) - customer= Customer.find( @sale_data.customer_id) + customer= Customer.find(@sale_data.customer_id) # get member information member_info = Customer.get_member_account(customer) # get printer info diff --git a/app/controllers/reports/daily_sale_controller.rb b/app/controllers/reports/daily_sale_controller.rb index 6e1eb85a..ba453f55 100644 --- a/app/controllers/reports/daily_sale_controller.rb +++ b/app/controllers/reports/daily_sale_controller.rb @@ -4,6 +4,10 @@ class Reports::DailySaleController < BaseReportController from, to ,report_type = get_date_range_from_params @sale_data = Sale.daily_sales_list(from,to) @tax = SaleTax.get_tax(from,to) + respond_to do |format| + format.html + format.xls + end end def show diff --git a/app/controllers/reports/receipt_no_controller.rb b/app/controllers/reports/receipt_no_controller.rb index 86c8d981..d85c7d57 100644 --- a/app/controllers/reports/receipt_no_controller.rb +++ b/app/controllers/reports/receipt_no_controller.rb @@ -8,6 +8,10 @@ class Reports::ReceiptNoController < BaseReportController puts to @sale_data = Sale.get_receipt_no_list(from,to) @sale_data = Kaminari.paginate_array(@sale_data).page(params[:page]).per(50) + respond_to do |format| + format.html + format.xls + end end def show diff --git a/app/controllers/reports/sale_item_controller.rb b/app/controllers/reports/sale_item_controller.rb index 1da31aff..eb7d3b86 100644 --- a/app/controllers/reports/sale_item_controller.rb +++ b/app/controllers/reports/sale_item_controller.rb @@ -5,6 +5,11 @@ class Reports::SaleItemController < BaseReportController 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) + + respond_to do |format| + format.html + format.xls + end end def show diff --git a/app/models/printer/order_queue_printer.rb b/app/models/printer/order_queue_printer.rb index 63666a68..f8fb5027 100644 --- a/app/models/printer/order_queue_printer.rb +++ b/app/models/printer/order_queue_printer.rb @@ -1,13 +1,13 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker - def print_order_item(oqs,order_id, item_code, print_status) + def print_order_item(oqs,order_id, item_code, print_status, options="") #Use CUPS service #Generate PDF #Print order_item = print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code) filename = "tmp/order_item_#{order_item[0].item_name}" + ".pdf" - pdf = OrderItemPdf.new(order_item[0], print_status) + pdf = OrderItemPdf.new(order_item[0], print_status, options) pdf.render_file filename if oqs.print_copy @@ -31,7 +31,9 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker if oqs.cut_per_item order.each do|odi| filename = "tmp/order_item_#{odi.item_name}" + ".pdf" - pdf = OrderItemPdf.new(odi, print_status) + # For Item Options + options = odi.options == "[]"? "" : odi.options + pdf = OrderItemPdf.new(odi, print_status, options) # pdf.render_file "tmp/order_item.pdf" pdf.render_file filename if oqs.print_copy @@ -65,7 +67,10 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker if oqs.cut_per_item order.each do|odi| filename = "tmp/order_item_#{odi.item_name}" + ".pdf" - pdf = OrderItemPdf.new(odi, print_status) + # For Item Options + options = odi.options == "[]"? "" : odi.options + pdf = OrderItemPdf.new(odi, print_status, options) + pdf.render_file filename if oqs.print_copy @@ -98,7 +103,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker # Query for OQS with status def print_query(type, id) if type == "order_item" - OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining") + OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining") .joins("left join orders ON orders.order_id = order_items.order_id left join booking_orders AS bo ON bo.order_id=order_items.order_id left join bookings AS b ON b.booking_id = bo.booking_id @@ -107,16 +112,17 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker .where("order_items.item_code = '#{ id }'") .group("order_items.item_code") elsif type == "order_summary" - OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining") + OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining") .joins("left join orders ON orders.order_id = order_items.order_id left join booking_orders AS bo ON bo.order_id=order_items.order_id left join bookings AS b ON b.booking_id = bo.booking_id left join dining_facilities AS df ON df.id = b.dining_facility_id left join customers as cus ON cus.customer_id = orders.customer_id") .where("orders.order_id = '#{ id }'") + .group("order_items.order_items_id") else # order summary for booking - OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining") + OrderItem.select("order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.name as dining") .joins("left join orders ON orders.order_id = order_items.order_id left join booking_orders AS bo ON bo.order_id=order_items.order_id left join bookings AS b ON b.booking_id = bo.booking_id diff --git a/app/models/sale.rb b/app/models/sale.rb index 6b02e4c8..f79d8642 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -15,7 +15,7 @@ class Sale < ApplicationRecord has_many :bookings scope :open_invoices, -> { where("sale_status = 'new' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") } - scope :complete_sale, -> { where("sale_status = 'completed' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") } + scope :complete_sale, -> { where("sale_status = 'completed' and receipt_date BETWEEN '#{DateTime.now.utc.beginning_of_day}' AND '#{DateTime.now.utc.end_of_day}'") } REPORT_TYPE = { "daily" => 0, diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index e5c5395f..749a8a16 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -1,6 +1,6 @@ class OrderItemPdf < Prawn::Document attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width - def initialize(order_item, print_status) + def initialize(order_item, print_status, options) self.page_width = 210 self.page_height = 2500 self.margin = 5 @@ -29,7 +29,7 @@ class OrderItemPdf < Prawn::Document order_info(order_item.order_by,order_item.order_at) # order items - order_items(order_item) + order_items(order_item, options) end # Write Order Information to PDF @@ -52,23 +52,11 @@ class OrderItemPdf < Prawn::Document end # Write Order items to PDF - def order_items(order_item) + def order_items(order_item, options) y_position = cursor - # No Need for Order Item - # bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do - # text "Item", :size => self.item_font_size,:align => :left - # end - - # bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do - # text "Qty", :size => self.item_font_size,:align => :right - # end - - # stroke_horizontal_rule - # move_down 5 - #Add Order Item - add_order_items(order_item) + add_order_items(order_item, options) dash(1, :space => 1, :phase => 1) stroke_horizontal_line 0, (self.page_width - self.margin) @@ -76,7 +64,7 @@ class OrderItemPdf < Prawn::Document end # Add order items under order info - def add_order_items(order_item) + def add_order_items(order_item, options) y_position = cursor move_down 5 @@ -91,6 +79,14 @@ class OrderItemPdf < Prawn::Document move_down 5 + # add option + y_position = cursor + bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do + text "#{options}", :size => self.item_font_size,:align => :left + end + + move_down 5 + end end diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index a1459512..b9c1f6fe 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -92,6 +92,18 @@ class OrderSummaryPdf < Prawn::Document end move_down 5 + + # add option + options = odi.options == "[]"? "" : odi.options + + if options != "" + y_position = cursor + bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do + text "#{options}", :size => self.item_font_size,:align => :left + end + + move_down 5 + end end end diff --git a/app/views/api/customers/index.json.jbuilder b/app/views/api/customers/index.json.jbuilder index 2c3c07a7..0d1d37e7 100644 --- a/app/views/api/customers/index.json.jbuilder +++ b/app/views/api/customers/index.json.jbuilder @@ -1,3 +1,3 @@ -json.array! @customers, :id, :name, :company, :contact_no,:salution, +json.array! @customers, :id, :name, :company, :contact_no,:salutation, :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 db56961b..acf54ac1 100644 --- a/app/views/api/customers/show.json.jbuilder +++ b/app/views/api/customers/show.json.jbuilder @@ -1,4 +1,4 @@ -json.extract! @customer, :id, :name, :company, :contact_no,:salution, +json.extract! @customer, :id, :name, :company, :contact_no,:salutation, :gender,:nrc_no,:address,:card_no, :membership_type, :membership_id, :created_at json.invoices do diff --git a/app/views/crm/customers/_crm_customer.json.jbuilder b/app/views/crm/customers/_crm_customer.json.jbuilder index c80c1716..1b1b237e 100644 --- a/app/views/crm/customers/_crm_customer.json.jbuilder +++ b/app/views/crm/customers/_crm_customer.json.jbuilder @@ -1,2 +1,2 @@ -json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at +json.extract! crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, :created_at, :updated_at,:salutation, :gender,:nrc_no,:address,:card_no json.url crm_customer_url(crm_customer, format: :json) diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index e7b47460..3678008e 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -120,7 +120,7 @@ $(document).on('click',".customer_tr",function(){ $('#customer_company').val(data.company); $('#customer_contact_no').val(data.contact_no); $('#customer_email').val(data.email); - $('#customer_salution').val(data.salution); + $('#customer_salutation').val(data.salutation); $('#customer_nrc_no').val(data.nrc_no); $('#customer_card_no').val(data.card_no); $('#customer_address').val(data.address); @@ -133,11 +133,11 @@ $(document).on('click',".customer_tr",function(){ $('.female').prop( "checked", true ) } - if(data.salution == 'Mr') { + if(data.salutation == 'Mr') { $('.mr').prop( "checked", true ) - }else if(data.salution == 'Miss') { + }else if(data.salutation == 'Miss') { $('.miss').prop( "checked", true ) - }else if(data.salution == 'Mrs'){ + }else if(data.salutation == 'Mrs'){ $('.mrs').prop( "checked", true ) }else{ $('.mdm').prop( "checked", true ) diff --git a/app/views/crm/customers/show.json.jbuilder b/app/views/crm/customers/show.json.jbuilder index d41edb5d..86901801 100644 --- a/app/views/crm/customers/show.json.jbuilder +++ b/app/views/crm/customers/show.json.jbuilder @@ -1,5 +1,4 @@ json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth, :membership_id, :membership_type, :membership_authentication_code, - :created_at, :updated_at, - :salution, :gender,:nrc_no,:address,:card_no + :salutation, :gender,:nrc_no,:address,:card_no json.url crm_customer_url(@crm_customer, format: :json) diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 084ae8cf..85858a02 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -49,10 +49,9 @@ <%= qid.qty %> ] - + +
+
Order at
@@ -99,11 +98,10 @@
<%= qid.qty %>
]
-
-
+
+
+
+
Order at
diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb
index 3b192319..e862ea7f 100644
--- a/app/views/origami/customers/index.html.erb
+++ b/app/views/origami/customers/index.html.erb
@@ -75,7 +75,15 @@
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
-
+