commission update -> change route under settings

This commit is contained in:
Zin Lin Phyo
2017-08-28 09:46:36 +06:30
parent ef9fe32b5b
commit 3131823ae0
32 changed files with 861 additions and 817 deletions

View File

@@ -11,10 +11,10 @@ Rails.application.routes.draw do
#--------- SmartSales Installation ------------#
get 'install' => 'install#index'
post 'install' => 'install#create'
post 'install' => 'install#create'
#--------- Login/Authentication ------------#
get 'auth/:emp_id' => 'home#show' , as: :emp_login
get 'auth/:emp_id' => 'home#show', as: :emp_login
patch "auth/:emp_id" => 'home#update', as: :emp_login_update
post 'login' => 'home#create'
@@ -23,14 +23,14 @@ Rails.application.routes.draw do
#--------- API Routes ------------#
namespace :api, :defaults => { :format => 'json' } do
namespace :api, :defaults => {:format => 'json'} do
#Session Login and Logout
post 'authenticate' => "authenticate#create"
post 'authenticate' => "authenticate#create"
delete 'authenticate' => "authenticate#destroy"
namespace :restaurant do
get 'zones' => "zones#index"
resources :menu, only:[:index, :show]
resources :menu, only: [:index, :show]
resources :menu_categories, only: [:index, :show]
resources :menu_items, only: [:index, :show]
resources :menu_item_attributes, only: [:index]
@@ -57,10 +57,10 @@ Rails.application.routes.draw do
get "customers/get_order/:id" => "customers#get_customer_order"
#Generating Invoice and making payments - output render @sale
resources :invoices, only: [:index, :show, :create, :update, :destroy ] do
resources :sale_items, only:[:create, :update, :destroy]
resources :invoices, only: [:index, :show, :create, :update, :destroy] do
resources :sale_items, only: [:create, :update, :destroy]
resources :discounts, only: [:create, :update, :destroy]
resources :memberships, only:[:create]
resources :memberships, only: [:create]
post "payment/:payment_method" => "payment#create"
put "payment/:id" => "payment#update"
resources :receipt, only: [:create, :show] #generate receipt, show receipt
@@ -72,8 +72,8 @@ Rails.application.routes.draw do
#--------- Cashier ------------#
namespace :origami do
resources :cash_ins, only:[:new, :create]
resources :cash_outs, only:[:new, :create]
resources :cash_ins, only: [:new, :create]
resources :cash_outs, only: [:new, :create]
root "home#index"
get "table/:dining_id" => "home#show" do #origami/:booking_id will show
# resources :discounts, only: [:index,:new, :create ] #add discount type
@@ -87,16 +87,11 @@ Rails.application.routes.draw do
post 'item_void_cancel' => "sale_edit#item_void_cancel"
post 'cancel_all_void' => 'sale_edit#cancel_all_void'
post 'apply_void' => 'sale_edit#apply_void'
# commissions
get '/table/:table_id/sale/:sale_id/load_commissioners' => 'commissions#load_commissioners', as: 'load_commissioners'
post 'select_sale_item' => 'commissions#select_sale_item'
# product_commission
post 'select_commissioner' => 'product_commissions#set_commissioner_to_sale_item'
# in_juties
get '/table/:table_id/assign_in_juty' => 'in_juties#assign_in_juty', as: 'assign_in_juty'
post 'assign_in_juty' => 'in_juties#create_for_in_juty', as: 'create_for_in_juty'
get 'assign_in_juty/:table_id' => 'in_juties#index_in_juty', as: 'index_in_juty'
get 'table/:table_id/in_juty/:id/edit' => 'in_juties#edit_in_juty' ,as: 'edit_in_juty'
get 'table/:table_id/in_juty/:id/edit' => 'in_juties#edit_in_juty', as: 'edit_in_juty'
put '/edit_in_juty/:id' => 'in_juties#update_for_in_juty', as: 'update_for_in_juty'
delete 'table/:table_id/destroy_in_juty/:id' => 'in_juties#destroy_in_juty', as: 'destroy_in_juty'
@@ -122,8 +117,8 @@ Rails.application.routes.draw do
# Discount for Member
post "/:id/member_discount" => "discounts#member_discount"
get "/:id/request_bills" => "request_bills#print",:as => "request_bill"
get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' }
get "/:id/request_bills" => "request_bills#print", :as => "request_bill"
get '/:sale_id/reprint' => 'payments#reprint', :defaults => {:format => 'json'}
#---------Shift ---------------#
resources :shifts, only: [:index, :new, :create, :edit]
@@ -141,11 +136,11 @@ Rails.application.routes.draw do
#payment - Outing payments - Cash only [ *Misc expeness tracking]
#--------- Payment ------------#
post 'sale/:sale_id/rounding_adj' => 'payments#rounding_adj',:as => "calculate_rouding_adjs"
get 'sale/:sale_id/first_bill' => 'payments#first_bill', :defaults => { :format => 'json' }
post 'sale/:sale_id/rounding_adj' => 'payments#rounding_adj', :as => "calculate_rouding_adjs"
get 'sale/:sale_id/first_bill' => 'payments#first_bill', :defaults => {:format => 'json'}
get 'sale/:sale_id/payment' => 'payments#show'
post 'payment/foc' => 'payments#foc', :defaults => { :format => 'json' }
post 'payment/foc' => 'payments#foc', :defaults => {:format => 'json'}
post 'payment/cash' => 'payments#create'
post 'payment/mpu' => "mpu#create"
post 'payment/jcb' => "jcb#create"
@@ -168,43 +163,41 @@ Rails.application.routes.draw do
post 'sale/:sale_id/void' => 'void#overall_void'
#---------Multiple Invoices --------------#
get 'table/:table_id/table_invoices' => "table_invoices#index" , :as => "table_invoice_index"
get 'table/:table_id/table_invoice/:invoice_id' => "table_invoices#show" , :as => "table_invoice_show"
get 'room/:room_id/room_invoices' => "room_invoices#index" , :as => "room_invoice_index"
get 'room/:room_id/room_invoice/:invoice_id' => "room_invoices#show" , :as => "room_invoice_show"
get 'table/:table_id/table_invoices' => "table_invoices#index", :as => "table_invoice_index"
get 'table/:table_id/table_invoice/:invoice_id' => "table_invoices#show", :as => "table_invoice_show"
get 'room/:room_id/room_invoices' => "room_invoices#index", :as => "room_invoice_index"
get 'room/:room_id/room_invoice/:invoice_id' => "room_invoices#show", :as => "room_invoice_show"
#---------Add Customer --------------#
#resources :customers
get '/:sale_id/customers', to: "customers#add_customer"
get '/:customer_id/get_customer' => 'home#get_customer',:as => "show_customer_details"
post '/:sale_id/update_sale' , to: "customers#update_sale_by_customer" # update customer id in sale table
get '/:customer_id/get_customer' => 'home#get_customer', :as => "show_customer_details"
post '/:sale_id/update_sale', to: "customers#update_sale_by_customer" # update customer id in sale table
post '/:sale_id/get_customer' => "customers#get_customer"
resources :addorders
resources :commissions
resources :commissioners
resources :in_juties
end
#--------- Waiter/Ordering Station ------------#
namespace :oishi do
#zones
#tables
#orders
#zones
#tables
#orders
end
#--------- Customer Relationship Management ------------#
namespace :crm do
root "home#index"
resources :customers
resources :dining_queues
post "update_booking" , to: "bookings#update_booking", as: "update_booking"#assign and cancel
get '/print/:id', to: "home#print_order"#print order for crm
root "home#index"
resources :customers
resources :dining_queues
post "update_booking", to: "bookings#update_booking", as: "update_booking" #assign and cancel
get '/print/:id', to: "home#print_order" #print order for crm
get "/dining_queues/:id/assign" =>"dining_queues#assign", :as => "assign"
post "/dining_queues/assign_table" =>"dining_queues#assign_table", :as => "assign_table"
post "/dining_queues/cancel_queue" =>"dining_queues#cancel_queue", :as => "cancel_queue"
get "/dining_queues/:id/assign" => "dining_queues#assign", :as => "assign"
post "/dining_queues/assign_table" => "dining_queues#assign_table", :as => "assign_table"
post "/dining_queues/cancel_queue" => "dining_queues#cancel_queue", :as => "cancel_queue"
end
@@ -223,7 +216,7 @@ Rails.application.routes.draw do
get 'print/print/:id', to: "print#print"
get 'print/print_order_summary/:id', to: "print#print_order_summary"
get "/get_items/:id" =>"home#get_items_by_oqs", :as => "get_order_items_by_oqs"
get "/get_items/:id" => "home#get_items_by_oqs", :as => "get_order_items_by_oqs"
#dashboard
#
end
@@ -235,7 +228,7 @@ Rails.application.routes.draw do
#menu
resources :menus do
#menu_categories
resources :menu_categories, only: [:new, :create, :edit,:delete]
resources :menu_categories, only: [:new, :create, :edit, :delete]
end
resources :item_sets
@@ -299,16 +292,26 @@ Rails.application.routes.draw do
resources :promotion_products
end
# commission
resources :commissions
resources :commissioners
end
# commissions
get 'origami/table/:table_id/sale/:sale_id/load_commissioners' => 'settings/commissions#load_commissioners', as: 'load_commissioners'
post 'origami/select_sale_item' => 'settings/commissions#select_sale_item', as: 'select_sale_item'
# product_commission
post 'origami/select_commissioner' => 'origami/product_commissions#set_commissioner_to_sale_item', as: 'select_commissioner'
#--------- Transactions Sections ------------#
namespace :transactions do
resources :sales
resources :orders
resources :credit_notes
get "/sales/:sale_id/manual_complete_sale" =>"manual_sales#manual_complete_sale", :as => "manual_complete_sale"
get "/sales/:sale_id/void" =>"manual_sales#void", :as => "void"
get "/sales/:sale_id/manual_complete_sale" => "manual_sales#manual_complete_sale", :as => "manual_complete_sale"
get "/sales/:sale_id/void" => "manual_sales#void", :as => "void"
post "sales/:sale_id/manual_void_sale", to: "manual_sales#manual_void_sale", :as => "manual_void_sale"
end