shop code

This commit is contained in:
Nweni
2019-12-04 13:57:26 +06:30
parent 7afddcdf2b
commit 8b5d28524e
18 changed files with 85 additions and 126 deletions

View File

@@ -18,13 +18,13 @@ class Transactions::SalesController < ApplicationController
if receipt_no.nil? && from.nil? && to.nil?
if @shift.blank?
@sales = Sale.where("NOT sale_status='new' and shop_code='#{@shop.shop_code}'").order("sale_id desc")
@sales = Sale.where("NOT sale_status='new'").order("sale_id desc")
else
@sales = Sale.where("NOT sale_status='new' and shift_sale_id ='#{@shift.id}' and shop_code='#{@shop.shop_code}'").order("sale_id desc")
@sales = Sale.where("NOT sale_status='new' and shift_sale_id ='#{@shift.id}'").order("sale_id desc")
end
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
else
sale = Sale.search(receipt_no,from,to,@shift).where("sales.shop_code='#{@shop.shop_code}'")
sale = Sale.search(receipt_no,from,to,@shift)
if sale.count > 0
@sales = sale
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20)
@@ -89,8 +89,8 @@ class Transactions::SalesController < ApplicationController
# GET /transactions/sales/1
# GET /transactions/sales/1.json
def show
@membership = MembershipSetting.find_by_shop_code(@shop.shop_code)
@payment_methods = PaymentMethodSetting.where("shop_code='#{@shop.shop_code}' and is_active='1'")
@membership = MembershipSetting.find_by_shop_code(Shop.current_shop.shop_code)
@payment_methods = PaymentMethodSetting.where("is_active='1'")
@sale = Sale.find(params[:id])
@order_items = []