Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adiciona a renderização dos valores de descontos/abatimentos nos campos devidos do boleto. #264

Merged
merged 5 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/brcobranca/boleto/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class Base
attr_accessor :cedente_endereco
# <b>OPCIONAL</b>: EMV para gerar QRCode para pagamento via PIX
attr_accessor :emv
# <b>OPCIONAL</b>: Descontos e abatimentos
attr_accessor :descontos_e_abatimentos

# Validações
validates_presence_of :agencia, :conta_corrente, :moeda, :especie_documento, :especie, :aceite, :nosso_numero,
Expand Down
9 changes: 8 additions & 1 deletion lib/brcobranca/boleto/template/rghost_bolepix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ def modelo_generico_cabecalho(doc, boleto)
move_more(doc, 5, 0)
doc.show boleto.valor_documento.to_currency

move_more(doc, -15, -1.3)
move_more(doc, -15.8, -0.75)
doc.show boleto.descontos_e_abatimentos&.to_currency

move_more(doc, 0.8, -0.55)
doc.show "#{boleto.sacado} - #{boleto.sacado_documento.formata_documento}"

move_more(doc, 0, -0.3)
Expand Down Expand Up @@ -234,6 +237,10 @@ def modelo_generico_rodape(doc, boleto)
move_more(doc, 10.1, 0)
doc.show boleto.valor_documento.to_currency

move_more(doc, 0, -0.8)
doc.show boleto.descontos_e_abatimentos&.to_currency

move_more(doc, 0, 0.8)
if boleto.instrucoes
doc.text_area boleto.instrucoes, width: '14 cm',
text_align: :left, x: "#{@x -= 15.8} cm",
Expand Down
Loading