Alteração Para uso dos Usuarios
This commit is contained in:
@@ -24,12 +24,13 @@ class ConsolidacaoMotorista < ApplicationRecord
|
||||
pago_em.present?
|
||||
end
|
||||
|
||||
def marcar_pago!(user, forma:)
|
||||
update!(pago_em: Time.current, pago_por: user&.id, forma_pagamento: forma)
|
||||
def marcar_pago!(user, forma:, nota_fiscal:)
|
||||
update!(pago_em: Time.current, pago_por: user&.id, forma_pagamento: forma,
|
||||
nota_fiscal: nota_fiscal)
|
||||
end
|
||||
|
||||
def cancelar_pagamento!(_user)
|
||||
update!(pago_em: nil, pago_por: nil, forma_pagamento: nil)
|
||||
update!(pago_em: nil, pago_por: nil, forma_pagamento: nil, nota_fiscal: nil)
|
||||
end
|
||||
|
||||
def recalcular_valor
|
||||
|
||||
@@ -65,7 +65,7 @@ class User < ApplicationRecord
|
||||
admin? || gerente? || operador?
|
||||
end
|
||||
|
||||
# Token de login rápido via QR Code (holerite) — Fase 7/8
|
||||
# Token de login rápido via QR Code (extrato) — Fase 7/8
|
||||
def regenerar_login_token!
|
||||
update!(login_token: SecureRandom.urlsafe_base64(24))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user