Supported version: Saleculator v4.5 u2 and later.
This document explains how to manage discounts in current Saleculator versions. Use this method when discounts should be selected from a maintained discount list, reported separately, and stored separately from product lines.
Current recommended method #
In Saleculator v4.5 u2 and later, use managed discounts. Managed discounts are configured once in the Discounts maintenance screen and then applied from the sales screen Discount button.
This is different from older script-based methods where a discount was often added as a negative ticket line or handled by a custom customer script. Those older methods can still be useful for special custom logic, but managed discounts are the recommended method for normal bill-level discounts.
What managed discounts support #
A managed discount can include:
- Name, such as Festival Discount or Staff Discount.
- Discount type: percentage or fixed amount.
- Discount value.
- Active or inactive status.
- Valid from and valid to dates.
- Customer tax category restriction.
- Minimum ticket total.
- Notes for internal reference.
Create or edit a managed discount #
- Log in as an Administrator or Manager user.
- Open the Discounts maintenance screen.
- Create a new discount or edit an existing discount.
- Enter a clear name.
- Select the discount type: percentage or amount.
- Enter the value. For percentage discounts, enter the percentage value. For amount discounts, enter the fixed discount amount.
- Keep Active enabled when the discount should be available at billing.
- Optionally set Valid From, Valid To, Customer Tax Category, Minimum Total, and Notes.
- Save the discount.
Enable the Discount button #
The sales screen Discount button is configured in the Ticket.Buttons resource. The standard entry is:
<button key="button.discount" name="button.discount" code="Script.DiscountOnTotal" shortcut="F10"/>
If the button is not visible, check the Ticket.Buttons resource and confirm the user role has permission for button.discount.
Apply a discount on a ticket #
- Add the sale items to the ticket.
- Click the Discount button or press F10 when configured.
- Select an eligible managed discount from the list.
- Confirm that the discount amount appears in the ticket totals area.
- Complete payment normally.
Only eligible discounts are shown. A discount can be hidden when it is inactive, outside its valid date range, below its minimum total, restricted to a different customer category, or results in a zero discount amount.
Manual discount fallback #
The standard Script.DiscountOnTotal also supports manual entry when no managed discount is selected.
- Enter 10% to apply a 10 percent discount.
- Enter 10 to apply a fixed amount discount of 10.00.
Manual discounts are useful for one-time cashier-approved adjustments. For repeated promotions, create a managed discount instead.
Change or remove an applied discount #
If a ticket already has a discount and the cashier clicks the Discount button again, Saleculator asks whether to change or remove the discount.
- Choose Change to select another discount.
- Choose Remove Discount to clear the discount from the ticket.
- Choose Cancel to leave the ticket unchanged.
Current managed discount behavior keeps one bill-level discount on the ticket. Applying another discount replaces the previous one.
How the total is calculated #
Managed discounts are bill-level discounts. Saleculator stores the selected discount separately and calculates the ticket total using the discounted taxable base.
For percentage discounts, the discount is calculated from the gross total before discount.
For fixed amount discounts, the fixed gross discount amount is apportioned across the ticket lines based on each line value. Tax is then recalculated on the discounted line base.
Example: if the total including tax is 102.00 and a fixed discount of 2.00 is applied, the payable invoice total becomes 100.00 including tax. The discount is apportioned back into the taxable base so the tax total is recalculated correctly.
Receipt printing #
The standard receipt can show discounts in the totals area using:
#if ($ticket.getAppliedDiscountTotal() > 0)
<line>
<text align="left" length="16">Discounts</text>
<text align="right" length="32">${ticket.printAppliedDiscountTotal()}</text>
</line>
#end
This prints the discount separately while the Total line prints the final invoice total after discount and tax recalculation.
Where discounts are stored #
Managed discounts are stored in the DISCOUNTS table. When a ticket is closed, the applied discount is stored in TICKETDISCOUNTS with the receipt reference, discount name, discount type, discount value, and applied amount.
This allows discount reporting without depending on negative product lines.
Older discount methods #
Older Saleculator installations and older knowledge base articles may use script-based discount handling. Common examples are:
- Discount on total bill amount: older script approach for total bill discount.
- Script.DiscountOnTotal: script resource used by the Discount button.
- Script.CustomerDiscount: custom customer or quantity based discount script.
- Apply discount on a selected item: item-level custom discount approach.
Use those older approaches only when you need custom behavior that managed discounts do not cover. For standard percentage and fixed bill-level discounts in Saleculator v4.5 u2 and later, use managed discounts.
Verification #
- Create a test percentage discount and a test fixed amount discount.
- Apply each one on a test bill.
- Confirm the ticket totals show the discount amount.
- Close the ticket and print the receipt.
- Confirm the receipt shows Discounts and that the final Total is after discount.
- Check the Discounts report if reporting is required.
Leave a Reply