If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Discount coupon value

Discount coupon value

Started by pilou2 on 19 Mar 2024, 5:09 PM · Views: 7,041

Results 21 to 27 of 27
10 Apr 2024, 6:36 PM
#21
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
416
Plugin Contributions:
6

Discount coupon value

I did more testings and found few small bugs. I went through all ot modules and three of them are modified.
Discount coupons had a lot to do. For any reason, the tax re-calculation modes were kind of reversed. I had some doubt at the beginning, but other modules code (GV and group discount) confirmed that.
Other discount modules, GV and Group Pricing needed few corrections too but lighter than coupons module.
I am ready to make new PRs (lost penny and coupon), it might be easier for others to review or modify. Although now that V2.0.0 is released, I am not sure anybody will still have some energy left...

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

10 Apr 2024, 8:10 PM
#22
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Discount coupon value

pilou2:

Although now that V2.0.0 is released, I am not sure anybody will still have some energy left...

Please proceed! There's always another release around the corner. We appreciate the hard work you have put into fixing this problem.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

5 May 2024, 7:36 PM
#23
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Discount coupon value

pilou2:

Here are the results:
Attachment 20530Attachment 20531
I acknowledge that you've made many updates to proposed coding changes since posting these screenshots, so I'm posting to ask whether the latest code still works as shown in these images?
... because in the US (tax-included-pricing is 'false'), if a person redeems a coupon worth $8.00, they'll want to see that coupon being worth $8.00 not $7.28 in the subtotals.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 May 2024, 5:28 AM
#24
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
416
Plugin Contributions:
6

Re: Discount coupon value

DrByte:

I acknowledge that you've made many updates to proposed coding changes since posting these screenshots, so I'm posting to ask whether the latest code still works as shown in these images?
... because in the US (tax-included-pricing is 'false'), if a person redeems a coupon worth $8.00, they'll want to see that coupon being worth $8.00 not $7.28 in the subtotals.

Well, yes and no... In countries I know, there is always a sale tax to apply and when a shop gives you a discount it is always on final prices (tax included). It seems that in US, even at consumer level, tax excluded is the base. In ZC the option to recalculate tax allows both, hopefully. Problem is that in original code 'Credit Note' option was used for tax included discount (I think it was depending on the module), but credit note are in fact an accounting tool (negative invoice) used between company that trade tax excluded and do their adjustments (discounts) tax excluded too.
Because of this and my own experience of discounts, I interpreted the 'Credit Note' option as tax excluded discount and 'Standard' option as tax included.
Actual code follows this interpretation which might be opposite of original code.
Shop owners have to be careful how they set these options or it might end up like you said with an invoice different that what was said.
If you display prices without tax, then discount re-calculate tax should be set to 'Credit Note' with new code. If prices are displayed tax included, 'standard' option would be the best choice. Although in some case, like trade between professionals, you can have a mix of these.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

27 Jun 2024, 8:49 AM
#25
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: Discount coupon value

Hi Guys,
We just run into the same problem where the tax(VAT) in not calculated in the discount coupons. We use a coupon for percentage discount and it calculates the discount without the tax.

The settings in order total Modules have no effect. This make the module unusable.
If you give 1% discount on an amount 100euro incl tax(19%) the result is .84 instead of being 1 euro

27 Jun 2024, 2:13 PM
#26
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: Discount coupon value

Georgecy:

Hi Guys,
We just run into the same problem where the tax(VAT) in not calculated in the discount coupons. We use a coupon for percentage discount and it calculates the discount without the tax.

The settings in order total Modules have no effect. This make the module unusable.
If you give 1% discount on an amount 100euro incl tax(19%) the result is .84 instead of being 1 euro

In Zencart 2.01 the coupon % discounts are working ok. Is there a temporary fix for the Zencart 1.5.7d? Our ZC 2.01 will need some time to go in production stage.

27 Jun 2024, 2:15 PM
#27
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Discount coupon value

Georgecy:

In Zencart 2.01 the coupon % discounts are working ok. Is there a temporary fix for the Zencart 1.5.7d? Our ZC 2.01 will need some time to go in production stage.
There was some major rework done in zc200/zc201 regarding pricing calculations, none of which are easily portable back to a zc157d installation.