void
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Api::PaymentsController < Api::ApiController
|
||||
# skip_before_action :authenticate
|
||||
skip_before_action :authenticate
|
||||
|
||||
#Payment by Invoice ID
|
||||
# Payment Method - [Cash | CreditNote | VISA | MASTER | etc..]
|
||||
|
||||
@@ -70,7 +70,8 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
.joins("JOIN orders ON orders.order_id=booking_orders.order_id")
|
||||
.joins("JOIN order_items ON orders.order_id=order_items.order_id")
|
||||
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
|
||||
.where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}' and DATE(bookings.created_at) = '#{Date.today}'").order("bookings.created_at desc").uniq
|
||||
.where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}'").order("bookings.created_at desc").uniq
|
||||
# .where("orders.source='app' and bookings.shop_code='#{Shop.current_shop.shop_code}' and DATE(bookings.created_at) = '#{Date.today}'").order("bookings.created_at desc").uniq
|
||||
end
|
||||
def completed
|
||||
customer =Customer.find_by_customer_id(params[:customer_id])
|
||||
|
||||
@@ -9,7 +9,7 @@ class Foodcourt::PaymalController < BaseFoodcourtController
|
||||
@receipt_no = sale_data.receipt_no
|
||||
|
||||
@shop = Shop.current_shop
|
||||
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
else
|
||||
|
||||
@@ -7,7 +7,7 @@ class Foodcourt::PayparPaymentsController < BaseFoodcourtController
|
||||
payment_method = "paypar"
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
|
||||
|
||||
@shop = Shop.current_shop
|
||||
|
||||
# rounding adjustment
|
||||
|
||||
@@ -33,15 +33,6 @@ class Foodcourt::VoidController < BaseFoodcourtController
|
||||
sale.sale_status = 'void'
|
||||
sale.save
|
||||
|
||||
# No Need
|
||||
# bookings = sale.bookings
|
||||
# bookings.each do |booking|
|
||||
# orders = booking.orders
|
||||
# orders.each do |order|
|
||||
# # order.status = 'void'
|
||||
# end
|
||||
# end
|
||||
|
||||
if sale.bookings[0].dining_facility_id.to_i > 0
|
||||
table_avaliable = true
|
||||
table_count = 0
|
||||
@@ -79,8 +70,14 @@ class Foodcourt::VoidController < BaseFoodcourtController
|
||||
# remark = "Void Sale ID #{sale_id} | Receipt No #{sale.receipt_no} | Receipt No #{sale.receipt_no} | Table ->#{table.name}"
|
||||
sale_audit = SaleAudit.record_audit_for_edit(sale_id,current_user.name, action_by,remark,"SALEVOID" )
|
||||
|
||||
# For Print
|
||||
#call paymal to void
|
||||
if sale.sale_payments
|
||||
membership_response =sale.paymal_payment_void
|
||||
end
|
||||
Rails.logger.debug "---------Paymal Payment Void response in VoidController"
|
||||
Rails.logger.debug membership_response.to_json
|
||||
|
||||
# For Print
|
||||
member_info = nil
|
||||
rebate_amount = nil
|
||||
current_balance = nil
|
||||
@@ -102,17 +99,6 @@ class Foodcourt::VoidController < BaseFoodcourtController
|
||||
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||
end
|
||||
|
||||
|
||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||
# get printer info
|
||||
# print_settings = PrintSetting.find_by_unique_code('ReceiptBillPdf') # SaleItemsPdf
|
||||
#
|
||||
# if !print_settings.nil?
|
||||
# unique_code = 'ReceiptBillPdf'
|
||||
# elsif
|
||||
# unique_code = 'ReceiptBillStarPdf'
|
||||
# end
|
||||
|
||||
customer= Customer.find(sale.customer_id)
|
||||
|
||||
# get member information
|
||||
|
||||
@@ -9,7 +9,7 @@ class Origami::RequestBillsController < ApplicationController
|
||||
# Print Request Bill and add to sale tables
|
||||
def print
|
||||
@shop = Shop.current_shop
|
||||
if !ShiftSale.current_shift(@shop.shop_code).nil?
|
||||
if !ShiftSale.current_shift.nil?
|
||||
order_id = params[:id] # order_id
|
||||
order = Order.find(order_id)
|
||||
booking = order.booking
|
||||
@@ -46,7 +46,7 @@ class Origami::RequestBillsController < ApplicationController
|
||||
sale_audit = SaleAudit.record_audit_sale(sale_data.sale_id,remark,action_by,type )
|
||||
|
||||
# Promotion Activation
|
||||
Promotion.promo_activate(sale_data,@shop.shop_code)
|
||||
Promotion.promo_activate(sale_data)
|
||||
|
||||
#bill channel
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
|
||||
@@ -320,7 +320,7 @@ class Origami::SplitBillController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
Promotion.promo_activate(sale_data,@shop.shop_code)
|
||||
Promotion.promo_activate(sale_data)
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
from = request.subdomain + "." + request.domain
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user