Apply a discount from payment
Apply a percentage or fixed GBP discount to eligible unpaid ticket lines from the advanced POS payment screen, then review the recalculated ticket before taking payment.
In this article
Use this flow when floor staff or a supervisor needs to adjust a ticket before charging it, without leaving the POS payment context.
The discount is applied to selected unpaid ticket lines. Antylogic recalculates the affected line totals and the ticket total, while existing payments remain unchanged.
Before you start
- For the GB demo, work in Harbor Demo Group with Harbor Soho selected.
- Open the advanced POS payment screen for the target ticket with `ticketId`, `terminalId`, `staffId` and `sourceTab=floor`.
- The operator needs `tpv:use` to load the payment screen, plus `tpv:discount` or `tickets:manage` to apply a positive discount.
- The ticket must belong to the selected location, must not be void, and must contain at least one unpaid line.
- At least one selected ticket line must have a pending amount and no paid amount allocated in the UI.
Instructions
- 1.
Open the payment screen
Open the advanced POS payment route for the ticket. The screen loads the ticket, payment methods, payment operations and staff context for the selected location.
- 2.
Select eligible lines
Select the whole ticket lines that should receive the discount. Partial unit selection does not reduce the discount base; the app works from each selected line total.
- 3.
Open Apply discount
Use `Apply discount` to open the discount modal. The modal shows percentage and GBP amount modes, presets, the numeric input, the eligible lines summary and the maximum discountable amount.
- 4.
Enter the discount
Choose a percentage preset such as `10%`, or switch to amount mode and enter a positive GBP value. Amount discounts are capped to the current total of the eligible selected lines.
- 5.
Confirm the discount
Confirm the modal. Percentage discounts are calculated from each eligible line current total; amount discounts are distributed proportionally across the eligible lines.
- 6.
Review the result
Wait for the success state, then check that the selected line shows the discount label, the pending amount is lower and the ticket totals have been recalculated before payment continues.
Validations and limits
- The screen is blocked if the organisation, location or `ticketId` is missing.
- Without `tpv:use`, the payment screen shows the permission error state.
- `Apply discount` stays disabled until at least one eligible line is selected and the operator can discount tickets.
- A line is eligible only when its pending amount is greater than `0.0001` and its paid amount is less than or equal to `0.0001` in the UI.
- Empty, non-numeric, negative and zero discount values cannot be confirmed. Decimal comma input is accepted by converting it to a decimal point.
- Existing line discounts are increased by the new extra discount, and the discount label is replaced with the latest discount label.
- The backend rejects void tickets, missing items, invalid payment statuses, negative prices, non-positive quantities, negative discounts and discounts greater than the line base amount.
- The action updates `ticket_item` records and recalculates the ticket. It does not create `ticket_payment` or `ticket_payment_allocation` records.
- When several lines are selected, updates are sent sequentially. If a later update fails, earlier lines may already have been discounted.
- The UI filters out lines with paid allocations; the analysis did not confirm a separate backend validation that blocks discount changes on already paid lines.
Expected result
The selected eligible ticket lines carry the new discount amount and label, the ticket subtotal, tax, total and pending amount are recalculated, and payment can continue from the updated balance.