Correção do QR do holerite entre outras coisas
This commit is contained in:
@@ -55,6 +55,40 @@ module Pdf
|
||||
"R$ #{format('%.2f', v.to_f)}".gsub('.', ',')
|
||||
end
|
||||
|
||||
# Bloco de assinaturas lado a lado: motorista (esquerda) e administrador
|
||||
# (direita). Garante espaço criando nova página se o rodapé estiver perto.
|
||||
def assinaturas(motorista: nil)
|
||||
@pdf.start_new_page if @pdf.cursor < 120
|
||||
@pdf.move_down 60
|
||||
|
||||
metade = (@pdf.bounds.width - 40) / 2.0
|
||||
topo = @pdf.cursor
|
||||
|
||||
@pdf.stroke_color '000000'
|
||||
@pdf.line_width 0.7
|
||||
@pdf.stroke_horizontal_line 0, metade, at: topo
|
||||
@pdf.stroke_horizontal_line metade + 40, @pdf.bounds.width, at: topo
|
||||
|
||||
@pdf.move_down 8
|
||||
linha_nome = @pdf.cursor
|
||||
@pdf.fill_color '000000'
|
||||
@pdf.text_box(motorista.presence || 'Motorista',
|
||||
at: [0, linha_nome], width: metade, size: 9, style: :bold, align: :center)
|
||||
@pdf.text_box('Reem Transporte',
|
||||
at: [metade + 40, linha_nome], width: metade, size: 9, style: :bold, align: :center)
|
||||
|
||||
@pdf.move_down 14
|
||||
linha_rotulo = @pdf.cursor
|
||||
@pdf.fill_color CINZA
|
||||
@pdf.text_box('Assinatura do Motorista',
|
||||
at: [0, linha_rotulo], width: metade, size: 8, align: :center)
|
||||
@pdf.text_box('Assinatura do Administrador',
|
||||
at: [metade + 40, linha_rotulo], width: metade, size: 8, align: :center)
|
||||
|
||||
@pdf.fill_color '000000'
|
||||
@pdf.move_down 24
|
||||
end
|
||||
|
||||
def secao(titulo)
|
||||
@pdf.move_down 14
|
||||
@pdf.fill_color LARANJA
|
||||
|
||||
Reference in New Issue
Block a user