shop code

This commit is contained in:
Myat Zin Wai Maw
2019-11-22 18:24:02 +06:30
parent 5a3f328789
commit d1ab2c194d
106 changed files with 834 additions and 895 deletions

View File

@@ -9,16 +9,16 @@ class Transactions::BookingsController < ApplicationController
to = params[:to]
if filter.nil? && from.nil? && to.nil?
@bookings = Booking.all.order("sale_id desc")
@bookings = Booking.where("shop_code='#{@shop.shop_code}'").order("sale_id desc")
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(20)
else
booking = Booking.search(filter,from,to)
booking = Booking.search(filter,from,to).where("bookings.shop_code='#{@shop.shop_code}'")
if booking.count > 0
@bookings = booking
@bookings = booking
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(20)
else
@bookings = 0
end
end
end
@receipt_no = filter
@from = from
@@ -33,7 +33,7 @@ class Transactions::BookingsController < ApplicationController
# GET /transactions/bookings/1
# GET /transactions/bookings/1.json
def show
@booking = Booking.find(params[:id])
@order = nil
@order_items = []
@@ -45,7 +45,7 @@ class Transactions::BookingsController < ApplicationController
end
if @booking.sale_id.present?
@sale = Sale.find(@booking.sale_id)
end
end
respond_to do |format|
format.html # show.html.erb

View File

@@ -89,8 +89,8 @@ class Transactions::SalesController < ApplicationController
# GET /transactions/sales/1
# GET /transactions/sales/1.json
def show
@membership = MembershipSetting::MembershipSetting
@payment_methods = PaymentMethodSetting.where("is_active='1'")
@membership = MembershipSetting.find_by_shop_code(@shop.shop_code)
@payment_methods = PaymentMethodSetting.where("shop_code='#{@shop.shop_code}' and is_active='1'")
@sale = Sale.find(params[:id])
@order_items = []