shift open/close
This commit is contained in:
15
app/controllers/origami/cash_ins_controller.rb
Normal file
15
app/controllers/origami/cash_ins_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class Origami::CashInsController < BaseOrigamiController
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
reference = params[:reference]
|
||||
remark = params[:remark]
|
||||
amount = params[:amount]
|
||||
payment_method = params[:payment_method]
|
||||
payment_method_reference = params[:payment_method_reference]
|
||||
p_jour = PaymentJournal.new
|
||||
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user.id)
|
||||
end
|
||||
end
|
||||
13
app/controllers/origami/cash_outs_controller.rb
Normal file
13
app/controllers/origami/cash_outs_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class Origami::CashOutsController < BaseOrigamiController
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
reference = params[:reference]
|
||||
remark = params[:remark]
|
||||
amount = params[:amount]
|
||||
p_jour = PaymentJournal.new
|
||||
p_jour.cash_out(reference, remark, amount, current_user.id)
|
||||
end
|
||||
end
|
||||
@@ -6,6 +6,7 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
# @shift = ShiftSale.current_open_shift(current_user.id)
|
||||
end
|
||||
|
||||
# origami table detail
|
||||
|
||||
@@ -38,7 +38,7 @@ class Origami::RequestBillsController < BaseOrigamiController
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info,shop_details)
|
||||
# printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, item_price_by_accounts,member_info,shop_details)
|
||||
# redirect_to origami_path(@sale_data.sale_id)
|
||||
|
||||
end
|
||||
|
||||
@@ -4,10 +4,11 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def show
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
end
|
||||
|
||||
def new
|
||||
@float = Lookup.where('lookup_type=?','float')
|
||||
@float = Lookup.where('lookup_type=?','float_value')
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -16,6 +17,14 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
@shift.create(opening_balance,current_user)
|
||||
end
|
||||
|
||||
def update_shift
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
if @shift
|
||||
@shift.shift_closed_at = DateTime.now.utc
|
||||
@shift.save
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user