Skip to content

Conversation

@yostashiro
Copy link
Member

@yostashiro yostashiro commented Dec 29, 2025

This module extends Japan Summary Invoice to support carryover amount tracking
for recurring billing cycles.

It adds the following fields to billings:

  • Previous Billed Amount: Total from the previous billing period
  • Payment Amount: Payments received against the previous billing
  • Carryover Amount: Outstanding balance carried forward
  • Total Billed Amount: Carryover plus current purchases

Manual override fields are available to adjust values when needed.

The visibility of carryover amounts in the report can be controlled at
company, partner, and billing levels.

Depends on #63

@qrtl QT6214

@yostashiro yostashiro force-pushed the 18.0-add-l10n_jp_summary_invoice_carryover branch 3 times, most recently from 736da93 to 5b4e35f Compare December 30, 2025 16:44
@yostashiro yostashiro marked this pull request as ready for review December 30, 2025 16:46
@yostashiro
Copy link
Member Author

In terms of the report presentation, highlighted parts are added/adjusted by this module.
image


class TestSummaryInvoiceCarryover(TransactionCase):
@classmethod
def setUpClass(cls):
Copy link
Member Author

Choose a reason for hiding this comment

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

@AungKoKoLin1997 We can reuse the setup of l10n_jp_summary_invoice if we refactor the code there. It's not a must-do now, but we want to work on it at some point.

@yostashiro yostashiro force-pushed the 18.0-add-l10n_jp_summary_invoice_carryover branch from 5b4e35f to ca0bba9 Compare January 5, 2026 12:55
Comment on lines 131 to 133
rec.prev_billed_amount_manual
if rec.use_prev_billed_amount_manual
else rec.prev_billed_amount
Copy link
Member Author

Choose a reason for hiding this comment

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

A little helper method would be nice, so it can be used here and also in the report template.

Comment on lines 136 to 138
rec.payment_amount_manual
if rec.use_payment_amount_manual
else rec.payment_amount
Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above, but I'm not sure there should be a shared method or two separate ones.

Copy link
Contributor

Choose a reason for hiding this comment

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

I decided to use two separate methods to keep simple.

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 18.0-add-l10n_jp_summary_invoice_carryover branch from 62b8d2d to eb1adab Compare January 7, 2026 10:10
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 18.0-add-l10n_jp_summary_invoice_carryover branch from eb1adab to 98e5824 Compare January 7, 2026 10:19
Copy link
Contributor

@AungKoKoLin1997 AungKoKoLin1997 left a comment

Choose a reason for hiding this comment

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

Code and functional Test: LGTM

compute="_compute_prev_billing_candidate_ids",
)
use_prev_billed_amount_manual = fields.Boolean(
string="Use Manual Previous Billed Amount",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
string="Use Manual Previous Billed Amount",
string="Use Manual Previous Billed Amount",
default=False,

I think manual entry should have default=False.

Copy link
Contributor

Choose a reason for hiding this comment

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

The default value of boolean field is False, no?
I don't think we need to use default attribute.

Copy link
Contributor

Choose a reason for hiding this comment

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

I seem to have misunderstood a little.
But when I validate the billing record, this boolean field will be True.

2026-01-09_10h32_51

Could you check this behabior?

Copy link
Member Author

Choose a reason for hiding this comment

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

@kanda999 That is intentional to "lock" the amounts. Otherwise the amounts (especially the payment amount) will show different figures when PDF is printed later. You may suggest an update to the readme. ;)

help="Total billed amount from the previous billing.",
)
use_payment_amount_manual = fields.Boolean(
string="Use Manual Payment Amount",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
string="Use Manual Payment Amount",
string="Use Manual Payment Amount",
default=False,

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

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