Checkbox for a product item to exclude it from "discount %" calculation

You can define your own States you even do not have to define them from settings you can define them on the fly from the rules.

I’ve prepared a sample Database Tools import file to demonstrate my idea.

  • Please create a backup before importing it. There might be possible naming issues.
  • Please update to latest version before importing it.

Selective Discount Button.zip (1.4 KB)

What it does is…

  1. You’ll edit products and set Discount tag as Y for selected products.
  2. As you add orders SambaPOS will mark orders for these products as Discount. Non admin users won’t see this state or it won’t appear in reports.
  3. That config keeps your current Discount % button adds a second “Discount” button. When you type a rate and click that only orders with discount state will taken into account while calculating discount.

Since this is a customized discount we store rate as a ticket tag. You can print it if needed or get order totals marked as discount with {ORDER STATE TOTAL:Discount} tag.

:clap::clap: Thank you very much for the generous donation. I’ve already prepared it before that but couldn’t released it because of the need of releasing new version. I mean we always welcome donations but it has no relation with requests or features we’ll implement :slight_smile: We’re trying to help everyone as time permits.

3 Likes

@ Emre
I import this database file and I see “Discount” Custom Tag in product I set one product with Y another with N and 3rd one leave empty.
I ring up all three product and press discount button on left that took me to the settle screen where I seen Discount % button too I entered 10 and press discount % it took whole order discount not only item mark with Y Discount tag.
can you tell me what am I doing wrong ? :frowning:

I’m getting the same problem here.
When I add a discount of 10% for a ticket with two orders (one for 15 with discount set to ‘N’, one for 15 with discount set to ‘Y’, it correctly adds the discount of 1.5 to the ticket, but on the ticket the individual items are both shown as 14.25.
Anyway to change this behavior @emre?

EDIT: it’s only showing these numbers on ticket in the payment screen. When I close the payment screen it’s showing 15 on the ticket (no discount shown for the individual orders), and the discount of 1.5 is applied to the ticket.
Is it possible to have the discount shown on the ticket for the individual order where discount is applied?

This is a tax issue or calculation causing this. Do you want the discount to come off the Taxed product or before tax? I ran into this issue as well. In my case I wanted my discount to apply before tax.

EDIT: I am looking at how it is setup to determine for sure if this was it or not. I am thinking now it was probly just how it is setup to run. We can more than likely fix this ourself.

I’m not using any taxes (my business is tax-free).
I just had a better look at @emre’s implementation, and it seems obvious now why there’s no discount shown for individual items as the discount is calculated by using {ORDER STATE TOTAL:Discount} and {TICKET TAG:Discount Rate}.
I just don’t understand yet why a discount is calculated for each individual item on the ticket in the payment screen.
I’m suspecting it has something to do with the DStatus being set which might trigger some older discount rules that I had setup earlier. I have to check that first…

When the order is added its checking for the Flag. If it finds the flag it is automatically updating the Order State with

[=TN('{ORDER STATE TOTAL:Discount}') * (TN('{TICKET TAG:Discount Rate}')/100)]

When you enter the discount from payment screen this updates the Order State because it throws that discount into the calculation I just showed you. IT has not affected ticket yet until it adds the calculation. But … there is no update Order its just using a calculation for the discount. For it to show the amount reflected per item on Ticket screen we would have to use Update Order.

Does this sound about right @emre or am I thinking too hard?

So as you mentioned below me Order Tags should be updated instead of Ticket Tag.

This sample is not item based discount. It is still a ticket discount but it calculates discount amount from selected orders. I mean it is same as adding a fixed discount amount to ticket but it simplifies process by ignoring specific items. As it is a fixed ticket discount payment screen distributes discount amount to all orders.

It was just an idea for the original question. If you track discounts by orders that should implemented with order tags.

1 Like

Maybe I should just start using actual examples before I try to explain anything as I am figuring it out. I tend to put stuff down in the forum as I am figuring it out and it confuses my actual intention.

I did run into funny behavior with Taxes a week ago. Wish I had written that down I could have explained it better here. It was leaving behind a penny and an unpaid amount that would only show up if ticket reopened. We fixed it but I do not remember what we did or what was causing it now.

That was probably a rounding issue. Tax Template’s Rounding setting is useful to solve such issues. Maybe you used it.

What I meant was it left a penny difference after settle… if you looked at ticket it settled with .01 left… but if you opened ticket and tried to close again it would suddenly have the discount amount as unpaid and not let you pay for it. Was really strange. We fixed it and maybe it was rounding… maybe that penny was what threw it off and made it behave as it did.

Yes this is a rounding issue. You should force SambaPOS to round calculated tax amounts to settle correctly. This is a setting because it should be handled differently for Tax Included tickets.

1 Like

@emre,

I don’t understand why the automation command has a constraint that the tendered amount has to be less than 99?

And also why the Update Ticket Discount Rate sets the Discount rate to TENDEREDAMOUNT…

So the % discount is not 100% or greater. I am not completely sure but it makes sense to me that from payment screen an amount entered would be a Tendered Amount. It is tendering it into Discount instead of Payment Type.

3 Likes

I see, that makes sense.
Thanks for making that clear @kendash.

I learned it just now actually from your questions lol. So its kind of neat to know that you can read {TENDEREDAMOUNT} like that from that screen.

1 Like

@Jesse {:PAYMENTAMOUNT} should also work.

1 Like

Hi, Perhaps someone can point me as to where to look in this routine to correct my problem.
Today I used this routine to discount a sale which had a void item on it. The calculation discounted the void item so the final total became incorrect.
Example:
Item 1 5.00
Item 2 4.00 Voided
Total to pay 5.00
50% Discount 4.50
Balance to Pay 0.50
The calculation includes the voided item in the calculation.
Thank you in anticipation of your help.
Ray

Emre,

I am new to Sambapos and this forum but I was looking for a similar solution to prevent certain cashiers from offering discounts or finding a way in the reporting to show who has given discounts and on what items

Is there any way to do this?

Check this out
Selective Discount:

Track User: