Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

That's what I was afraid of. Can you give each one a unique name, just for a little while so we can figure out which one(s) Order Editor is using to create the entry for TVA 19.6% + TVA 0%:?

 

Ok, I've done it....and it uses both cause a line is still added : TVA + TVA

sub-total (tax free), Bookmark, Browse by Categories 2.5, Category box enhancement, Contact us choice 1.0.1, Featured products 1.5.5.1, MultiGeoZone MultiTable Shipping 1.101, Os Active Desktop 2.3, Paymenttypes 1.2, Phpmyvisites 2.1, Session counter, Skype Contact 1.0, Stats products per month 1, Store Pick Up Version 1.4, Updated spiders.txt, Who's Online Enhancement 2.00, BackButtons, Google Analytics, stats_sales_csv_1.2, google_position_1.3, Customers List Improved 1.4, boxe defilante

Link to comment
Share on other sites

Ok, I've done it....and it uses both cause a line is still added : TVA + TVA

 

No, a unique name for each one, like TVA 19.6% a, TVA 19.6% b, TVA 19.6% c, etc.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Oups, sorry ;)

I've done what you asked me and it's interesting !!!!

 

The line added is : TVA L 19.6 Fr + TVA L 0 World

and it corresponds to delivery (L) tax for France (19.6) and world (0)

 

>>>> So the problem comes from the rest of the world zone : it has nothing to do here!

 

And that zone is empty cause I filled all the other zones

- FR = France + DOM-TOM (french islands) (13 regions)

- EU = Germany, Italy.......... (25 countries)

- Rest of Europe = Switzerland.... (8 countries)

- Rest of the world = no countries added (=all the others)

 

May be the rest of the world zone shouldn't be empty and I should add manualy all the other countries ????????

Edited by lateralus

sub-total (tax free), Bookmark, Browse by Categories 2.5, Category box enhancement, Contact us choice 1.0.1, Featured products 1.5.5.1, MultiGeoZone MultiTable Shipping 1.101, Os Active Desktop 2.3, Paymenttypes 1.2, Phpmyvisites 2.1, Session counter, Skype Contact 1.0, Stats products per month 1, Store Pick Up Version 1.4, Updated spiders.txt, Who's Online Enhancement 2.00, BackButtons, Google Analytics, stats_sales_csv_1.2, google_position_1.3, Customers List Improved 1.4, boxe defilante

Link to comment
Share on other sites

Should I use contributions like?????

- rest of the world add-on

- All Country zone list

sub-total (tax free), Bookmark, Browse by Categories 2.5, Category box enhancement, Contact us choice 1.0.1, Featured products 1.5.5.1, MultiGeoZone MultiTable Shipping 1.101, Os Active Desktop 2.3, Paymenttypes 1.2, Phpmyvisites 2.1, Session counter, Skype Contact 1.0, Stats products per month 1, Store Pick Up Version 1.4, Updated spiders.txt, Who's Online Enhancement 2.00, BackButtons, Google Analytics, stats_sales_csv_1.2, google_position_1.3, Customers List Improved 1.4, boxe defilante

Link to comment
Share on other sites

May be the rest of the world zone shouldn't be empty and I should add manualy all the other countries ????????

 

Either that or delete it. As I understand it, and empty zone is an everything zone. Since no zones/countries are defined as applicable to that zone, then everything is applicable to that zone.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Should I use contributions like?????

- rest of the world add-on

- All Country zone list

 

That may solve this issue also, but I'm not sure as I'm not familiar with those contributions.

 

For your other problem, the subtotal without tax, we'll have to do some custom modification to Order Editor to fix that. What is the ot class of that value as stored in the orders_total table in the database? For example, subtotal is ot_subtotal, total is ot_total, etc.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Hello,

I have also posted this topic in the german forum, but ist seem, that nobody there could help me.

My problem:

I have installed the Order Editor 2.5.4.

But on the 2% discount for advance payment and on shipping there is no tax levied.

On shipping I have the possibility to enter a sepate shipping tax, but then the tax is listed 2 times.

Looks not so good and still on the discount ist no tax levied.

I would be nice, if the tax is calculated on the total.amount.

 

Second problem:

The 2% discount for advance payment is added on the subtotal. (Only with the order editor)

As work-around I put a minus sign in front of the discout, then it works.

 

At the moment it looks like this in the order editor:

 

subtotal: 5.00?

discount: 0.09?

shipping: 5.00? (shipping 4.31? +0.69? Tax)

included tax: 0.69? (only charged on the subtotal)

total: 10.09? (also wrong, because discount added)

 

It should work like this:

 

subtotal: 5.00?

discount: 0.09?

shipping: 5.00?

included tax: 1.37? (calculated on: subtotal-discount+shipping)

total: 9.91? (discount deducted)

 

In the order.php it works how it should work, but if I change i.e. only a model-number with the Order Editor it calculated wrong.

 

So, could anybody help me?

 

Sorry for my bad english.....

 

Greetings from Germany

Svenja

 

Please post the ot class value that is stored in the orders_total table for the discount component. For example, subtotal is ot_subtotal, total is ot_total, etc.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

It obviously doesn't work ;(

Unless I try to unistall MZMT and reinstall it with 3 zones? Probably a bad idea...

 

* I'm also looking toward my invoice that modify the sub-total (free tax) :

1 sub-total (free tax)

2 fax

3 sub-total (inc. tax)

4 shipping

5 TOTAL

Edited by lateralus

sub-total (tax free), Bookmark, Browse by Categories 2.5, Category box enhancement, Contact us choice 1.0.1, Featured products 1.5.5.1, MultiGeoZone MultiTable Shipping 1.101, Os Active Desktop 2.3, Paymenttypes 1.2, Phpmyvisites 2.1, Session counter, Skype Contact 1.0, Stats products per month 1, Store Pick Up Version 1.4, Updated spiders.txt, Who's Online Enhancement 2.00, BackButtons, Google Analytics, stats_sales_csv_1.2, google_position_1.3, Customers List Improved 1.4, boxe defilante

Link to comment
Share on other sites

It obviously doesn't work ;(

Unless I try to unistall MZMT and reinstall it with 3 zones? Probably a bad idea...

 

* I'm also looking toward my invoice that modify the sub-total (free tax) :

1 sub-total (free tax)

2 fax

3 sub-total (inc. tax)

4 shipping

5 TOTAL

 

For your other problem, the subtotal without tax, we'll have to do some custom modification to Order Editor to fix that. What is the ot class of that value as stored in the orders_total table in the database? For example, subtotal is ot_subtotal, total is ot_total, etc.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

It obviously doesn't work ;(

Unless I try to unistall MZMT and reinstall it with 3 zones? Probably a bad idea...

 

* I'm also looking toward my invoice that modify the sub-total (free tax) :

1 sub-total (free tax)

2 fax

3 sub-total (inc. tax)

4 shipping

5 TOTAL

 

Find this at about line 136:

$RunningSubTotal = 0;
	$RunningTax = array($default_tax_name => 0);

 

and change it to:

$RunningSubTotal = 0;
$RunningNetto = 0;
	$RunningTax = array($default_tax_name => 0);

 

then find at about line 230

//update subtotal and total during update function
			if (DISPLAY_PRICE_WITH_TAX == 'true') {
			$RunningSubTotal  += (($products_details['tax']/100 + 1) * ($products_details['qty'] *  $products_details['final_price'])); 
			} else {
			$RunningSubTotal += $products_details["qty"] * $products_details["final_price"];
			}

 

and change it to

//update subtotal and total during update function
//this modification assumes you have Display Price with Tax set to 'true'

			$RunningSubTotal  += (($products_details['tax']/100 + 1) * ($products_details['qty'] *  $products_details['final_price'])); 

			$RunningNetto += $products_details["qty"] * $products_details["final_price"];

 

Then find at about line 362

if ($ot_class == "ot_subtotal") {
					$ot_value = $RunningSubTotal;
				}	

				if ($ot_class == "ot_tax") {
					$ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)];
				}

 

and change it to

if ($ot_class == "ot_subtotal") {
					$ot_value = $RunningSubTotal;
				}	

if ($ot_class == "ot_total_ht") {
					 $ot_value = $RunningNetto;
				 }	

				if ($ot_class == "ot_tax") {
					$ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)];
				}

 

Having performed those steps, hit the update button on a modified order and make sure everything is totalled properly. If so we can modify the add a product case and the javascript.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Please post the ot class value that is stored in the orders_total table for the discount component. For example, subtotal is ot_subtotal, total is ot_total, etc.

 

Hi djmonkey,

 

subtotal is ot_subtotal

shipping is ot_shipping

tax is ot tax

total is ot_total

discount is ot_payment

 

and if I had edited the discount (put an - sign in front of it, to calculate right) it changed to ot_custom

Link to comment
Share on other sites

Hi monkey,

Thanks again for all your efforts....you always point out interesting things ;)

 

Here is a screenshot of my orders_total table (You can see all the classes applied) :

order_table.gif

*The invoice 446 has NOT been modified by order editor : we can see the right order of the classes (from 1 to 5).

 

* The invoice 447 has been modified by order editor and what a mess!

- the order of the classes goes now from 2 to 6

- TVA L 19.6 Fr + TVA L 0 World and the free tax total use the same number (2)

PS : I haven't changed my rest of the world zone yet, and I haven't applied the modifications you suggest me...

sub-total (tax free), Bookmark, Browse by Categories 2.5, Category box enhancement, Contact us choice 1.0.1, Featured products 1.5.5.1, MultiGeoZone MultiTable Shipping 1.101, Os Active Desktop 2.3, Paymenttypes 1.2, Phpmyvisites 2.1, Session counter, Skype Contact 1.0, Stats products per month 1, Store Pick Up Version 1.4, Updated spiders.txt, Who's Online Enhancement 2.00, BackButtons, Google Analytics, stats_sales_csv_1.2, google_position_1.3, Customers List Improved 1.4, boxe defilante

Link to comment
Share on other sites

I've done the modification of edit_order.php ans it's getting better ;)

-Total free tax is OK

-Tax is OK

-Subtotal is OK

-The problem remains the same for the total (inc. tax)

 

I'll try to modify my zones and I hope it's gonna solve this last problem!!!

 

Congratulations (and thanks again for this friendly support)

sub-total (tax free), Bookmark, Browse by Categories 2.5, Category box enhancement, Contact us choice 1.0.1, Featured products 1.5.5.1, MultiGeoZone MultiTable Shipping 1.101, Os Active Desktop 2.3, Paymenttypes 1.2, Phpmyvisites 2.1, Session counter, Skype Contact 1.0, Stats products per month 1, Store Pick Up Version 1.4, Updated spiders.txt, Who's Online Enhancement 2.00, BackButtons, Google Analytics, stats_sales_csv_1.2, google_position_1.3, Customers List Improved 1.4, boxe defilante

Link to comment
Share on other sites

I've done the modification of edit_order.php ans it's getting better ;)

-Total free tax is OK

-Tax is OK

-Subtotal is OK

-The problem remains the same for the total (inc. tax)

 

I'll try to modify my zones and I hope it's gonna solve this last problem!!!

 

Congratulations (and thanks again for this friendly support)

 

Find at line 409

if ($ot_class == "ot_tax") {

				if (DISPLAY_PRICE_WITH_TAX != 'true') { 
				//we don't add tax to the total here because it's already added to the subtotal
					$RunningTotal += $ot_value;
					}
					} else {
					$RunningTotal += $ot_value;
					}

 

and change it to

if ($ot_class == "ot_tax") {

				if (DISPLAY_PRICE_WITH_TAX != 'true') { 
				//we don't add tax to the total here because it's already added to the subtotal
					$RunningTotal += $ot_value;
					}
					} elseif ($ot_class != "ot_total_ht") {
					$RunningTotal += $ot_value;
					}

 

Find at line 418

if (!trim($ot_value) && ($ot_class !=  "ot_shipping") && ($ot_class != "ot_subtotal") &&  ($ot_class != "ot_total")) { // value = 0 => Delete Total  Piece

 

and change it to

if (!trim($ot_value)  && ($ot_class != "ot_shipping") && ($ot_class !=  "ot_subtotal") && ($ot_class != "ot_total") &&  ($ot_class != "ot_total_ht")) { // value = 0 => Delete Total  Piece

 

Find at about line 556

// 2.2.2 Calculate Tax and Sub-Totals
		$order = new order($oID);
		$RunningSubTotal = 0;
		$RunningTax = array($default_tax_name => 0);

 

and change it to

// 2.2.2 Calculate Tax and Sub-Totals
		$order = new order($oID);
		$RunningSubTotal = 0;
		$RunningNetto = 0;
		$RunningTax = array($default_tax_name => 0);

 

Find at about line 582

// This calculatiion of Subtotal and Tax is part of the 'add a product' process
	if (DISPLAY_PRICE_WITH_TAX == 'true') {
	$RunningSubTotal  += (($order->products[$i]['tax'] / 100 + 1) *  ($order->products[$i]['qty'] *  $order->products[$i]['final_price']));
	} else {
	$RunningSubTotal += ($order->products[$i]['qty'] * $order->products[$i]['final_price']);
	}

 

and change it to

// This calculatiion of Subtotal and Tax is part of the 'add a product' process
	//this modification assumes you have Display Price with Tax set to 'true'

	$RunningSubTotal  += (($order->products[$i]['tax'] / 100 + 1) *  ($order->products[$i]['qty'] *  $order->products[$i]['final_price']));

	$RunningNetto += ($order->products[$i]['qty'] * $order->products[$i]['final_price']);

 

Find this at about line 616

// 2.2.2.3 Total
		if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND class != "ot_tax" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		} else {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		}

 

and change it to

// 2.2.2.2.1 ot_total_ht
		$Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET
			text  = "' . $currencies->format($RunningNetto, true,  $order->info['currency'], $order->info['currency_value']) . '",
			value = "' . $RunningNetto . '"
			WHERE class="ot_total_ht" 
			AND orders_id= "' . (int)$oID . '"';
		tep_db_query($Query);

// 2.2.2.3 Total
		if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total"
		AND class != "ot_total_ht" 
		AND class != "ot_tax" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		} else {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND class != "ot_total_ht"
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		}

 

Find at about line 1563

if ($TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal") {
		$id = $TotalDetails["Class"];//subtotal and total should each only exist once

 

and change it to

if ($TotalDetails["Class"] == "ot_total" ||  $TotalDetails["Class"] == "ot_subtotal" || $TotalDetails["Class"] ==  "ot_total_ht") {
		$id = $TotalDetails["Class"];//subtotal and total should each only exist once

 

Find at line 1576

if(//tax, subtotal, and total are not editable, but have all the same format
	$TotalDetails["Class"] == "ot_total" || 
	$TotalDetails["Class"] == "ot_subtotal" || 
	$TotalDetails["Class"] == "ot_tax")

 

and change it to

if(//tax, subtotal, and total are not editable, but have all the same format
	$TotalDetails["Class"] == "ot_total" || 
	$TotalDetails["Class"] == "ot_subtotal" ||
	$TotalDetails["Class"] == "ot_total_ht" || 
	$TotalDetails["Class"] == "ot_tax")

 

This should be everything but the JavaScript. I don't have time to work that out right now but will post it soon.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

You're just magicquickmonkey :thumbsup:

 

The total works great now!!!

I'm really impressed :blink:

 

Remaining problems :

- the line added for the tax on delivery (TVA L 19.6 Fr + TVA L 0 World)

- the calculation of delivery doesn't refresh and is wrong (but it can be changed manually)

 

This should be everything but the JavaScript. I don't have time to work that out right now but will post it soon.
I don't understand what you mean???

 

PS : one more question, I must install SPPC (Seperate price per customer) and I'd like to know if there is any problem or incompatibility with "Order Editor"? But I bet there are none ;)

Edited by lateralus

sub-total (tax free), Bookmark, Browse by Categories 2.5, Category box enhancement, Contact us choice 1.0.1, Featured products 1.5.5.1, MultiGeoZone MultiTable Shipping 1.101, Os Active Desktop 2.3, Paymenttypes 1.2, Phpmyvisites 2.1, Session counter, Skype Contact 1.0, Stats products per month 1, Store Pick Up Version 1.4, Updated spiders.txt, Who's Online Enhancement 2.00, BackButtons, Google Analytics, stats_sales_csv_1.2, google_position_1.3, Customers List Improved 1.4, boxe defilante

Link to comment
Share on other sites

You're just magicquickmonkey :thumbsup:

 

The total works great now!!!

I'm really impressed :blink:

 

Remaining problems :

- the line added for the tax on delivery (TVA L 19.6 Fr + TVA L 0 World)

- the calculation of delivery doesn't refresh and is wrong (but it can be changed manually)

 

I don't understand what you mean???

 

PS : one more question, I must install SPPC (Seperate price per customer) and I'd like to know if there is any problem or incompatibility with "Order Editor"? But I bet there are none ;)

 

I don't understand what you mean by "the calculation of delivery".

 

The only incompatibiliy with SPPC is that when you add a product Order Editor will always pull the retail price from the database regardless of who the customer is.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

This should be everything but the JavaScript. I don't have time to work that out right now but will post it soon.

 

I don't understand what you mean???

 

The java script:

 

Find at about line 989

if ((action == 'weight') && (pid == 'p-total_weight')) {
 sum += Number(el[i].value);
 }

 

and add directly below it

if ((action =='ot_total_ht') && (pid == 'p-total_excl')) {
sum += Number(el[i].value);
}

 

Find at about line 1132

var subTotal = updateTotals('subtotal', taxdescription);
document.getElementById("ot_subtotal").value = doFormat(subTotal, 4);

 

and add directly below it

var otTotalHT = updateTotals('ot_total_ht', taxdescription);
document.getElementById("ot_total_ht").value = doFormat(otTotalHT, 4);

 

Find at about line 1145

 function getTotals(action, taxdescription) { 
//called when updating editable total components such as shipping
var subTotal = updateTotals('subtotal', taxdescription);
document.getElementById("ot_subtotal").value = doFormat(subTotal, 4);

 

and add directly below it

 
var otTotalHT = updateTotals('ot_total_ht', taxdescription);
document.getElementById("ot_total_ht").value = doFormat(otTotalHT, 4);

 

That should be it.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Hi djmonkey,

 

subtotal is ot_subtotal

shipping is ot_shipping

tax is ot tax

total is ot_total

discount is ot_payment

 

and if I had edited the discount (put an - sign in front of it, to calculate right) it changed to ot_custom

 

Find at about line 263

// 1.4.0.1 Shipping Tax

		if (is_array ($_POST['update_totals'])){
		foreach($_POST['update_totals'] as $total_index => $total_details)
		{
			extract($total_details,EXTR_PREFIX_ALL,"ot");
			if($ot_class == "ot_shipping")//a good place to add in custom total components
			{
				if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax
		$RunningTax[$default_tax_name] += ($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100);
				} else { //shipping tax is in addition to the shipping charge
$RunningTax[$default_tax_name] += (($_POST['update_shipping_tax'] / 100) * $ot_value);
				}
			}
		  }
		}

 

and change it to

// 1.4.0.1 Shipping Tax

		if (is_array ($_POST['update_totals'])){
		foreach($_POST['update_totals'] as $total_index => $total_details)
		{
			extract($total_details,EXTR_PREFIX_ALL,"ot");
			if($ot_class == "ot_shipping")//a good place to add in custom total components
			{
				if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax
		$RunningTax[$default_tax_name] += ($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100);
				} else { //shipping tax is in addition to the shipping charge
$RunningTax[$default_tax_name] += (($_POST['update_shipping_tax'] / 100) * $ot_value);
				}//end if display price with tax is true
			}//end if ot_class = ot_shipping

		   if($ot_class == "ot_payment")//custom mod for discount module
			  {
				  if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax
		  $RunningTax[$default_tax_name] -= ($ot_value *  $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100);
				  } else { //shipping tax is in addition to the shipping charge
  $RunningTax[$default_tax_name] -= (($_POST['update_shipping_tax'] / 100) * $ot_value);
				  }//end if display price with tax is true
			  }//end if ot_class = ot_payment
		  }//end foreach
		}//end if is_array

 

Find at about line 409

if ($ot_class == "ot_tax") {

				if (DISPLAY_PRICE_WITH_TAX != 'true') { 
				//we don't add tax to the total here because it's already added to the subtotal
					$RunningTotal += $ot_value;
					}
					} else {
					$RunningTotal += $ot_value;
					}

 

and change it to

if ($ot_class == "ot_tax") {

				if (DISPLAY_PRICE_WITH_TAX != 'true') { 
				//we don't add tax to the total here because it's already added to the subtotal
					$RunningTotal += $ot_value;
					}
					} elseif ($ot_class == "ot_payment") {
					$RunningTotal -= $ot_value;
					} else {
					$RunningTotal += $ot_value;
					}

 

Find at about line 563

//just adding in shipping tax, don't mind me
	$ot_shipping_query = tep_db_query("
	SELECT class, value 
	FROM " . TABLE_ORDERS_TOTAL . " 
	WHERE orders_id = '" . (int)$oID . "'");
	$ot_shipping_value = tep_db_fetch_array($ot_shipping_query);


if ($ot_shipping_value['class'] == 'ot_shipping')//a good place to add in other fields to tax
	{
	if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$RunningTax[$default_tax_name] += ($ot_shipping_value['value'] * $order->info['shipping_tax'] / ($order->info['shipping_tax'] + 100));
			} else {
		$RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value['value']);

				}// end if (DISPLAY_PRICE_WITH_TAX == 'true') {
				}// end if ($ot_shipping_value['class'] == 'ot_shipping')

	// end shipping tax calcs

 

and change it to

//just adding in shipping tax, don't mind me
	$ot_shipping_query = tep_db_query("
	SELECT class, value 
	FROM " . TABLE_ORDERS_TOTAL . " 
	WHERE orders_id = '" . (int)$oID . "'");
	$ot_shipping_value = tep_db_fetch_array($ot_shipping_query);


if ($ot_shipping_value['class'] == 'ot_shipping')//a good place to add in other fields to tax
	{
	if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$RunningTax[$default_tax_name] += ($ot_shipping_value['value'] * $order->info['shipping_tax'] / ($order->info['shipping_tax'] + 100));
			} else {
		$RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value['value']);

				}// end if (DISPLAY_PRICE_WITH_TAX == 'true') {
				}// end if ($ot_shipping_value['class'] == 'ot_shipping')

   if ($ot_shipping_value['class'] == 'ot_payment')//custom mod for discount module
	  {
	  if (DISPLAY_PRICE_WITH_TAX == 'true') {
		  $RunningTax[$default_tax_name] -=  ($ot_shipping_value['value'] * $order->info['shipping_tax'] /  ($order->info['shipping_tax'] + 100));
			  } else {
		  $RunningTax[$default_tax_name] -= (($order->info['shipping_tax'] / 100) * $ot_shipping_value['value']);

				  }// end if (DISPLAY_PRICE_WITH_TAX == 'true') {
				  }// end if ($ot_shipping_value['class'] == 'ot_payment')

	// end shipping tax calcs

 

Find at about line 618

// 2.2.2.3 Total
		if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND class != "ot_tax" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		} else {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		}

 

and change it to

// 2.2.2.3 Total
		if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$Query = 'SELECT sum(value)
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total"
		AND class != "ot_payment"
		AND class != "ot_tax"
		AND orders_id = "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$total = $row['total_value'];
	   $Queryb = 'SELECT sum(value)
		 AS total_valueb from ' . TABLE_ORDERS_TOTAL . '
		 WHERE class = "ot_payment" 
		 AND orders_id = "' . (int)$oID . '"';
		 $resultb = tep_db_query($Queryb);
		 $rowb = tep_db_fetch_array($resultb);
		 $totalb = $rowb['total_valueb'];
		$Total = $total - $totalb;
		} else {
		$Query = 'SELECT sum(value)
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total"
		AND class != "ot_payment"
		AND orders_id = "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$total = $row['total_value'];
		$Queryb = 'SELECT sum(value)
		  AS total_valueb from ' . TABLE_ORDERS_TOTAL . '
		  WHERE class = "ot_payment"
		  AND orders_id = "' . (int)$oID . '"';
		  $resultb = tep_db_query($Queryb);
		  $rowb = tep_db_fetch_array($resultb);
		  $totalb = $rowb['total_valueb'];
		 $Total = $total - $totalb;
		}

 

Find at about line 956

//shipping tax is added to the default tax class
 if ((p == 'ot_shipping') || (p == defaultTaxName + 'ot_shipping')) {
 var taxRate = document.getElementById("shipping_tax-" + defaultTaxName).value;
 <?php
 if (DISPLAY_PRICE_WITH_TAX == 'true') { ?>//shipping tax is part of the shipping charge
 sum += Number(el[i].value) * taxRate / (Number(taxRate) + 100); 
 <?php } else { ?>//shipping tax is in addition to the shipping charge
 sum += Number(el[i].value) * taxRate / 100; 
 <?php } ?>
 }//end if p == ot_shipping

 

and add directly below it

//discount tax is added to the default tax class
 if (p == 'ot_payment') {
 var taxRate = document.getElementById("shipping_tax-" + defaultTaxName).value;
 <?php
 if (DISPLAY_PRICE_WITH_TAX == 'true') { ?>//shipping tax is part of the shipping charge
 sum -= Number(el[i].value) * taxRate / (Number(taxRate) + 100); 
 <?php } else { ?>//shipping tax is in addition to the shipping charge
 sum -= Number(el[i].value) * taxRate / 100; 
 <?php } ?>
 }//end if p == ot_payment

 

 

Find at about line 995

if (action =='total'){
//I cheat here- the grand total always includes the value of the various totals including tax of 
//each item, regardless of individual shop settings.  So I take the various Total incls, all the
//ot_customs, ot_loworderfees, and any ot_shipping value, and voila
if ((pid ==  'ot_custom') || (pid == defaultTaxName + 'ot_shipping') || (pid == 'p-total_incl') || (pid == 'ot_loworderfee')) {
sum += Number(el[i].value);
 }

 

and add directly below it

if (pid ==  'ot_payment') {
 sum -= Number(el[i].value);
}

 

Find at about line 1008

if (pid == defaultTaxName + 'ot_shipping') {
 var taxRate = document.getElementById("shipping_tax-" + defaultTaxName).value; 
 sum += Number(el[i].value) * taxRate / 100; 
}//end if pid == defaultTaxName + 'ot_shipping'

 

and add directly below it

if (pid == 'ot_payment') {
 var taxRate = document.getElementById("shipping_tax-" + defaultTaxName).value; 
 sum -= Number(el[i].value) * taxRate / 100; 
}//end if pid == 'ot_payment'

 

and let me know how this goes. I have a feeling this may not work perfectly but at worst it should be pretty close.

 

You do need to enter in a tax rate in the shipping tax input box or Order Editor will not assess a tax rate on the shipping and discount fees.

 

For the orders you have already changed with Order Editor, you will have to manually change the class values back to ot_payment in the database. The class should not have been changed to ot_custom; I'll look into this.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

and let me know how this goes. I have a feeling this may not work perfectly but at worst it should be pretty close.

 

You do need to enter in a tax rate in the shipping tax input box or Order Editor will not assess a tax rate on the shipping and discount fees.

 

For the orders you have already changed with Order Editor, you will have to manually change the class values back to ot_payment in the database. The class should not have been changed to ot_custom; I'll look into this.

 

Wow, thanks a lot for that great support!!!

 

I've done that changes and now discount is calculated right after editing.

And if I enter a tax rate into the shipping tax input box, the tax on discount and shipping is calculated right.

But then it is listed like this:

 

subtotal: 4.50EUR

tax: 0.68EUR (included tax on shipping+discount)

discount: 0.09EUR

shipping: 5.00EUR

included tax: 0.62EUR (included tax subtotal)

total: 9.41EUR

 

So every position is calculated exactly right.

But is there a chance to list it like this?:

 

subtotal: 4.50EUR

discount: 0.09EUR

shipping: 5.00EUR

included tax: 1.30 EUR (tax+included tax)

total: 9.41EUR

 

included Tax only once. That would be perfect ;-)

 

If its not so easy to solve my last problem (only one billitem for tax), I would also be happy with a quick and dirty solution ;-)

Link to comment
Share on other sites

Wow, thanks a lot for that great support!!!

 

I've done that changes and now discount is calculated right after editing.

And if I enter a tax rate into the shipping tax input box, the tax on discount and shipping is calculated right.

But then it is listed like this:

 

subtotal: 4.50EUR

tax: 0.68EUR (included tax on shipping+discount)

discount: 0.09EUR

shipping: 5.00EUR

included tax: 0.62EUR (included tax subtotal)

total: 9.41EUR

 

So every position is calculated exactly right.

But is there a chance to list it like this?:

 

subtotal: 4.50EUR

discount: 0.09EUR

shipping: 5.00EUR

included tax: 1.30 EUR (tax+included tax)

total: 9.41EUR

 

included Tax only once. That would be perfect ;-)

 

If its not so easy to solve my last problem (only one billitem for tax), I would also be happy with a quick and dirty solution ;-)

 

It could be dirty, but it might not be quick. How many tax classes do you have set at Administration->Locations/Taxes->Tax Classes (admin/tax_classes.php)?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

only one...

 

That makes it easier. How many tax rates do you have defined at Administration->Locations/Taxes->Tax Rates (admin/tax_classes.php)? Which ones are showing up in the orders you're having trouble with?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

That makes it easier. How many tax rates do you have defined at Administration->Locations/Taxes->Tax Rates (admin/tax_classes.php)? Which ones are showing up in the orders you're having trouble with?

 

also only one tax rates

and only one tax zone

 

In the order.php I have only one tax item and eyerything is calculated right.

But if I use the order editor I have to set the shipping tax on 16% to calculate right. After that I have 2 tax items.

Link to comment
Share on other sites

also only one tax rates

and only one tax zone

 

In the order.php I have only one tax item and eyerything is calculated right.

But if I use the order editor I have to set the shipping tax on 16% to calculate right. After that I have 2 tax items.

 

That's actually pretty weird.

 

In your order data, you're getting one tax rate, aka "included tax", that's assessed at checkout, but when Order Editor does its thing it adds a new tax field, "Tax", which is the result of the addition of the tax on shipping and discount.

 

That's now how it's supposed to work. For some reason Order Editor is not recognizing your normal tax rate as the rate that's applicable to the order, which it should. Go into your database and check out the tax_rates table. For one thing, make sure there's only one tax rate saved in the table, and also tell me what the tax_zone_id is for that tax rate is.

 

Incidentally, is your shipping tax always or almost always 16%? If so you can set that as the default in the database. Just go to the orders table and under "Structure" edit the shipping_tax field by changing the default to 16.0000. The shipping tax rate will then show up as 16% for all new orders.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

also only one tax rates

and only one tax zone

 

In the order.php I have only one tax item and eyerything is calculated right.

But if I use the order editor I have to set the shipping tax on 16% to calculate right. After that I have 2 tax items.

 

Also, check the tax_class table in your database. Make sure there is only one tax class listed and for that class post the tax_class_id.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...