Pull from master
This commit is contained in:
@@ -87,7 +87,9 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
@crm_customer = Customer.new
|
||||
@count_customer = Customer.count_customer
|
||||
|
||||
@taxes = TaxProfile.where(:group_type => 'cashier')
|
||||
# @taxes = TaxProfile.where(:group_type => 'cashier')
|
||||
@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")
|
||||
# if flash["errors"]
|
||||
# @crm_customer.valid?
|
||||
# end
|
||||
|
||||
@@ -130,6 +130,19 @@ class Origami::HomeController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#for changable on/off
|
||||
@changable_tax = true
|
||||
lookup_changable_tax = Lookup.collection_of('changable_tax')
|
||||
if !lookup_changable_tax.empty?
|
||||
lookup_changable_tax.each do |changable_tax|
|
||||
if changable_tax[0].downcase == "change"
|
||||
if changable_tax[1] == '0'
|
||||
@changable_tax = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_emp_access_code
|
||||
|
||||
@@ -241,7 +241,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
if path.include? ("credit_payment")
|
||||
@sale_payment = SalePayment.get_credit_total_left(sale_id)
|
||||
@sale_payment = SalePayment.get_credit_amount_due_left(sale_id)
|
||||
end
|
||||
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@@ -271,6 +271,20 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
if !@lookup_pdf.nil?
|
||||
@pdf_view = @lookup_pdf.value
|
||||
end
|
||||
|
||||
#for changable on/off
|
||||
@changable_tax = true
|
||||
lookup_changable_tax = Lookup.collection_of('changable_tax')
|
||||
if !lookup_changable_tax.empty?
|
||||
lookup_changable_tax.each do |changable_tax|
|
||||
if changable_tax[0].downcase == "change"
|
||||
if changable_tax[1] == '0'
|
||||
@changable_tax = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@shop = shop_detail #show shop info
|
||||
|
||||
@customer_lists = Customer.where("customer_id = 'CUS-000000000001' or customer_id = 'CUS-000000000002'")
|
||||
|
||||
@@ -154,6 +154,19 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#for changable on/off
|
||||
@changable_tax = true
|
||||
lookup_changable_tax = Lookup.collection_of('changable_tax')
|
||||
if !lookup_changable_tax.empty?
|
||||
lookup_changable_tax.each do |changable_tax|
|
||||
if changable_tax[0].downcase == "change"
|
||||
if changable_tax[1] == '0'
|
||||
@changable_tax = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -25,6 +25,7 @@ class Origami::SalesController < BaseOrigamiController
|
||||
def add_to_existing_invoice
|
||||
dining = params[:dining_id]
|
||||
sale_id = params[:sale_id]
|
||||
tax_type = params[:tax_type]
|
||||
table = DiningFacility.find(dining)
|
||||
existing_booking = Booking.find_by_sale_id(sale_id)
|
||||
table.bookings.each do |booking|
|
||||
@@ -51,7 +52,7 @@ class Origami::SalesController < BaseOrigamiController
|
||||
end
|
||||
|
||||
# Re-compute for add
|
||||
saleobj.compute(order.source)
|
||||
saleobj.compute(order.source,tax_type)
|
||||
saleobj.save
|
||||
order.save
|
||||
booking.save
|
||||
|
||||
Reference in New Issue
Block a user