How to calculate discount amount and tag order automatic in ticket and not cancel with cashiar?

how to calculate discount amount and tag order automatic in ticket and not cancel with cashiar?