Skip to content

Pdf invoice generator for business registry#2918

Merged
vohmar merged 8 commits intomasterfrom
pdf-invoice-generator-for-business-registry
May 4, 2026
Merged

Pdf invoice generator for business registry#2918
vohmar merged 8 commits intomasterfrom
pdf-invoice-generator-for-business-registry

Conversation

@OlegPhenomenon
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 1
URL https://registry1-dev.cloud.tld.ee
Namespace registry1-dev

(Environment ready for testing)

@OlegPhenomenon OlegPhenomenon marked this pull request as draft April 22, 2026 09:19
@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 1
URL https://registry1-dev.cloud.tld.ee
Namespace registry1-dev

(Environment ready for testing)

2 similar comments
@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 1
URL https://registry1-dev.cloud.tld.ee
Namespace registry1-dev

(Environment ready for testing)

@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 1
URL https://registry1-dev.cloud.tld.ee
Namespace registry1-dev

(Environment ready for testing)

@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 2
URL https://registry2-dev.cloud.tld.ee
Namespace registry2-dev

(Environment ready for testing)

@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 2
URL https://registry2-dev.cloud.tld.ee
Namespace registry2-dev

(Environment ready for testing)

@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 2
URL https://registry2-dev.cloud.tld.ee
Namespace registry2-dev

(Environment ready for testing)

@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 2
URL https://registry2-dev.cloud.tld.ee
Namespace registry2-dev

(Environment ready for testing)

@OlegPhenomenon OlegPhenomenon marked this pull request as ready for review April 24, 2026 05:45
@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 1
URL https://registry1-dev.cloud.tld.ee
Namespace registry1-dev

(Environment ready for testing)

2 similar comments
@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 1
URL https://registry1-dev.cloud.tld.ee
Namespace registry1-dev

(Environment ready for testing)

@github-actions
Copy link
Copy Markdown

🚀 Deploy Complete!

Property Value
App registry
Slot 1
URL https://registry1-dev.cloud.tld.ee
Namespace registry1-dev

(Environment ready for testing)

@vohmar
Copy link
Copy Markdown
Contributor

vohmar commented May 4, 2026

Codex review:

app/models/reserve_domain_invoice/pdf_generator.rb
The PDF total does not match the amount that is actually created in billing. create_invoice_with_domains sends domain_names.count * DEFAULT_AMOUNT as the invoice total, but this PDF generator treats the same row prices as VAT-exclusive and adds Setting.registry_vat_prc on top. For example, with the default VAT setting of 0.2, a one-domain reservation billed at 10.00 will be rendered in the PDF as 12.00. We should either align the billing amount and PDF calculation, or treat DEFAULT_AMOUNT consistently as VAT-inclusive and split VAT out from that total.

app/controllers/api/v1/business_registry/reserved_domains_invoice_pdf_controller.rb
For an official invoice PDF, amount_paid should not come from request params. The caller can currently make the PDF show any paid amount or overpayment, even though invoice_state only verifies that the invoice is paid. This should be derived from billing data or from the stored invoice/payment record so the rendered payment amount cannot differ from the actual transaction.

…billing amount. DEFAULT_AMOUNT is treated as VAT-inclusive (gross), with net price and VAT derived from it. Remove amount_paid from request params to prevent caller from controlling the rendered payment amount on an official invoice
@vohmar vohmar merged commit 1c1f234 into master May 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants