quick service tax

This commit is contained in:
Myat Zin Wai Maw
2019-12-20 14:12:57 +06:30
parent 40871c30fb
commit e3207ed1d5
4 changed files with 50 additions and 8 deletions

View File

@@ -81,7 +81,8 @@ class Crm::CustomersController < BaseCrmController
@membership_types = Lookup.collection_of("member_group_type")
# @taxes = TaxProfile.where(:group_type => 'cashier')
# @taxes = TaxProfile.all
# @taxes =TaxProfile.unscoped.select("id,(SELECT name from lookups where lookup_type='tax_profiles') as name")
@taxes = TaxProfile.unscoped.select("id, (CONCAT(name,'(',(SELECT name FROM lookups WHERE lookup_type='tax_profiles' AND value=group_type),')')) as name")
.order("group_type ASC,order_by ASC")

View File

@@ -32,8 +32,8 @@ class Origami::QuickServiceController < ApplicationController
#checked quick_service only
@quick_service_only = false
lookup_dine_in = Lookup.collection_of('quickservice_add_order')
puts 'lookup_dine_in!!!!'
puts lookup_dine_in
# puts 'lookup_dine_in!!!!'
# puts lookup_dine_in
if !lookup_dine_in.empty?
lookup_dine_in.each do |dine_in|
if dine_in[0].downcase == "quickserviceaddorder"
@@ -43,7 +43,23 @@ class Origami::QuickServiceController < ApplicationController
end
end
end
divided_value =0
exclusive =0
tax_profiles = TaxProfile.where(group_type: "quick_service")
if !tax_profiles.empty?
tax_profiles.each do |tax|
#include or execulive
if tax.inclusive
tax_incl_exec = "inclusive"
rate = tax.rate
divided_value += (100 + rate)/rate
else
exclusive +=tax.rate / 100
end
end
end
@inclusive_tax =divided_value
@exclusive_tax =exclusive
render "origami/addorders/detail"
end
@@ -121,7 +137,7 @@ class Origami::QuickServiceController < ApplicationController
order.table_id = params[:table_id] # this is dining facilities's id
order.waiters = current_login_employee.name
order.employee_name = current_login_employee.name
order.is_extra_time = is_extra_time
order.extra_time = extra_time