changes in verification
This commit is contained in:
@@ -4,10 +4,10 @@ class Api::VerificationsController < ActionController::API
|
|||||||
phone_number = params[:phone_number]
|
phone_number = params[:phone_number]
|
||||||
|
|
||||||
#TODO - user generate
|
#TODO - user generate
|
||||||
@cus = Customer.new
|
cus = Customer.new
|
||||||
@cus.draft_customer(phone_number, rand(1000..9999))
|
@cus = cus.draft_customer(phone_number, rand(1000..9999))
|
||||||
if @cus.verify_status == false
|
if @cus.verify_status == false
|
||||||
# VerifyNumber.send_message(phone_number, @cus.pin_code)
|
VerifyNumber.send_message(phone_number, @cus.pin_code)
|
||||||
@result = true
|
@result = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,10 +9,11 @@ class Origami::CashInsController < BaseOrigamiController
|
|||||||
payment_method = params[:payment_method]
|
payment_method = params[:payment_method]
|
||||||
payment_method_reference = params[:payment_method_reference]
|
payment_method_reference = params[:payment_method_reference]
|
||||||
type = params[:type]
|
type = params[:type]
|
||||||
|
|
||||||
p_jour = PaymentJournal.new
|
p_jour = PaymentJournal.new
|
||||||
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user.id)
|
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user.id)
|
||||||
|
|
||||||
shift = ShiftSale.current_open_shift(current_user.id)
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
|
|
||||||
current_shift = ShiftSale.current_shift
|
current_shift = ShiftSale.current_shift
|
||||||
|
|
||||||
# set cashier
|
# set cashier
|
||||||
@@ -20,19 +21,21 @@ class Origami::CashInsController < BaseOrigamiController
|
|||||||
shift = shift
|
shift = shift
|
||||||
else
|
else
|
||||||
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
open_cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||||
if open_cashier.count>0
|
|
||||||
|
if open_cashier.count > 0
|
||||||
|
|
||||||
shift = ShiftSale.current_open_shift(open_cashier[0].id)
|
shift = ShiftSale.current_open_shift(open_cashier[0].id)
|
||||||
|
|
||||||
if shift
|
if shift
|
||||||
shift = ShiftSale.current_open_shift(shift.id)
|
shift = ShiftSale.current_open_shift(shift.id)
|
||||||
else
|
else
|
||||||
shift = ShiftSale.current_open_shift(current_shift.id)
|
shift = ShiftSale.current_open_shift(current_shift.id)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
shift = Employee.find(current_shift.employee_id).name
|
|
||||||
|
|
||||||
end
|
shift = Employee.find(current_shift.employee_id).name
|
||||||
|
#shift = current_shift
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shift.cash_in = shift.cash_in + amount.to_f
|
shift.cash_in = shift.cash_in + amount.to_f
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Customer < ApplicationRecord
|
|||||||
self.name = "User " + pin.to_s
|
self.name = "User " + pin.to_s
|
||||||
self.contact_no = phone
|
self.contact_no = phone
|
||||||
self.email = pin.to_s + "@gmail.com"
|
self.email = pin.to_s + "@gmail.com"
|
||||||
self.pin_code = pin
|
self.pin_code = pin.to_s
|
||||||
self.pin_sent_at = Time.now
|
self.pin_sent_at = Time.now
|
||||||
self.save
|
self.save
|
||||||
return self
|
return self
|
||||||
|
|||||||
Reference in New Issue
Block a user