Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

function updateNet() error !


JazzMan_Jay

Recommended Posts

Hi Community,

 

well I think there's something weird in the updateNet() function.

 

This function is the one that should gives you the Net price (when you enter the Gross price) in the admin/categories.php, so mostly when you setup a new item in your shop.

 

Here the original code:

function updateNet() {
 var taxRate = getTaxRate();
 var netValue = document.forms["new_product"].products_price_gross.value;

 if (taxRate > 0) {
   netValue = netValue / ((taxRate / 100) + 1);
 }

 

well If you try to put 100 EURO with an included tax rate of 16% this function should return..... 84 EURO

:D

in math:

netvalue = 100-16% or 100*0.84 or 100*(100-16)/100

 

so replace the wrong calculation with :

      if (taxRate > 0) {
   netValue = netValue *((100 - taxRate) / 100);
 }

 

Could someone give a confirmation, I know it's saturday evening.... but...I am here so I am probably not the only one.

B)

 

Jazzman_Jay

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...