Files
FOSSBilling/tests/Support
Adam Daley 340687bd6c Show discounted payment amount on client order details page (#4114)
* Show discounted payment amount on client order details page

Mirrors the existing admin-side order details table: when an order
has a discount, show 'Order Discount' and 'Payment Amount After
Discount' rows alongside the full 'Payment Amount'.

Fixes #1723

* Classify PermissiveStub arithmetic TypeErrors as test-infra

The new discount rows in mod_order_manage.html.twig (client) do
`order.total - order.discount` directly, same as the existing admin
template. Under the strict-variables render-everything harness, both
resolve to PermissiveStub when unspecified, and PHP has no operator
overloading for arithmetic on plain objects, so this throws
'Unsupported operand types'.

This is the same class of stub-coercion artifact as the existing
'must be of type float/int' and 'Return value must be of type'
entries above it, not a real template bug.

* Require PermissiveStub in the operand-type message before downgrading

Per CodeRabbit review: the previous check matched any 'Unsupported
operand types' TypeError, which would also swallow a genuine
arithmetic bug elsewhere in a template as test-infra. PHP's TypeError
message includes the operand class names, so requiring
PermissiveStub::class in the message keeps the downgrade scoped to
the actual stub-coercion case.

(cherry picked from commit 195921a32d)
2026-08-16 20:05:58 +01:00
..