Pull from master

This commit is contained in:
San Wai Lwin
2018-08-06 17:52:03 +06:30
parent 35ac07b0a6
commit e99e907bc4
33 changed files with 455 additions and 126 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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'")

View File

@@ -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

View File

@@ -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