Skip to content

feat(orders): an order placed by staff charges the product's setup fee - #447

Merged
Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:feat/admin-order-setup-fee
Nov 16, 2026
Merged

Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:feat/admin-order-setup-fee

Conversation

@ertugrulkeyvan

Copy link
Copy Markdown
Contributor

What was wrong

The new order form in the admin area left the product's setup fee out. A plan sold at "10 a month plus 25 setup" was billed 35 when the customer ordered it and 10 when staff placed the same order for them. This is the follow-up promised in #411.

What changes

  • The form charges the setup fee as the shop does: a line of its own on the first invoice, taxed as the product is, never repeated on a renewal.
  • A box on the form, ticked by default, lets staff leave it off, because a sale agreed on the phone often waives it.
  • The fee is the one for the billing cycle chosen, and it is added to a price staff set themselves too. A product without a setup fee adds nothing.

One new text (admin.orders.new_setup_fee), in all nine languages. No migration, no setting.

Not in this PR

The API AddOrder still places orders without the setup fee. Adding it there changes what existing integrations are billed, so it wants a parameter and a decision on the default. I can follow up.

Tests

AdminOrderSetupFeeTest (6): charged as its own line; charged when the field is not sent; left off when the box is cleared; added to a staff-set price; nothing for a product without a fee; the box is on the form, ticked. Full suite run in two halves.

The new order form left the setup fee out, so a plan sold at '10 a month
plus 25 setup' was billed 10 when staff raised it and 35 when the
customer ordered it. The form now charges it as the shop does, with a
box staff can clear when the sale waives it.
@Panelica
Panelica merged commit d8bab03 into Panelica:main Nov 16, 2026
1 check passed
@Panelica

Copy link
Copy Markdown
Owner

Merged — thank you. "The same plan billed 35 to a customer and 10 to staff" is exactly the kind of difference nobody notices until the accounts are reconciled.

Measured before it went in:

  • processOrder() already reads setup_fee and writes it as its own Setup line, taxed as the product, never repeated on a renewal — so the form was the only thing missing, and nothing new had to be invented for the invoice.
  • Four of your six tests fail on main and pass here, including the one for the field not being sent at all — which is the case an older form or a script would hit.
  • The box ticked by default with the hidden 0 before it follows the pattern the rest of the admin forms use, so an unticked box really arrives as 0.
  • One new string in nine languages; all five required ones carry it. Full suite on the merge result: 5426 passed, 0 failed.

Noting your "not in this PR" for the record: the API AddOrder still places orders without the fee, and that one does need a parameter and a default decided, because it changes what existing integrations are billed. Worth doing as its own change with that decision written down.

Merging is not shipping: this reaches installations with the next release.

@Panelica

Copy link
Copy Markdown
Owner

Released in 1.29.0 — thank you.

Gates on the tag: the full suite 5426 passed, 0 failed; the update lab's 14 scenarios green on a run of its own; the real package updating 1.28.0 on the stable channel and the last beta on the beta channel.

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.

2 participants