Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes

This commit is contained in:
phyusin
2017-12-07 15:29:34 +06:30
7 changed files with 49 additions and 29 deletions

View File

@@ -39,7 +39,8 @@ class Origami::CreditPaymentsController < BaseOrigamiController
rounding_adj = new_total-saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
end
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "creditnote")
end

View File

@@ -44,7 +44,8 @@ class Origami::JcbController < BaseOrigamiController
rounding_adj = new_total-saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
end
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "jcb")
end

View File

@@ -34,6 +34,16 @@ class Origami::MasterController < BaseOrigamiController
cash = params[:amount]
sale_id = params[:sale_id]
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
shop_details = Shop::ShopDetail
# rounding adjustment
if shop_details.is_rounding_adj
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
rounding_adj = new_total-saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
end
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "master")

View File

@@ -43,7 +43,8 @@ class Origami::MpuController < BaseOrigamiController
rounding_adj = new_total-saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
end
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
end

View File

@@ -43,6 +43,7 @@ class Origami::VisaController < BaseOrigamiController
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
end
saleObj = Sale.find(sale_id)
#end rounding adjustment
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "visa")

View File

@@ -211,7 +211,7 @@ class SalePayment < ApplicationRecord
return payment_status
end
def external_terminal_card_payment(method)
def external_terminal_card_payment(method)
payment_status = false
self.payment_method = method
self.payment_amount = self.received_amount

View File

@@ -1,42 +1,48 @@
if @zones
json.array! @zones do |zone|
json.id zone.id
json.name zone.name
#List all tables
json.tables zone.tables do |table|
if zone.is_active
json.id zone.id
json.name zone.name
#List all tables
json.tables zone.tables do |table|
if table.is_active
json.id table.id
json.name table.name
json.status table.status
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
json.current_booking table.get_current_booking.booking_id rescue ""
end
end
json.rooms zone.rooms do |room|
if room.is_active
json.id room.id
json.name room.name
json.status room.status
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
json.current_booking room.get_current_booking.booking_id rescue ""
end
end
end
end
else #list all tables and rooms with out zones
json.tables @all_tables do |table|
if table.is_active
json.id table.id
json.name table.name
json.status table.status
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
json.current_booking table.get_current_booking.booking_id rescue ""
end
end
json.rooms zone.rooms do |room|
json.rooms @all_rooms do |room|
if room.is_active
json.id room.id
json.name room.name
json.status room.status
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
json.current_booking room.get_current_booking.booking_id rescue ""
end
end
else #list all tables and rooms with out zones
json.tables @all_tables do |table|
json.id table.id
json.name table.name
json.status table.status
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
json.current_booking table.get_current_booking.booking_id rescue ""
end
json.rooms @all_rooms do |room|
json.id room.id
json.name room.name
json.status room.status
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
json.current_booking room.get_current_booking.booking_id rescue ""
end
end