Author Topic: When VAT (tax) is 0/disabled, the base price with tax is 0 too  (Read 444 times)

arcturus

  • Jr. Member
  • **
  • Posts: 91
  • VirtueMart Version: 3.6.6 10191
When VAT (tax) is 0/disabled, the base price with tax is 0 too
« on: October 13, 2019, 15:12:55 pm »
Hello,
I noticed that when VAT (tax) is disabled, the base price with tax is calculated as 0 too (not as equal with product price/cost).
I'm attaching a screenshot.
Cheers,
George
https://www.proxima-mundi.ro

Now I'm using Joomla! 3.9.13 and VM 3.6.6 10191 on PHP 7.3.9

StefanSTS

  • Global Moderator
  • Full Member
  • *
  • Posts: 517
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #1 on: October 13, 2019, 16:40:15 pm »
This is not the original VM product list, so I guess, you have to show the code behind it.

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

arcturus

  • Jr. Member
  • **
  • Posts: 91
  • VirtueMart Version: 3.6.6 10191
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #2 on: October 13, 2019, 21:47:19 pm »
It's on a test site - J 3.9.12 and VM 3.6.2 10159, with the default sample data.


You can do this experiment on a test site:
1. Disable VAT (rule #1)
2. Make an order
3. See it on backend.
Cheers,
George
https://www.proxima-mundi.ro

Now I'm using Joomla! 3.9.13 and VM 3.6.6 10191 on PHP 7.3.9

StefanSTS

  • Global Moderator
  • Full Member
  • *
  • Posts: 517
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #3 on: October 16, 2019, 12:28:14 pm »
I see, you are in backend in order edit, I thought you are talking about the invoice.
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

StefanSTS

  • Global Moderator
  • Full Member
  • *
  • Posts: 517
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #4 on: October 16, 2019, 12:32:35 pm »
Does that still happen with 10177?
http://dev.virtuemart.net/projects/virtuemart/files

There is a lot of bug fixing going on, 18 revisions behind is a lot.
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9973
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

arcturus

  • Jr. Member
  • **
  • Posts: 91
  • VirtueMart Version: 3.6.6 10191
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #6 on: October 16, 2019, 15:31:08 pm »
I updated the test site to 10179, I made another test order and the result is the same.
Cheers,
George
https://www.proxima-mundi.ro

Now I'm using Joomla! 3.9.13 and VM 3.6.6 10191 on PHP 7.3.9

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9973
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #7 on: October 16, 2019, 19:32:12 pm »
actually it is a bit a philosophical thing, if there is no tax, we do not have a baseprice with tax.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

arcturus

  • Jr. Member
  • **
  • Posts: 91
  • VirtueMart Version: 3.6.6 10191
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #8 on: October 16, 2019, 19:34:50 pm »
It would be expected that baseprice with tax to equal baseprice if tax is 0  :D
Cheers,
George
https://www.proxima-mundi.ro

Now I'm using Joomla! 3.9.13 and VM 3.6.6 10191 on PHP 7.3.9

diri

  • Jr. Member
  • **
  • Posts: 78
  • VirtueMart Version: most recent dev version (trunk)
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #9 on: October 17, 2019, 09:53:19 am »
hm...

100 * 0  = 0

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2425
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #10 on: October 17, 2019, 10:00:52 am »
Diri, I do not agree. Tax = 0% gives

Baseprice with tax = Baseprice + (Baseprice * 0 / 100) = Baseprice

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

diri

  • Jr. Member
  • **
  • Posts: 78
  • VirtueMart Version: most recent dev version (trunk)
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #11 on: October 17, 2019, 18:27:35 pm »
Jörgen, you are absolute correct.

Adding tax to baseprice should be performed but, I stumpled over this and similar misbehaviours very often when testing import of data and using VM's functions  for price calculation before and after by adding and editing products in VM BE and watching DB as well as VM BE and FE.

Following VM development almost since very beginning I never trusted it after several tries because it didn't perform real realiable calculations in every version. I have tendency to assume being simply to old and to stupid to understand it.

For me it's similar like being dependant on auto values for primary keys in DB tables - this has never been and is not really reliable in each and every case, no matter which DB you use as backend. I'm simply tired of slowing down and blow up DB in multiuser environments using "tricks" like adding a datetime field in each row. My code calculates values for keys for itself in case of need and it's output is reproducable and storage in DB can be tested during runtime. Always. In case there is no error when storing data I can calculate reliable and reproducable values of real important data. With auto values it might happen values in another row are changed when application's FE and/or BE are fast enough or DB is under heavy load or ... .

Remark for those not believing last paragraph:
mySQL mentions such problems somewhere in documentation. Google might be your friend.

arcturus

  • Jr. Member
  • **
  • Posts: 91
  • VirtueMart Version: 3.6.6 10191
Re: When VAT (tax) is 0/disabled, the base price with tax is 0 too
« Reply #12 on: November 01, 2019, 19:38:52 pm »
if there is no tax, we do not have a baseprice with tax.

I'd say that, mathematically, baseprice + 0 (no tax) = baseprice.

Or maybe it would be a good idea to not see it in the order if there is no tax, otherwise it is confusing.
Cheers,
George
https://www.proxima-mundi.ro

Now I'm using Joomla! 3.9.13 and VM 3.6.6 10191 on PHP 7.3.9