changes in verification

This commit is contained in:
Nweni
2019-11-22 18:03:41 +06:30
parent 2c5e3a11e5
commit 3b468b78f4
4 changed files with 14 additions and 11 deletions

View File

@@ -4,10 +4,10 @@ class Api::VerificationsController < ActionController::API
phone_number = params[:phone_number]
#TODO - user generate
@cus = Customer.new
@cus.draft_customer(phone_number, rand(1000..9999))
cus = Customer.new
@cus = cus.draft_customer(phone_number, rand(1000..9999))
if @cus.verify_status == false
# VerifyNumber.send_message(phone_number, @cus.pin_code)
VerifyNumber.send_message(phone_number, @cus.pin_code)
@result = true
end
end

View File

@@ -9,10 +9,11 @@ class Origami::CashInsController < BaseOrigamiController
payment_method = params[:payment_method]
payment_method_reference = params[:payment_method_reference]
type = params[:type]
p_jour = PaymentJournal.new
p_jour.cash_in(reference, remark, amount, payment_method, payment_method_reference, current_user.id)
shift = ShiftSale.current_open_shift(current_user.id)
current_shift = ShiftSale.current_shift
# set cashier
@@ -20,19 +21,21 @@ class Origami::CashInsController < BaseOrigamiController
shift = shift
else
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)
if shift
shift = ShiftSale.current_open_shift(shift.id)
else
else
shift = ShiftSale.current_open_shift(current_shift.id)
end
else
shift = Employee.find(current_shift.employee_id).name
end
else
end
shift = Employee.find(current_shift.employee_id).name
#shift = current_shift
end
end
shift.cash_in = shift.cash_in + amount.to_f

View File

@@ -23,7 +23,7 @@ class Customer < ApplicationRecord
self.name = "User " + pin.to_s
self.contact_no = phone
self.email = pin.to_s + "@gmail.com"
self.pin_code = pin
self.pin_code = pin.to_s
self.pin_sent_at = Time.now
self.save
return self

BIN
dump.rdb

Binary file not shown.