This commit is contained in:
Myat Zin Wai Maw
2020-02-26 13:13:18 +06:30
parent a29b1551a0
commit 16d76749af
20 changed files with 52 additions and 53 deletions

View File

@@ -130,7 +130,7 @@ class Api::PaymentsController < Api::ApiController
other_amount = SaleItem.calculate_other_charges(sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,sale,params[:card_no], item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, 'Paid',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,sale,params[:account_no], item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, 'Paid',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
render json: JSON.generate({:status => true, :balance_amount => card_balance_amount,:receipt_no => sale.receipt_no,:order_no => latest_order_no, :message => "complete", :paid_amount => sale.grand_total})
end
end

View File

@@ -48,7 +48,7 @@ class Foodcourt::FoodCourtController < ApplicationController
.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("sales.sale_status =? and sales.payment_status =? and orders.source='app' and DATE(bookings.created_at)=?",'completed','paid',Date.today).order("bookings.created_at desc").uniq.length
.where("bookings.booking_status !=? and sales.sale_status =? and sales.payment_status =? and orders.source='app' and DATE(bookings.created_at)=?",'completed','completed','paid',Date.today).order("bookings.created_at desc").uniq.length
render "foodcourt/addorders/detail"
end