access code in foodcourt payment(void,waste&spoile,edit,change tax)

This commit is contained in:
Myat Zin Wai Maw
2020-02-05 12:09:04 +06:30
parent 978e7b7e07
commit 0582587f75
3 changed files with 78 additions and 24 deletions

View File

@@ -1,25 +1,14 @@
class Foodcourt::PaymalController < BaseFoodcourtController
def create
cash = params[:payment_amount]
sale_id = params[:sale_id]
transaction_ref = params[:transaction_ref]
account_no = params[:account_no]
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
# shop_details = Shop.first
# 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)
def create
cash = params[:payment_amount]
sale_id = params[:sale_id]
transaction_ref = params[:transaction_ref]
account_no = params[:account_no]
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
status, @sale,@membership_data = sale_payment.process_payment(saleObj, current_user, cash, "paymal",account_no)
if status == true && @membership_data["status"] == true
@out = true, "Success!"
else