The member's invoice list and invoice page show Stripe's invoice-level period, not the period the invoice pays for #293

Closed
opened 2026-10-30 00:40:03 +00:00 by cgalo5758 · 1 comment
Owner

What happens

The Billing page's Period column and the invoice page show each invoice's period_start and period_end as Stripe sends them on the invoice. For a subscription invoice that is not the service period: a purchase's invoice reads "Oct 29, 2026 – Oct 29, 2026" for a month that runs to Nov 29, a mid-period upgrade's invoice spans the minutes between two changes, and Stripe documents that a renewal's invoice period looks back one period. The period each line pays for is on the invoice's lines, which the console already stores. The demo does not show it, because its seeded invoices carry full-month periods.

What should happen

An invoice shows the period its lines pay for.

Where

formatInvoicePeriod and its two callers, internal/server/member_invoices.go; the invoice period stored in internal/integrations/stripe/workflows/invoice_reconcile.go

Why it matters

Every invoice a member pays shows a period that is not the one they paid for.

### What happens The Billing page's Period column and the invoice page show each invoice's `period_start` and `period_end` as Stripe sends them on the invoice. For a subscription invoice that is not the service period: a purchase's invoice reads "Oct 29, 2026 – Oct 29, 2026" for a month that runs to Nov 29, a mid-period upgrade's invoice spans the minutes between two changes, and Stripe documents that a renewal's invoice period looks back one period. The period each line pays for is on the invoice's lines, which the console already stores. The demo does not show it, because its seeded invoices carry full-month periods. ### What should happen An invoice shows the period its lines pay for. ### Where `formatInvoicePeriod` and its two callers, `internal/server/member_invoices.go`; the invoice period stored in `internal/integrations/stripe/workflows/invoice_reconcile.go` ### Why it matters Every invoice a member pays shows a period that is not the one they paid for.
cgalo5758 added this to the Public launch milestone 2026-10-30 00:40:03 +00:00
cgalo5758 added the
kind
bug
area/billingarea/member-ui
labels 2026-10-30 00:40:03 +00:00
Author
Owner

The member's Billing page, the member's invoice page and the operator's invoice page now show the period an invoice's lines pay for. Until now they showed the period Stripe sets on the invoice itself, which Stripe defines as the span in which the invoice's items were added and which looks back one period on a subscription invoice: a purchase's began and ended on the day of the purchase, and a renewal's was the month that had just ended. Each line of an invoice carries the service period it bills, and the console already stores the lines it reads back from Stripe. An invoice's period now runs from the earliest start to the latest end of its stored lines, leaving out credits (a negative line, such as the unused time an upgrade returns, which the invoice does not pay for), a line of zero beside a charge (such as the credit of an upgrade from a $0 price) and lines whose period is a single moment (an invoice item given no period of its own); an invoice whose lines are all zero, such as one for a free price, shows their period. A monthly plan bought on Oct 29, 2026 reads "Oct 29, 2026 – Nov 29, 2026", and an upgrade to a yearly price reads the year that starts at the upgrade. An invoice with no such line, such as one whose lines all use prices the console did not create, shows "—", the console's mark for a value it does not have. If the lines cannot be read, the invoice pages show that mark too, and the Billing page shows its load error, rather than a period worked out from nothing. The pages compute the period each time they are read, so every invoice already stored shows it, with no migration. The console still stores Stripe's own invoice period and shows it nowhere. The demo database's invoices now carry Stripe's invoice period beside their lines, as a real deployment's do. Tests check the rule case by case and the period on each of the three pages.

Commit: c7741fa5

The member's Billing page, the member's invoice page and the operator's invoice page now show the period an invoice's lines pay for. Until now they showed the period Stripe sets on the invoice itself, which Stripe defines as the span in which the invoice's items were added and which looks back one period on a subscription invoice: a purchase's began and ended on the day of the purchase, and a renewal's was the month that had just ended. Each line of an invoice carries the service period it bills, and the console already stores the lines it reads back from Stripe. An invoice's period now runs from the earliest start to the latest end of its stored lines, leaving out credits (a negative line, such as the unused time an upgrade returns, which the invoice does not pay for), a line of zero beside a charge (such as the credit of an upgrade from a $0 price) and lines whose period is a single moment (an invoice item given no period of its own); an invoice whose lines are all zero, such as one for a free price, shows their period. A monthly plan bought on Oct 29, 2026 reads "Oct 29, 2026 – Nov 29, 2026", and an upgrade to a yearly price reads the year that starts at the upgrade. An invoice with no such line, such as one whose lines all use prices the console did not create, shows "—", the console's mark for a value it does not have. If the lines cannot be read, the invoice pages show that mark too, and the Billing page shows its load error, rather than a period worked out from nothing. The pages compute the period each time they are read, so every invoice already stored shows it, with no migration. The console still stores Stripe's own invoice period and shows it nowhere. The demo database's invoices now carry Stripe's invoice period beside their lines, as a real deployment's do. Tests check the rule case by case and the period on each of the three pages. Commit: c7741fa5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#293