rounding adj fix
This commit is contained in:
@@ -39,7 +39,8 @@ class Origami::CreditPaymentsController < BaseOrigamiController
|
|||||||
rounding_adj = new_total-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)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "creditnote")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "creditnote")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ class Origami::JcbController < BaseOrigamiController
|
|||||||
rounding_adj = new_total-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)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "jcb")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "jcb")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -34,6 +34,16 @@ class Origami::MasterController < BaseOrigamiController
|
|||||||
cash = params[:amount]
|
cash = params[:amount]
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
if(Sale.exists?(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)
|
saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "master")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "master")
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ class Origami::MpuController < BaseOrigamiController
|
|||||||
rounding_adj = new_total-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)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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)
|
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
saleObj = Sale.find(sale_id)
|
||||||
#end rounding adjustment
|
#end rounding adjustment
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "visa")
|
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "visa")
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class SalePayment < ApplicationRecord
|
|||||||
return payment_status
|
return payment_status
|
||||||
end
|
end
|
||||||
|
|
||||||
def external_terminal_card_payment(method)
|
def external_terminal_card_payment(method)
|
||||||
payment_status = false
|
payment_status = false
|
||||||
self.payment_method = method
|
self.payment_method = method
|
||||||
self.payment_amount = self.received_amount
|
self.payment_amount = self.received_amount
|
||||||
|
|||||||
@@ -1,42 +1,48 @@
|
|||||||
if @zones
|
if @zones
|
||||||
json.array! @zones do |zone|
|
json.array! @zones do |zone|
|
||||||
json.id zone.id
|
if zone.is_active
|
||||||
json.name zone.name
|
json.id zone.id
|
||||||
#List all tables
|
json.name zone.name
|
||||||
json.tables zone.tables do |table|
|
#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.id table.id
|
||||||
json.name table.name
|
json.name table.name
|
||||||
json.status table.status
|
json.status table.status
|
||||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
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 ""
|
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
json.rooms zone.rooms do |room|
|
json.rooms @all_rooms do |room|
|
||||||
|
if room.is_active
|
||||||
json.id room.id
|
json.id room.id
|
||||||
json.name room.name
|
json.name room.name
|
||||||
json.status room.status
|
json.status room.status
|
||||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
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 ""
|
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||||
|
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user