diff --git a/Gemfile b/Gemfile index 02dca6af..7295ffab 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' @@ -93,4 +93,8 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'httparty', '~> 0.15.5' +# gem 'momentjs-rails', '>= 2.9.0' +# gem 'bootstrap-datepicker-rails' +# gem 'momentjs-rails', '>= 2.9.0' +# gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47' gem 'bootstrap-datepicker-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 4235d035..6a7c6340 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -110,7 +110,6 @@ GEM nokogiri (1.7.2) mini_portile2 (~> 2.1.0) pdf-core (0.7.0) - pg (0.20.0) prawn (2.2.2) pdf-core (~> 0.7.0) ttfunk (~> 1.5) @@ -247,7 +246,6 @@ DEPENDENCIES kaminari (~> 0.16.3) listen (~> 3.0.5) mysql2 (>= 0.3.18, < 0.5) - pg prawn prawn-table puma (~> 3.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8ff96589..59e4a386 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -17,5 +17,11 @@ //= require turbolinks //= require cable //= require settings/processing_items -//= require bootstrap-datepicker +//= require bootstrap-datepicker/core +//= require bootstrap-datepicker/locales/bootstrap-datepicker.es + +$(document).on("focus", "[data-behaviour~='datepicker']", function(e){ + $(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true}); + $('.dropdown-toggle').dropdown(); +}); diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js index 739aa5f0..ce5ac871 100644 --- a/app/assets/javascripts/cable.js +++ b/app/assets/javascripts/cable.js @@ -5,9 +5,10 @@ //= require_self //= require_tree ./channels -(function() { - this.App || (this.App = {}); +// Temp Disable +// (function() { +// this.App || (this.App = {}); - App.cable = ActionCable.createConsumer(); +// App.cable = ActionCable.createConsumer(); -}).call(this); +// }).call(this); diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index b3872b84..f1df9cf8 100644 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -28,7 +28,7 @@ $(document).ready(function(){ $("#order-Tax").text(''); $("#order-grand-total").text(''); - var zone_name=$(this).find(".orders-table").text(); + var zone_name=$(this).find(".orders-table").text(); var receipt_no=$(this).find(".orders-receipt-no").text(); var unique_id = $(this).find(".orders-id").text(); var order_status=$(this).find(".orders-order-status").text().trim(); @@ -38,11 +38,11 @@ $(document).ready(function(){ //for customer button $("#customer").removeAttr('disabled'); - + var customer_id=$(this).find(".customer-id").text(); show_customer_details(customer_id); - + var cashier=""; var receipt_date=""; @@ -60,7 +60,7 @@ $(document).ready(function(){ type: "POST", url: "/origami/" + unique_id, data: { 'booking_id' : unique_id }, - success:function(result){ + success:function(result){ for (i = 0; i < result.length; i++) { var data = JSON.stringify(result[i]); var parse_data = JSON.parse(data); @@ -77,7 +77,7 @@ $(document).ready(function(){ //Receipt Charges sub_total += (parse_data.qty*parse_data.price); - + discount_amount = parse_data.discount_amount == null? '0.0' : parse_data.discount_amount; tax_amount = parse_data.tax_amount; grand_total_amount = parse_data.grand_total_amount; @@ -186,7 +186,7 @@ $(document).ready(function(){ return false; }); - function show_customer_details(customer_id){ + function show_customer_details(customer_id){ if(window.location.pathname.substring(0, 12) == "/origami/SAL"){ var url = customer_id+"/get_customer/" @@ -218,7 +218,7 @@ $(document).ready(function(){ }); } }); - //End Ajax + //End Ajax } /* For Receipt - Calculate discount or tax */ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index d8101494..468ac33d 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -2,7 +2,7 @@ @import "bootstrap"; @import "font-awesome"; @import "theme"; -@import "bootstrap-datepicker3"; +@import 'bootstrap-datepicker'; /* Show it is fixed to the top */ // body { diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 5742c366..de526f81 100644 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -12,6 +12,7 @@ class Origami::HomeController < BaseOrigamiController @selected_item_type="Order" end end + puts params[:booking_id] @completed_orders = Order.get_completed_order() @booking_orders = Order.get_booking_order_table() diff --git a/app/controllers/origami/redeem_payments_controller.rb b/app/controllers/origami/redeem_payments_controller.rb index 0821a2d8..5fd386e8 100644 --- a/app/controllers/origami/redeem_payments_controller.rb +++ b/app/controllers/origami/redeem_payments_controller.rb @@ -16,7 +16,8 @@ class Origami::RedeemPaymentsController < BaseOrigamiController if member_actions.gateway_url @campaign_type_id = member_actions.additional_parameter["campaign_type_id"] url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s - membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id) + merchant_uid= member_actions.merchant_account_id + membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid) if membership_data["status"]==true @membership_rebate_balance=membership_data["balance"] @out = true, @membership_rebate_balance,@membership_id diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 4e884aaf..58ba0b11 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -30,7 +30,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) - redirect_to origami_path(sale_order.sale_id) + redirect_to origami_path(@sale_data.sale_id) end end diff --git a/app/controllers/reports/receipt_no_controller.rb b/app/controllers/reports/receipt_no_controller.rb index 05065fee..930659b9 100644 --- a/app/controllers/reports/receipt_no_controller.rb +++ b/app/controllers/reports/receipt_no_controller.rb @@ -1,9 +1,85 @@ -class Reports::ReceiptNoController < BaseReportController +class Reports::ReceiptNoController < ApplicationController + PERIOD = { + "today" => 0, + "yesterday" => 1, + "this_week" => 2, + "last_week" => 3, + "last_7" => 4, + "this_month" => 5, + "last_month" => 6, + "last_30" => 7, + "this_year" => 8, + "last_year" => 9 + } + def index - @hi = "hi" + from, to = get_date_range_from_params + puts "from..." + puts from + puts "to..." + puts to + @sale_data = Sale.get_receipt_no_list(from,to) + @sale_data = Kaminari.paginate_array(@sale_data).page(params[:page]).per(50) end def show + + end + private + def get_date_range_from_params + period_type = params[:period_type] + period = params[:period] + from = params[:from] + to = params[:to] + day_ref = Time.now + if period_type.to_i == 1 + if params[:from] && params[:to] + if params[:from] != "" && params[:to] !="" + from = DateTime.strptime(params[:from], "%m/%d/%Y") + to = DateTime.strptime(params[:to], "%m/%d/%Y") + else + from = day_ref.beginning_of_day.utc + to = day_ref.end_of_day.utc + end + end + else + case period.to_i + when PERIOD["today"] + + from = day_ref.beginning_of_day.utc + to = day_ref.end_of_day.utc + + when PERIOD["yesterday"] + from = (day_ref - 1.day).beginning_of_day.utc + to = (day_ref - 1.day).end_of_day.utc + + when PERIOD["this_week"] + from = Time.now.beginning_of_week.utc + to = Time.now.utc + when PERIOD["last_week"] + from = (day_ref - 7.day).beginning_of_week.utc + to = (day_ref - 7.day).end_of_week.utc + when PERIOD["last_7"] + from = (day_ref - 7.day).utc + to = Time.now.utc + when PERIOD["this_month"] + from = Time.now.beginning_of_month.utc + to = Time.now.utc + when PERIOD["last_month"] + from = (day_ref - 1.month).beginning_of_month.utc + to = (day_ref - 1.month).end_of_month.utc + when PERIOD["last_30"] + from = (day_ref - 30.day).utc + to = Time.now.utc + when PERIOD["this_year"] + from = Time.now.beginning_of_year.utc + to = Time.now.utc + when PERIOD["last_year"] + from = (day_ref - 1.year).beginning_of_year.utc + to = (day_ref - 1.year).end_of_year.utc + end + end + return from, to end end \ No newline at end of file diff --git a/app/models/order.rb b/app/models/order.rb index ff16cb94..5a4d6e2d 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -231,22 +231,33 @@ class Order < ApplicationRecord .joins("left join orders on orders.order_id = booking_orders.order_id") .joins("left join sales on sales.sale_id = bookings.sale_id") .where("booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true) - .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status") + .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id") end #Origami: Cashier : to view booking order Table def self.get_completed_order - completed_orders = Booking.select("sales.receipt_no,orders.status as order_status, - bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name") + completed_orders = Booking.select("sales.receipt_no,orders.status as order_status,orders.order_id, + bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id") .joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id") .joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id") .joins("left join orders on orders.order_id = booking_orders.order_id") .joins("left join sales on sales.sale_id = bookings.sale_id") .where("sales.sale_status='completed'") +<<<<<<< HEAD .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status") + end - + #Origami: Cashier : to view booking order Table + def self.get_booking_order_table + booking_orders = Booking.select("sales.receipt_no,orders.status as order_status, + bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name") + .joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id") + .joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id") + .joins("left join orders on orders.order_id = booking_orders.order_id") + .joins("left join sales on sales.sale_id = bookings.sale_id") + .where("sales.sale_status<>'completed' and booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true) + .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.customer_id,sales.customer_id,orders.order_id") end #Origami: Cashier : to view order type Room @@ -260,9 +271,8 @@ class Order < ApplicationRecord .joins("left join orders on orders.order_id = booking_orders.order_id") .joins("left join sale_orders on sale_orders.order_id = orders.order_id") .joins("left join sales on sales.sale_id = sale_orders.sale_id") - .where("sales.sale_status<>'complete' and booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true) + .where("sales.sale_status<>'completed' and sales.sale_status<>'complete' and booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true) .group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id") - end #Origami: Cashier : to view order type Room @@ -291,7 +301,7 @@ class Order < ApplicationRecord left join order_items on order_items.order_id = orders.order_id left join sale_orders on sale_orders.order_id = orders.order_id left join sales on sales.sale_id = sale_orders.sale_id") - .where("sales.sale_status<>'complete' and dining_facilities.is_active=? and orders.date between ? and ?",true,from,to) + .where("sales.sale_status<>'completed' and dining_facilities.is_active=? and orders.date between ? and ?",true,from,to) .group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id,orders.customer_id") end diff --git a/app/models/sale.rb b/app/models/sale.rb index 47d271f1..52625917 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -263,4 +263,8 @@ class Sale < ApplicationRecord def generate_custom_id self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL") end + + def self.get_receipt_no_list(from,to) + sale = Sale.where("sale_status=? and receipt_date between ? and ?","completed",from,to) + end end diff --git a/app/models/sale_item.rb b/app/models/sale_item.rb index 25b37178..ef852bbd 100644 --- a/app/models/sale_item.rb +++ b/app/models/sale_item.rb @@ -1,6 +1,6 @@ class SaleItem < ApplicationRecord self.primary_key = "sale_item_id" - + #primary key - need to be unique generated for multiple shops before_create :generate_custom_id @@ -12,17 +12,17 @@ class SaleItem < ApplicationRecord def self.get_order_items_details(sale_id) - order_details = SaleItem.select("sales.total_tax as tax_amount, sales.grand_total as grand_total_amount , sales.total_discount as discount_amount,DATE_FORMAT(sales.receipt_date,'%Y-%m-%d %h:%m') as receipt_date, + order_details = SaleItem.select("sales.total_tax as tax_amount, sales.grand_total as grand_total_amount , sales.total_discount as discount_amount,sales.receipt_date as receipt_date, sales.cashier_name,sales.receipt_no,sale_items.product_name as item_name,sale_items.qty,sale_items.price,sale_items.unit_price as total_price") .joins("left join sales on sales.sale_id = sale_items.sale_id") .where("sale_items.sale_id=?",sale_id) # sale_orders = SaleOrder.where("sale_id=?",sale_id) # if sale_orders - # sale_orders.each do |sale_order| + # sale_orders.each do |sale_order| # order_details = SaleItem.select("sales.total_discount as discount_amount,DATE_FORMAT(sales.receipt_date,'%Y-%m-%d %h:%m') as receipt_date,sales.cashier_name,sales.receipt_no,sale_items.product_name as item_name,sale_items.qty,sale_items.price,sale_items.unit_price as total_price") # .joins("left join sales on sales.id = sale_items.sale_id") - # .where("sale_items.sale_id=?",sale_order.sale_id) + # .where("sale_items.sale_id=?",sale_order.sale_id) # return order_details # end # else @@ -35,28 +35,30 @@ class SaleItem < ApplicationRecord beverage_prices=0 sale_items.each do |si| - food_price = self.get_food_price(si.sale_item_id) - beverage_price = self.get_beverage_price(si.sale_item_id) + food_price, beverage_price = self.get_price(si.sale_item_id) + food_prices = food_prices + food_price beverage_prices = beverage_prices + beverage_price end return food_prices, beverage_prices end - def self.get_food_price(sale_item_id) - food=SaleItem.select("sale_items.price") + def self.get_price(sale_item_id) + food_price=0 + beverage_price=0 + + item=SaleItem.select("sale_items.price , menu_items.account_id") .joins("left join menu_items on menu_items.item_code = sale_items.product_code") - .where("sale_items.sale_item_id=? and menu_items.account_id=1", sale_item_id.to_s) - food_price = food[0].price rescue 0 + .where("sale_items.sale_item_id=?", sale_item_id.to_s) + if item[0].account_id == 1 + food_price = item[0].price + else + beverage_price = item[0].price + end + + return food_price, beverage_price end - def self.get_beverage_price(sale_item_id) - beverage=SaleItem.select("sale_items.price") - .joins("left join menu_items on menu_items.item_code = sale_items.product_code") - .where("sale_items.sale_item_id=? and menu_items.account_id=2", sale_item_id.to_s) - beverage_price = beverage[0].price rescue 0 - end - private def generate_custom_id self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI") diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 8606b44a..b8c527af 100644 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -60,15 +60,15 @@ class SalePayment < ApplicationRecord #record an payment in sale-audit remark = "No outstanding Amount - Grand Total [#{invoice.grand_total}] | Due [#{amount_due}] | Paid [#{invoice.amount_received}]" sale_audit = SaleAudit.record_payment(invoice.id, remark,action_by) - + return false, "No outstanding Amount" end end - def self.get_paypar_account(url,token,membership_id,campaign_type_id) + def self.get_paypar_account(url,token,membership_id,campaign_type_id,merchant_uid) response = HTTParty.get(url, - :body => { app_token: token,membership_id:membership_id,campaign_type_id:campaign_type_id}.to_json, + :body => { app_token: token,membership_id:membership_id,campaign_type_id:campaign_type_id,merchant_uid:merchant_uid}.to_json, :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json' @@ -85,7 +85,7 @@ class SalePayment < ApplicationRecord merchant_uid = membership_actions_data.merchant_account_id campaign_type_id = membership_actions_data.additional_parameter["campaign_type_id"] response = HTTParty.post(url, - :body => { generic_customer_id:membership_id,total_amount:received_amount,receipet_no:sale_id,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid}.to_json, + :body => { generic_customer_id:membership_id,redeem_amount:received_amount,receipet_no:sale_id,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid}.to_json, :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json' diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index f91aebe1..dbaea572 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -1,16 +1,16 @@ class ReceiptBillPdf < Prawn::Document - attr_accessor :receipt_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 + 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(printer_settings, sale_items, sale_data, customer_name, food_total, beverage_total) - self.page_width = 300 + self.page_width = 250 self.page_height = 1450 self.margin = 10 - self.price_width = 50 - self.qty_width = 30 - self.total_width = 50 - self.item_width = self.page_width - (self.price_width + self.qty_width + self.total_width) + self.price_width = 40 + self.qty_width = 20 + self.total_width = 40 + self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width)+(self.margin*4)) self.item_height = 15 self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width) - self.receipt_width=100 + self.label_width=80 # @item_width = self.page_width.to_i / 2 # @qty_width = @item_width.to_i / 3 @@ -22,8 +22,8 @@ class ReceiptBillPdf < Prawn::Document # font "public/fonts/#{font_name}".to_s + ".ttf".to_s # font "public/fonts/Zawgyi-One.ttf" # font "public/fonts/padauk.ttf" - self.header_font_size = 12 - self.item_font_size = 10 + self.header_font_size = 11 + self.item_font_size = 9 header( printer_settings.printer_name, printer_settings.name) @@ -31,66 +31,64 @@ class ReceiptBillPdf < Prawn::Document cashier_info(sale_data, customer_name) line_items(sale_items, food_total, beverage_total) - all_total(sale_data) - - + all_total(sale_data) + footer end def header (printer_name, name) - text "#{printer_name}", :size => self.header_font_size,:align => :center - move_down 5 - text "#{name}", :size => self.header_font_size,:align => :center - # move_down self.item_height - move_down 5 + text "#{printer_name}", :left_margin => -10, :size => self.header_font_size,:align => :center + move_down 5 + text "#{name}", :size => self.header_font_size,:align => :center + # move_down self.item_height + move_down 5 - stroke_horizontal_rule + stroke_horizontal_rule end def cashier_info(sale_data, customer_name) move_down 7 # move_down 2 y_position = cursor - bounding_box([0,y_position], :width =>self.receipt_width, :height => self.item_height) do + bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do text "Receipt No:", :size => self.item_font_size,:align => :left end - bounding_box([self.receipt_width, y_position], :width =>self.receipt_width) do + bounding_box([self.label_width, y_position], :width =>self.item_width) do text "#{sale_data.receipt_no}" , :size => self.item_font_size, :align => :left end move_down 5 y_position = cursor - bounding_box([0,y_position], :width =>self.receipt_width, :height => self.item_height) do + 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.receipt_width,y_position], :width =>self.receipt_width) do + 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.receipt_width, :height => self.item_height) do - text "Date:", :size => self.item_font_size,:align => :left + bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do + text "Date:", :size => self.item_font_size,:align => :left end - bounding_box([self.receipt_width,y_position], :width =>self.receipt_width) do - text "#{sale_data.receipt_date.strftime('%Y %m %d %h:%m')}" , :size => self.item_font_size,:align => :left + bounding_box([self.label_width,y_position], :width => self.item_width) do + text "#{sale_data.receipt_date.strftime('%Y-%m-%d %I:%M %p')}" , :size => self.item_font_size,:align => :left end - # stroke_horizontal_rule + + move_down 5 + stroke_horizontal_rule move_down 5 end def line_items(sale_items, food_total, beverage_total) y_position = cursor - stroke_horizontal_rule - move_down 5 - pad_top(15) { # @item_width.to_i + @half_qty.to_i - text_box "Items", :at =>[0,y_position], :width => self.item_width - 20, :height =>self.item_height, :size => self.item_font_size - text_box "Price", :at =>[self.item_width-20,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right - text_box "Qty", :at =>[self.item_width+self.price_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right - text_box "Total", :at =>[self.item_width+self.price_width+self.qty_width,y_position], :width => self.total_width, :height =>self.item_height, :size => self.item_font_size, :align => :right + text_box "Items", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix + text_box "Price", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix + text_box "Qty", :at =>[(self.item_width+self.price_width),y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix + text_box "Total", :at =>[(self.item_width+self.price_width+2),y_position], :width => self.total_width+2, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix } @@ -99,88 +97,88 @@ class ReceiptBillPdf < Prawn::Document add_line_item_row(sale_items, food_total, beverage_total) - end def add_line_item_row(sale_items, food_total, beverage_total) - item_name_width = self.item_width-20 + item_name_width = (self.item_width+self.price_width) y_position = cursor move_down 5 sub_total = 0.0 - sale_items.each do |item| + sale_items.each do |item| + sub_total += (item.qty*item.unit_price) + qty = item.qty + total_price = item.qty*item.unit_price + price = item.unit_price + product_name = item.product_name + - sub_total += item.qty*item.unit_price - qty = item.qty - total_price = item.qty*item.unit_price - price = item.unit_price - product_name = item.product_name - + y_position = cursor - y_position = cursor + pad_top(15) { + # @item_width.to_i + @half_qty.to_i + text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :overflow => :shrink_to_fix, :size => self.item_font_size, :overflow => :shrink_to_fix + text_box "#{price}", :at =>[self.item_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix + text_box "#{qty.to_i}", :at =>[item_name_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix + text_box "#{total_price}", :at =>[(item_name_width+2),y_position], :width =>self.total_width+2, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix - pad_top(15) { - # @item_width.to_i + @half_qty.to_i - text_box "#{product_name}", :at =>[0,y_position], :width => item_name_width, :height =>self.item_height, :overflow => :shrink_to_fix, :size => self.item_font_size - text_box "#{price}", :at =>[item_name_width,y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right - text_box "#{qty.to_i}", :at =>[item_name_width+self.price_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :right - text_box "#{total_price}", :at =>[item_name_width+self.price_width+self.qty_width,y_position], :width =>self.total_width, :height =>self.item_height, :size => self.item_font_size, :align => :right - - } - move_down 3 - end + } + move_down 3 + end stroke_horizontal_rule move_down 5 y_position = cursor - bounding_box([0,y_position], :width =>(item_name_width+self.price_width+self.qty_width), :height => self.item_height) do + bounding_box([0,y_position], :width =>item_name_width, :height => self.item_height) do text "Sub Total", :size => self.item_font_size,:align => :left end - bounding_box([(item_name_width+self.price_width+self.qty_width),y_position], :width =>self.total_width) do - text "#{sub_total}" , :size => self.item_font_size,:align => :right + bounding_box([item_name_width,y_position], :width =>self.total_width) do + text "#{ sub_total }" , :size => self.item_font_size,:align => :right end # Food and Beverage - food_beverage_total = food_total.to_s + '/' + beverage_total.to_s + food_beverage_total = food_total.to_s + "/" + beverage_total.to_s + move_down 5 + y_position = cursor - bounding_box([0,y_position], :width =>(item_name_width+self.price_width+self.qty_width), :height => self.item_height) do + bounding_box([0,y_position], :width =>(item_name_width), :height => self.item_height) do text "Food/Beverage Total", :size => self.item_font_size,:align => :left end - bounding_box([(item_name_width+self.price_width+self.qty_width),y_position], :width =>self.total_width) do + bounding_box([item_name_width,y_position], :width =>self.total_width) do text "#{ food_beverage_total }" , :size => self.item_font_size,:align => :right end end def all_total(sale_data) - item_name_width = self.item_width-20 + item_name_width = self.item_width move_down 5 y_position = cursor - bounding_box([0,y_position], :width =>(item_name_width+self.price_width+self.qty_width), :height => self.item_height) do + bounding_box([0,y_position], :width =>(item_name_width+self.price_width), :height => self.item_height) do text "Discount", :size => self.item_font_size,:align => :left end - bounding_box([(item_name_width+self.price_width+self.qty_width),y_position], :width =>self.total_width) do + bounding_box([(item_name_width+self.price_width),y_position], :width =>self.total_width) do text "( " +"#{sale_data.total_discount}" +" )" , :size => self.item_font_size,:align => :right end move_down 5 y_position = cursor - bounding_box([0,y_position], :width =>(item_name_width+self.price_width+self.qty_width), :height => self.item_height) do + bounding_box([0,y_position], :width =>(item_name_width+self.price_width), :height => self.item_height) do text "Total Tax", :size => self.item_font_size,:align => :left end - bounding_box([(item_name_width+self.price_width+self.qty_width),y_position], :width =>self.total_width) do + bounding_box([(item_name_width+self.price_width),y_position], :width =>self.total_width) do text "( " +"#{sale_data.total_tax}" +" )" , :size => self.item_font_size,:align => :right end move_down 5 y_position = cursor move_down 5 - bounding_box([0,y_position], :width =>(item_name_width+self.price_width+self.qty_width), :height => self.item_height) do + bounding_box([0,y_position], :width =>(item_name_width+self.price_width), :height => self.item_height) do text "Grand Total", :size => self.item_font_size,:align => :left end - bounding_box([(item_name_width+self.price_width+self.qty_width),y_position], :width =>self.total_width) do + bounding_box([(item_name_width+self.price_width),y_position], :width =>self.total_width) do text "#{sale_data.grand_total}" , :size => self.item_font_size,:align => :right end move_down 5 @@ -188,4 +186,14 @@ class ReceiptBillPdf < Prawn::Document end + def footer + move_down 5 + stroke_horizontal_rule + move_down 5 + + text "*** Thank You ***", :left_margin => -10, :size => self.header_font_size,:align => :center + + move_down 5 + end + end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index bdd146b7..641678f9 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -36,7 +36,7 @@ diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index 4bcc5863..0332fa12 100644 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -23,41 +23,44 @@
- <% - @completed_orders.each do |cpo| + <% + @completed_orders.each do |cpo| # ToDo no need check new # Assigned Id for new Order? Sale? - unique_id="" - customer_id="" + unique_id = "" + customer_id = "" + # For CSS- Class for Order? Sale? sale_status="" - if cpo.order_status == 'new' + if cpo.order_status == 'new' unique_id=cpo.booking_id + customer_id=cpo.order_customer_id - # check selected item and assign - if @selected_item != nil + # check selected item and assign + if @selected_item != nil if cpo.order_id == @selected_item.order_id sale_status = sale_status + " selected-item" end end - else + else unique_id=cpo.sale_id customer_id=cpo.sale_customer_id sale_status="paid" - # check selected item and assign + # check selected item and assign if @selected_item != nil if unique_id == @selected_item.sale_id sale_status = sale_status + " selected-item" end end - end + end %>
- - - -

<%= cpo.table_name %>

+ + + + +

<%= cpo.table_name %>

Receipt No : @@ -68,12 +71,12 @@ Order Status : <%= cpo.order_status %> - + -

-
-
- <% +

+
+
+ <% end %> @@ -82,39 +85,39 @@
- <% - @booking_orders.each do |bko| + <% + @booking_orders.each do |bko| # Assigned Id for new Order? Sale? unique_id="" customer_id="" # For CSS- Class for Order? Sale? sale_status="" - if bko.order_status == 'new' + if bko.order_status == 'new' unique_id=bko.booking_id customer_id=bko.order_customer_id - # check selected item and assign - if @selected_item != nil + # check selected item and assign + if @selected_item != nil if bko.order_id == @selected_item.order_id sale_status = sale_status + " selected-item" end end - else + else unique_id=bko.sale_id customer_id=bko.sale_customer_id sale_status="sold" - # check selected item and assign + # check selected item and assign if @selected_item != nil if unique_id == @selected_item.sale_id sale_status = sale_status + " selected-item" end end - end + end %>
- - - + + +

<%= bko.table_name %>

Receipt No : @@ -148,32 +151,32 @@ # For CSS- Class for Order? Sale? sale_status="" - if rmo.order_status == 'new' + if rmo.order_status == 'new' unique_id=rmo.booking_id customer_id=rmo.order_customer_id - # check selected item and assign - if @selected_item != nil + # check selected item and assign + if @selected_item != nil if rmo.order_id == @selected_item.order_id sale_status = sale_status + " selected-item" - end - end - else + end + end + else unique_id=rmo.sale_id customer_id=rmo.sale_customer_id sale_status="sold" - # check selected item and assign + # check selected item and assign if @selected_item != nil if unique_id == @selected_item.sale_id sale_status = sale_status + " selected-item" end end - end + end %>

- + - +

<%= rmo.room_name %>

Receipt No : @@ -198,19 +201,19 @@

-
- <% - @orders.each do |odr| +
+ <% + @orders.each do |odr| # Assigned Id for new Order? Sale? unique_id="" customer_id="" # For CSS- Class for Order? Sale? - sale_status="" + sale_status="" - if odr.order_status == 'new' + if odr.order_status == 'new' unique_id=odr.booking_id customer_id = odr.order_customer_id - if @selected_item != nil + if @selected_item != nil if odr.order_id == @selected_item.order_id sale_status = sale_status + " selected-item" end @@ -218,9 +221,9 @@ else unique_id=odr.sale_id customer_id = odr.sale_customer_id - sale_status="sold" - # check selected item and assign - if @selected_item != nil + sale_status="sold" + # check selected item and assign + if @selected_item != nil if unique_id == @selected_item.sale_id sale_status = sale_status + " selected-item" end @@ -229,9 +232,9 @@ %>
- - - + + +

<%= odr.table_name %>

Receipt No : @@ -270,19 +273,19 @@

Receipt No: <%=@selected_item.receipt_no rescue ' '%>

-
+

Date: <%=@selected_item.receipt_date.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>

-
+

Customer :

- -
+ +

Amount :

-
+
@@ -294,7 +297,7 @@ - <% + <% # For Sale Items sub_total = 0 if @selected_item_type == "Sale" @@ -302,16 +305,16 @@ sub_total += sale_item.qty*sale_item.unit_price %> - + - <% + <% end end %> - <% + <% # For Order Items sub_total = 0 if @selected_item_type == "Order" @@ -319,11 +322,11 @@ sub_total += order_item.qty*order_item.unit_price %> - + - <% + <% end end %> diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 4cff678d..f9ae06b7 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -6,8 +6,8 @@
<%= sale_item.product_name %><%= sale_item.product_name %> <%= sale_item.qty %> <%= sale_item.qty*sale_item.price %>
<%= order_item.item_name %><%= order_item.item_name %> <%= order_item.qty %> <%= order_item.qty*order_item.price %>
- - + + @@ -232,7 +232,12 @@ $( document ).ready(function() { url: "<%= origami_payment_cash_path %>", data: "cash="+ cash + "&sale_id=" + sale_id, success:function(result){ - alert("Thank you") + if($('#balance').text() < 0){ + alert("Changed amount " + $('#balance').text() * (-1) ) + }else{ + alert("Thank you") + } + window.location.href = '/origami'; } }); diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index 72c09d4d..0ffa08e8 100644 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -1,7 +1,7 @@
-
+
@@ -22,15 +22,15 @@
- -
+ +
-
+
1
-
2
-
3
+
2
+
3
@@ -39,10 +39,10 @@
-
+
4
-
5
-
6
+
5
+
6
@@ -51,10 +51,10 @@
-
+
7
-
8
-
9
+
8
+
9
@@ -63,10 +63,10 @@
-
+
0
-
.
-
00
+
.
+
00
@@ -75,10 +75,10 @@
-
+
-
DEL
-
CLR
+
DEL
+
CLR
@@ -140,13 +140,14 @@ $("#redeem").click(function(){ membership_id = $("#valid_amount").attr('data-member-value'); redeem_amount = parseInt($("#used_amount").text()); if(redeem_amount<=0 ){ - alert(" Insufficient Amount!") - }else if(valid_amount< redeem_amount || redeem_amount == ""){ alert("Please type valid amount"); + + }else if(valid_amount< redeem_amount){ + alert(" Insufficient Amount!") }else{ $.ajax({ type: "POST", - url: "<%=origami_paypar_payment_process_path%>", + url: "<%=origami_payment_paypar_path%>", data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id}, success: function(result){ if(result.status == true){ diff --git a/app/views/reports/receipt_no/_shift_sale_report_filter.html.erb b/app/views/reports/receipt_no/_shift_sale_report_filter.html.erb new file mode 100644 index 00000000..9c87d843 --- /dev/null +++ b/app/views/reports/receipt_no/_shift_sale_report_filter.html.erb @@ -0,0 +1,246 @@ +<%= form_tag report_path, :method => :get, :id=>"frm_report" do %> +
+
+ <% if defined? product_account %> + <%= select_tag "account", options_from_collection_for_select(@accounts,"id","title", :selected => params[:account])%> + <% end %> + <% if defined? shift_product_account %> + <%= select_tag "account", options_from_collection_for_select(@accounts,"id","title", :selected => params[:account]), :prompt => 'All Group'%> + <% end %> +
+ +
+ <% if period_type != false %> + + + <% end %> +
+ +
+
+ Export to Excel + + +
+
+
+
+ +
+ +
+
+ <% if defined? show_sale_type %> + + <% end %> + + <% if defined? promotions %> + <%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]) %> + <% end %> + + <% if defined? menu_types %> + <%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]) %> + <% end %> + + <% if defined? payments %> + <%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]) %> + <% end %> + + <% if defined? shift_name %> + + <% end %> + <% if defined? cashiers %> + <%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations" %> + <% end %> + + <% if defined? singer %> + <%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List" %> + <% end %> + + <% if defined? bsm %> + <%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List" %> + <% end %> + + <% if defined? guest_role %> + <%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List" %> + <% end %> + + <% if defined? list_by_payment_type %> + <%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]) %> + <% end %> + + <% if defined? products %> + <%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products" %> + <% end %> + <% if defined? items %> + <%= select_tag "item", options_for_select(@items, :selected => params[:item_type]) %> + <% end %> +
+ +
+ + +
+ To     + +
+
+ + + <% if defined? show_monthly %> +
+ +
+ + + +
+
+ <% end %> + +
+ +
+
+ +<% end %> + + \ No newline at end of file diff --git a/app/views/reports/receipt_no/index.html.erb b/app/views/reports/receipt_no/index.html.erb index 0bae50e7..fac08039 100644 --- a/app/views/reports/receipt_no/index.html.erb +++ b/app/views/reports/receipt_no/index.html.erb @@ -1,3 +1,95 @@ -
- <%= @hi %> -
\ No newline at end of file + +
+
Receipt No : <%=@sale_data.receipt_no rescue ' '%>Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>Receipt No : <%=@sale_data.receipt_no rescue ' '%>Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%>
Table No <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %>
+ + + + + + + + + + + + + + + <% total_sales = 0 %> + <% net_sales = 0 %> + <% @sale_data.each do |sale| %> + <% total_sales = sale.total_amount.to_f - sale.total_discount.to_f%> + <% net_sales = total_sales.to_f + sale.total_tax.to_f%> + + + + + + + + + + + <% end %> + +
DateReceipt NoCashier NameGross SalesDiscountTotal SalesCTNett Sales
<%= sale.receipt_date.strftime("#{sale.receipt_date.day.ordinalize} %b") rescue '-' %><%=sale.receipt_no.to_s rescue ''%><%=sale.cashier_id rescue ''%><%= number_with_delimiter(sprintf("%.2f",sale.total_amount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale.total_discount.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",total_sales.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale.total_tax.to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",net_sales.to_f), :delimiter => ',') %>
+
+<%= paginate @sale_data %> + \ No newline at end of file diff --git a/app/views/reports/receipt_no/index.xls.erb b/app/views/reports/receipt_no/index.xls.erb new file mode 100644 index 00000000..2191d814 --- /dev/null +++ b/app/views/reports/receipt_no/index.xls.erb @@ -0,0 +1,135 @@ +
+
+ +<% unless @sale_data.empty? %> +

<%=current_active_location.name%>

+

Sales Summary Report (BreadTalk)

+<% if params[:from]%> +

From Date : <%= params[:from] %> , To Date : <%= params[:to] %>

+<% end %> + + + + + + + + + + + + + + + + + + + + + <% void = 0 %> + <% card = 0 %> + <% credit_payment = 0 %> + <% cash = 0 %> + <% credit = 0 %> + <% foc = 0 %> + <% discount = 0 %> + <% total = 0 %> + <% count = 1 %> + <% discount_rev = 0 %> + <% total_rev = 0 %> + <% grand_rev = 0 %> + <% total_other_charges=0 %> + <% total_tax=0 %> + <% cash_received = 0 %> + <% total_cash_received = 0 %> + <% today_credit_payment_amount = 0 %> + <% old_location_id = 0%> + <% sub_total = 0 %> + <% count_of_void = 0 %> + <% flag = false %> + <% @sale_data.each do |sale| %> + <% credit_payment += sale[:credit_payment].to_f %> + <% card += sale[:card_amount].to_f %> + <% cash += sale[:cash_amount].to_f %> + <% credit += sale[:credit_amount].to_f %> + <% foc += sale[:foc_amount].to_f %> + <% discount += sale[:total_discount].to_f %> + <% total += sale[:grand_total].to_f %> + <% total_other_charges +=sale[:other_charges].to_f %> + <% total_tax +=sale[:total_tax].to_f %> + + <% cash_received = sale[:cash_amount].to_f + sale[:credit_payment].to_f%> + <% total_cash_received = cash.to_f + credit_payment.to_f%> + <% today_credit_payment_amount += sale[:today_credit_payment].to_f %> + + + + + + + + + + + + + + + <% total_void_amount = 0 %> + <% if !@daily_void.nil? %> + <% @daily_void.each do |d_v|%> + + <% if d_v[:daily_void_amt].to_i > 0 %> + <% if d_v[:location_id] == sale[:location_id] %> + <% if d_v[:date].utc.getlocal.strftime("%Y-%m-%d").to_s == sale[:sale_date].to_s%> + <%count_of_void+=1%> + + <%total_void_amount += d_v[:daily_void_amt].to_f%> + <% flag = true %> + + + + <%end %> + <% end%> + <% end%> + <% end%> + <% end%> + <% if flag == true%> + <% void += total_void_amount.to_f %> + + <% flag = false %> + <% end%> + <%if count_of_void == 0%> + + <%end %> + + + + +<%count_of_void= 0%> + <% count = count + 1 %> + <% end %> + + + + + + + + + + + + + + + + + +<% end %> +
Location NameDateCash SalesCredit SalesCredit ReceivedCard PaymentTotal DiscountTotal TaxesTotal Other ChargesFOC SalesVoid SalesGrand Total
<%= sale[:location].to_s rescue '-' %><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %><%= number_with_delimiter(sprintf("%.2f",sale[:cash_amount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:credit_amount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:credit_payment].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:card_amount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:total_discount].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:total_tax].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:other_charges].to_f), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",sale[:foc_amount].to_f), :delimiter => ',') %> <%= number_with_delimiter(sprintf("%.2f",total_void_amount.to_f), :delimiter => ',') %> <%= number_with_delimiter(sprintf("%.2f",0.to_f), :delimiter => ',') %> + <%= number_with_delimiter(sprintf("%.2f",((sale[:cash_amount].to_f + sale[:credit_amount].to_f + sale[:card_amount].to_f + sale[:credit_payment].to_f) - sale[:today_credit_payment].to_f) ).to_f, :delimiter => ',') %> +
Grand Total<%= number_with_delimiter(sprintf("%.2f",cash), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",credit ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",credit_payment ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",card ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",discount ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",total_tax ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",total_other_charges ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",foc ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f",void ), :delimiter => ',') %><%= number_with_delimiter(sprintf("%.2f", (cash.to_f + credit.to_f + card.to_f + credit_payment.to_f) - today_credit_payment_amount.to_f ).to_f, :delimiter => ',') %>
+
+
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 816b53f7..3b15f5dd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,7 @@ Rails.application.routes.draw do mount Sidekiq::Web => '/kiq' # Action Cable Creation - mount ActionCable.server => "/cable" + # mount ActionCable.server => "/cable" #--------- SmartSales Installation ------------# get 'install' => 'install#index' @@ -87,7 +87,7 @@ Rails.application.routes.draw do #--------- Payment ------------# get 'sale/:sale_id/payment' => 'payments#show' post 'payment/cash' => 'payments#create' - post 'paypar_payment_process' => 'paypar_payments#create' + post 'payment/paypar' => 'paypar_payments#create' get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index" get 'sale/:sale_id/payment/others_payment' => "others_payments#index" diff --git a/db/seeds.rb b/db/seeds.rb index 6849f008..28cbe535 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -155,11 +155,14 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance", {membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}, {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"} ]) + +payment_methods = PaymentMethodSetting.create({payment_method:"MPU",gateway_url: "http//192.168.1.47:3006"}) +payment_methods = PaymentMethodSetting.create({payment_method:"JCB",gateway_url: "http//192.168.1.47:3006"}) payment_methods = PaymentMethodSetting.create({payment_method:"REDEEMREBATE",gateway_url: "http://192.168.1.47:3006",merchant_account_id:"vWSsseoZCzxd6xcNf_uS"}) + # shop = Shop.create( -# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon", -# country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license", +# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon", +# country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license", # activated_at: "2017-06-06", license_data: "license_data", base_currency: "Ks", id_prefix: "abc"} # ) - diff --git a/dump.rdb b/dump.rdb index 62a327a0..4d2c7d9e 100644 Binary files a/dump.rdb and b/dump.rdb differ