shop_code

This commit is contained in:
Myat Zin Wai Maw
2019-12-05 14:56:47 +06:30
parent ccbd3c6966
commit b0f6368248
58 changed files with 95 additions and 26 deletions

View File

@@ -3,6 +3,7 @@ class Origami::CashInsController < BaseOrigamiController
end
def create
@shop = Shop.current_shop
reference = params[:reference]
remark = params[:remark]
amount = params[:amount]

View File

@@ -3,6 +3,7 @@ class Origami::CashOutsController < BaseOrigamiController
end
def create
@shop = Shop.current_shop
reference = params[:reference]
remark = params[:remark]
amount = params[:amount]

View File

@@ -9,7 +9,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
@creditcount = 0
others = 0
@shop = Shop.current_shop
@shop = Shop.current_shop
if @shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
@@ -33,7 +33,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
shop_details = Shop.current_shop
shop_details = Shop.current_shop
# rounding adjustment
# if shop_details.is_rounding_adj
# new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
@@ -49,6 +49,7 @@ class Origami::CreditPaymentsController < BaseOrigamiController
end
def create_credit_payment
@shop = Shop.current_shop
arr_sale = JSON.parse(params[:data])
if !ShiftSale.current_shift(@shop.shop_code).nil?
if !arr_sale.nil?

View File

@@ -46,6 +46,7 @@ class Origami::CustomersController < BaseOrigamiController
end
def add_customer
@shop = Shop.current_shop
@webview = false
if check_mobile
@webview = true
@@ -162,6 +163,7 @@ class Origami::CustomersController < BaseOrigamiController
end
def send_account
@shop = Shop.current_shop
amount = params[:amount]
account_no = params[:account_no]
receipt_no = params[:receipt_no]
@@ -178,7 +180,7 @@ class Origami::CustomersController < BaseOrigamiController
auth_token = member_actions.auth_token.to_s
membership_data = SalePayment.get_paypar_account_data(url,membership_setting.auth_token,merchant_uid,auth_token,account_no,amount,receipt_no)
puts membership_data.to_json
if membership_data["status"]==true
remark = "Payment by account no Receipt No #{sale.receipt_no} | Sale ID #{sale.sale_id} | Transaction ref: #{membership_data[:transaction_ref]} | Reload amount #{membership_data[:reload_amount]} | Old Balance Amount #{membership_data[:old_balance_amount]} | DateTime : #{membership_data[:date]}"
sale_audit = SaleAudit.record_audit_for_edit(sale.sale_id,sale.cashier_id, action_by,remark,"PAYBYACCOUNT" )

View File

@@ -114,7 +114,7 @@ def get_all_menu
end
def get_credit_sales
credit_sales = SalePayment.get_credit_sales(params,current_shop.shop_code)
credit_sales = SalePayment.get_credit_sales(params,Shop.current_shop.shop_code)
if !credit_sales.nil?
result = {:status=> true, :data=> credit_sales }
else

View File

@@ -3,6 +3,7 @@ class Origami::DiscountsController < BaseOrigamiController
#discount page show from origami index with selected order
def index
@shop = Shop.current_shop
# get printer info
@print_settings = PrintSetting.get_precision_delimiter()
@webview = false

View File

@@ -154,6 +154,7 @@ class Origami::FoodCourtController < ApplicationController
end
def get_all_product()
@shop = Shop.current_shop
@product = Product..where("shop_code='#{@shop.shop_code}'")
end

View File

@@ -3,6 +3,7 @@ class Origami::HomeController < BaseOrigamiController
before_action :set_dining, only: [:show]
def index
@shop = Shop.current_shop
@webview = check_mobile
@@ -19,6 +20,7 @@ class Origami::HomeController < BaseOrigamiController
# origami table detail
def show
@shop = Shop.current_shop
# get printer info
@print_settings = PrintSetting.get_precision_delimiter()
@webview = check_mobile

View File

@@ -10,6 +10,7 @@ class Origami::OrderReservationController < BaseOrigamiController
end
def update
@shop = Shop.current_shop
@id = params[:order_id]
@status = params[:status]
min_type = params[:min_type]
@@ -86,6 +87,7 @@ class Origami::OrderReservationController < BaseOrigamiController
end
def send_status
@shop = Shop.current_shop
order_reservation = OrderReservation.find_by_transaction_ref(params[:ref_no])
if !order_reservation.nil?
if !ShiftSale.current_shift(@shop.shop_code).nil? || params[:status] == 'accepted' || (order_reservation.status == 'new' && params[:status] == 'rejected')
@@ -105,6 +107,7 @@ class Origami::OrderReservationController < BaseOrigamiController
end
def check_receipt_bill
@shop = Shop.current_shop
receipt_bill = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of("order_reservation")
status = 0

View File

@@ -1,5 +1,6 @@
class Origami::PendingOrderController < BaseOrigamiController
def index
@shop = Shop.current_shop
# @dining= DiningFacility.where("status = 'occupied'")
# @order = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status = 'billed' and source = 'quick_service'",DateTime.now.strftime('%Y-%m-%d'))
@cashier_type = params[:type]
@@ -13,6 +14,7 @@ class Origami::PendingOrderController < BaseOrigamiController
end
def show
@shop = Shop.current_shop
id = params[:sale_id]
if id.start_with?("SAL")
@sale = Sale.find(id)
@@ -43,6 +45,7 @@ class Origami::PendingOrderController < BaseOrigamiController
end
def completed_sale
@shop = Shop.current_shop
@cashier_type = params[:type]
@sales = Sale.pending_sale(@cashier_type)
@orders = Sale.pending_order(@cashier_type)
@@ -78,6 +81,7 @@ class Origami::PendingOrderController < BaseOrigamiController
end
def credit_sale
@shop = Shop.current_shop
@cashier_type = params[:type]
@sales = Sale.pending_sale(@cashier_type)
@orders = Sale.pending_order(@cashier_type)

View File

@@ -8,6 +8,7 @@ class Origami::RequestBillsController < ApplicationController
end
# Print Request Bill and add to sale tables
def print
@shop = Shop.current_shop
if !ShiftSale.current_shift(@shop.shop_code).nil?
order_id = params[:id] # order_id
order = Order.find(order_id)

View File

@@ -13,12 +13,13 @@ class Origami::RoomsController < BaseOrigamiController
end
def show
@shop = Shop.current_shop
@webview = false
if check_mobile
@webview = true
end
@tables = Table.unscope(:order).all.active.order('status desc')
@rooms = Room.unscope(:order).all.active.order('status desc')
@complete = Sale.completed_sale("cashier")

View File

@@ -42,6 +42,7 @@ class Origami::ShiftsController < BaseOrigamiController
def update_shift
@shop = Shop.current_shop
closing_balance = params[:closing_balance]
shift_id = params[:shift_id]
@shift = ShiftSale.find_by_id(shift_id)

View File

@@ -84,6 +84,7 @@ class Origami::SplitBillController < BaseOrigamiController
end
def create
@shop = Shop.current_shop
cashier_type = params[:cashier_type]
order_ids = params[:order_ids]
arr_order_ids = nil

View File

@@ -1,5 +1,6 @@
class Origami::SurveysController < BaseOrigamiController
def new
@shop = Shop.current_shop
@webview = false
if check_mobile
@webview = true
@@ -38,6 +39,7 @@ class Origami::SurveysController < BaseOrigamiController
end
def create
@shop = Shop.current_shop
@type = params[:cashier_type]
@sale_id = params[:sale_id]
if params[:table_id].to_i>0

View File

@@ -2,7 +2,7 @@ class Origami::TableInvoicesController < BaseOrigamiController
def index
@table = DiningFacility.find(params[:table_id])
shop = Shop.current_shop
@shop = Shop.current_shop
@sale_array = Array.new
@table.bookings.each do |booking|
@@ -33,7 +33,7 @@ class Origami::TableInvoicesController < BaseOrigamiController
@membership = MembershipSetting::MembershipSetting
@payment_methods = PaymentMethodSetting.all
shop = Shop.current_shop
@shop = Shop.current_shop
@sale_array = Array.new
@table.bookings.each do |booking|
if booking.sale_id.nil?

View File

@@ -1,7 +1,7 @@
class Origami::VoidController < BaseOrigamiController
authorize_resource :class => false
def overall_void
@shop = Shop.current_shop
sale_id = params[:sale_id]
remark = params[:remark]
order_source = params[:type] #tax profile source

View File

@@ -1,6 +1,6 @@
class Origami::WasteSpoileController < BaseOrigamiController
def waste_and_spoilage
@shop = Shop.current_shop
sale_id = params[:sale_id]
remark = params[:remark]
order_source = params[:type]