merge with master

This commit is contained in:
Yan
2017-12-15 10:36:43 +06:30
30 changed files with 218 additions and 99 deletions

View File

@@ -1,20 +1,15 @@
class Origami::CheckInProcessController < BaseOrigamiController
def check_in_process
dining_charge = DiningCharge.select('charge_type','charge_block')
.where('dining_facility_id = ?',params[:dining_id])
.first()
lookup_checkout_time = Lookup.collection_of("checkout_time")
checkout_at = Time.now.utc
if !dining_charge.nil?
hr = (dining_charge.charge_block.utc.strftime("%H").to_i).to_int
min = (dining_charge.charge_block.utc.strftime("%M").to_i).to_int
# if dining_charge.charge_type == 'hr'
checkout_at = checkout_at + hr.hour + min.minutes
# else
# end
if !lookup_checkout_time.nil?
if lookup_checkout_time[0][0] == 'hr'
checkout_at = checkout_at + (lookup_checkout_time[0][1]).to_i.hour
else
checkout_at = checkout_at + (lookup_checkout_time[0][1]).to_i.minutes
end
end
@dining_facility = DiningFacility.find(params[:dining_id])
@dining_facility.status = "occupied"

View File

@@ -44,7 +44,7 @@ class Origami::PaymentsController < BaseOrigamiController
# printer = Printer::ReceiptPrinter.new(print_settings)
# printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_details, "Frt")
# printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_details, "Frt")
end
def create
@@ -264,8 +264,13 @@ class Origami::PaymentsController < BaseOrigamiController
# item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
# discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
<<<<<<< HEAD
# printer = Printer::ReceiptPrinter.new(print_settings)
# printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC")
=======
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC",nil)
>>>>>>> master
end
end

View File

@@ -5,6 +5,10 @@ class Origami::SalesController < BaseOrigamiController
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
@orders = Order.all.order('date desc')
@sale = Sale.find(params[:sale_id])
@order = SaleOrder.find_by_sale_id(@sale.sale_id).order_id
@booking = BookingOrder.find_by_order_id(@order).booking_id
@table_id = Booking.find(@booking).dining_facility_id
@dining = DiningFacility.find(@table_id)
end
def add_to_existing_invoice