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

[16.0] Add module l10n_ch_credit_control_dunning_fees_qr_report #737

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

grindtildeath
Copy link
Contributor

This module will ensure dunning fees are considered when generating swiss
QR-bill from credit control lines.

Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocking remarks. Pre-approving.
Any chance to have tests?

Comment on lines +21 to +24
invoices = self.env["account.move"].browse(docids)
for invoice in invoices:
if invoice.id not in dunning_fees_qr_amounts:
continue

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
invoices = self.env["account.move"].browse(docids)
for invoice in invoices:
if invoice.id not in dunning_fees_qr_amounts:
continue
invoices = self.env["account.move"].browse(list(dunning_fees_qr_amounts.keys()))
for invoice in invoices:

You know already the ones to browse no?

Comment on lines +12 to +17
if self.id in qr_dunning_fees_amounts:
return "{:,.2f}".format(qr_dunning_fees_amounts[self.id]).replace(
",", "\xa0"
)
else:
return "{:,.2f}".format(self.amount_residual).replace(",", "\xa0")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self.id in qr_dunning_fees_amounts:
return "{:,.2f}".format(qr_dunning_fees_amounts[self.id]).replace(
",", "\xa0"
)
else:
return "{:,.2f}".format(self.amount_residual).replace(",", "\xa0")
if self.id in qr_dunning_fees_amounts:
return "{:,.2f}".format(qr_dunning_fees_amounts[self.id]).replace(
",", "\xa0"
)
return "{:,.2f}".format(self.amount_residual).replace(",", "\xa0")

any comment to explain why this is needed?

report_ref, data, res_ids=res_ids
)

collected_streams = OrderedDict()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move to a separate method like _pdf_prepare_streams_cc_dunning_fees?

@grindtildeath
Copy link
Contributor Author

@simahawk Out of moving class to its dedicated file, I would prefer keeping code as it to avoid any unforeseen issue since it's been working in production for a while.

Also I'm not the original author, most of the code was from @ajaniszewska-dev , so I cannot necessarily answer all these questions.

A test would be good yes.

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants