Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

I am a great fan of Order editor and have been using it since version 1.75 without any issues. Recently I upgraded from version 2.2.1 to version 2.5 and noticed that the stock level stopped being updated. I patiently waited for the next rollup to see if this would fix the problem 2.6.2 and have diligently install this but the issue still exists.

 

Has anyone any idea what I should be looking for or how I might fix this problem?

Order Editor is set to update stock if "Check stock level" at Administration->Configuration->Stock is set to 'true'. However after looking at this again it probably makes more sense to go by the setting of "Subtract stock".

 

If you have "Check stock level" set to 'false' but "Subtract stock" set to 'true', do this: go into the code for admin/edit_orders.php and change every instance of

STOCK_CHECK

to

STOCK_LIMITED

Edited by djmonkey1

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

thx the tax is calculated correct

but the netto-amount is not correct

the netto-amount must be the subtotal without all tax

 

What's missing? Just the shipping charge (without the shipping tax)?

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

Did you get all the changes to admin/includes/classes/order.php?
Hi djMonkey1, you were right ! I did the change in the file not in the admin ! Here is what happens when I want to go too quickly ...

:thumbsup: Thank you everything's works more than fine ! the javascript function is too strong ! well done for all the developers.

Seb

Osc 2.2 MS2

Link to comment
Share on other sites

Hi djmonkey1,

First of all sorry for my English :blush:

I'm from Italy, and here we have a lot of problems with taxes as we also have to indicate some tax value at 0 :'( (I understend this could seem strange, but I'm in Italy.....)

 

So, I used your contribution to edit orders and I made some changes to be able to have 0? taxes shown, but it happen a strange things:

- customers made his order -> ok

When I open the order editor I have a situation like this one:

 

spese1yx3.jpg

which is CORRECT...

If I update the order my situation changes in this way ....

spese2fl1.jpg

:huh: :huh: ALL taxes at 0 ? disappears......

I update again (always without adding or changes any product)

spese3vo1.jpg

 

My 0? taxes appears in the correct way :blink:

 

I'm not able to find where I have to modify to solve this problem :blush: can you help me ?

Thank you very much.

Sara

Link to comment
Share on other sites

Hi,

 

we got a little problem with our order editor and i hope you can help us. When we add a voucher to the order (or change something related to the voucher), the calculation ignores the reduced amount and show only the tax of the total amount and not the reduced tax (very confusing sentence :blink: )

 

For Example:

problem.jpg

 

A: is a voucher with an amount of 100

 

B: is the sum of all bought stuff

 

C: is the tax of: the sum of all products

 

But we need at "C" the tax of "B" the reduced amount. Any idea what's the reason for that or where we have to change a setting?

Link to comment
Share on other sites

Hi djmonkey1,

First of all sorry for my English :blush:

I'm from Italy, and here we have a lot of problems with taxes as we also have to indicate some tax value at 0 :'( (I understend this could seem strange, but I'm in Italy.....)

 

So, I used your contribution to edit orders and I made some changes to be able to have 0? taxes shown, but it happen a strange things:

- customers made his order -> ok

When I open the order editor I have a situation like this one:

which is CORRECT...

If I update the order my situation changes in this way ....

:huh: :huh: ALL taxes at 0 ? disappears......

I update again (always without adding or changes any product)

 

My 0? taxes appears in the correct way :blink:

 

I'm not able to find where I have to modify to solve this problem :blush: can you help me ?

Thank you very much.

Sara

 

Try this:

 

At line 420 find

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_tax") ) { // value = 0 => Delete Total Piece

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,

 

we got a little problem with our order editor and i hope you can help us. When we add a voucher to the order (or change something related to the voucher), the calculation ignores the reduced amount and show only the tax of the total amount and not the reduced tax (very confusing sentence :blink: )

 

For Example:

 

A: is a voucher with an amount of 100

 

B: is the sum of all bought stuff

 

C: is the tax of: the sum of all products

 

But we need at "C" the tax of "B" the reduced amount. Any idea what's the reason for that or where we have to change a setting?

 

You're adding the vouchers yourself via Order Editor?

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

Yes right the shipping charge without the tax is missing

In addition to the previous changes:

 

At line 258 find

// 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);
		 $RunningNetto += $ot_value - (($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);
$RunningNetto += $ot_value;
				}
			}
		  }
		}

 

At about line 563 find

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

	while ($ot_shipping_info = tep_db_fetch_array($ot_shipping_query)) {
	  $ot_shipping_value = $ot_shipping_info['value'];

	if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$RunningTax[$default_tax_name] += ($ot_shipping_value * $order->info['shipping_tax'] / ($order->info['shipping_tax'] + 100));
			} else {
 $RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value);

				}// end if (DISPLAY_PRICE_WITH_TAX == 'true') {
				}// end while

	// end shipping tax calcs

and change it to

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

	while ($ot_shipping_info = tep_db_fetch_array($ot_shipping_query)) {
	  $ot_shipping_value = $ot_shipping_info['value'];

	if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$RunningTax[$default_tax_name] += ($ot_shipping_value * $order->info['shipping_tax'] / ($order->info['shipping_tax'] + 100));
	   $RunningNetto += $ot_shipping_value -  (($ot_shipping_value * $order->info['shipping_tax']) /  ($order->info['shipping_tax'] + 100));
			} else {
 $RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value);
 $RunningNetto += $ot_shipping_value;

				}// end if (DISPLAY_PRICE_WITH_TAX == 'true') {
				}// end while

	// end shipping tax calcs

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

Order Editor is set to update stock if "Check stock level" at Administration->Configuration->Stock is set to 'true'. However after looking at this again it probably makes more sense to go by the setting of "Subtract stock".

 

If you have "Check stock level" set to 'false' but "Subtract stock" set to 'true', do this: go into the code for admin/edit_orders.php and change every instance of

STOCK_CHECK

to

STOCK_LIMITED

 

Your'e Spot on.

 

I didn't want to stop people from ordering if we ran out of stock but with 900 items I still needed to monitor stock levels. Iv'e made the change you suggested and can confirm that it is now working perfectly.

 

Thank you for your'e quick response.

Scott Lawry

Link to comment
Share on other sites

Order Editor is set to update stock if "Check stock level" at Administration->Configuration->Stock is set to 'true'. However after looking at this again it probably makes more sense to go by the setting of "Subtract stock".

 

If you have "Check stock level" set to 'false' but "Subtract stock" set to 'true', do this: go into the code for admin/edit_orders.php and change every instance of

STOCK_CHECK

to

STOCK_LIMITED

 

Your'e Spot on.

 

I didn't want to stop people from ordering if we ran out of stock but with 900 items I still needed to monitor stock levels. Iv'e made the change you suggested and can confirm that it is now working perfectly.

 

Thank you for your'e quick response.

Scott Lawry

Link to comment
Share on other sites

You're adding the vouchers yourself via Order Editor?

 

Not really. We use the "Credit Class & Gift Voucher" Module for the vouchers. The customer can add the voucher code in the handling of payment. After he had done this amount of the voucher will be subtract from his bill. On the bill everythink works fine. The tax is calculated right, the total amount of the bill is right and everything else is ok.

 

But if i click on update in the order editor (no matter i change something or not) the amount of the tax change. It use the normal amount (without a voucher) to calculate the tax and so we got the tax of the complete price without any voucher. The problem is we need the tax of the reduced amount (the one with voucher). I know it's very confusing to understand that but i hope you can help me with that problem.

Link to comment
Share on other sites

Try this:

 

At line 420 find

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_tax") ) { // value = 0 => Delete Total Piece

:thumbsup: works fine. Thank you !! (w00t)

Sara

Link to comment
Share on other sites

Not really. We use the "Credit Class & Gift Voucher" Module for the vouchers. The customer can add the voucher code in the handling of payment. After he had done this amount of the voucher will be subtract from his bill. On the bill everythink works fine. The tax is calculated right, the total amount of the bill is right and everything else is ok.

 

But if i click on update in the order editor (no matter i change something or not) the amount of the tax change. It use the normal amount (without a voucher) to calculate the tax and so we got the tax of the complete price without any voucher. The problem is we need the tax of the reduced amount (the one with voucher). I know it's very confusing to understand that but i hope you can help me with that problem.

 

Simple then- I just need to know the ot_class value of the vouchers as stored in the orders_total table. For instance total is ot_total, subtotal is ot_subtotal, etc. You can also find this in the order total module itself, near the top of the file, as in "class ot_total {".

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

Ok. "ot_coupon" must be the value you need.

 

So you would want to find at about line 258

// 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

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") || ($ot_class == "ot_coupon") )//a good place to add in custom total components

 

Then at about line 563 find

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

 

and change it to

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

 

Then find at about line 956

//shipping tax is added to the default tax class
 if (p == 'ot_shipping') {

and change it to

//shipping tax is added to the default tax class
 if ( (p == 'ot_shipping') || (p == 'ot_coupon') ) {

 

Then find at about line 995

if ((pid ==  'ot_custom') || (pid == 'ot_shipping') || (pid == 'p-total_incl') || (pid == 'ot_loworderfee')) {

and change it to

if ( (pid ==  'ot_custom') || (pid == 'ot_shipping') || (pid == 'p-total_incl') || (pid == 'ot_loworderfee') || (pid == 'ot_coupon') ) {

 

Then find at about line 1003

//This has to be done independently since the grand total doesn't count the various tax totals
 if (pid == 'ot_shipping') {

and change it to

//This has to be done independently since the grand total doesn't count the various tax totals
 if ( (pid == 'ot_shipping') || (pid == 'ot_coupon') ) {

 

See how it works then.

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

Tax subtotal netto and shipping is calculat correct

every free space and by example ot_cod_fee calc wrong

 

calc5.jpg

 

is it posible to let all free space and all value who comes in calculate same like the shipping cost

so all + tax and included in the netto amount ?

 

must it looks like ????

ot_cod_fee

 

136

$RunningSubTotal = 0;

$RunningNetto = 0;

$RunningCod_Fee = 0;

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

 

 

258

// 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);

$RunningNetto += $ot_value - (($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);

$RunningNetto += $ot_value;

$RunningCod_Fee += $ot_value;

}

}

}

}

Link to comment
Share on other sites

See how it works then.

 

Doesn't look good :(

 

The amout of "ot_coupon" is added to the total amout (all products + tax) but it has no effect to the tax. No matter if we add or substract something to the bill :(

 

This problem makes me crazy :wacko:

Edited by PavelMeggle
Link to comment
Share on other sites

Doesn't look good :(

 

The amout of "ot_coupon" os added the the total amout (all products + tax) but it has no effect to the tax. No matter if we add or substract something to the bill :(

 

This problem makes me crazy :wacko:

 

First off, you have to enter a tax rate in the "Shipping tax" field.

 

Secondly, in the screenshot you showed the value was displayed as a negative. The problem you're having with it being added to the total would only occur if it was stored as a positive value. If it's stored as a positive but meant to used as a negative the changes will have to be very different.

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

Tax subtotal netto and shipping is calculat correct

every free space and by example ot_cod_fee calc wrong

 

is it posible to let all free space and all value who comes in calculate same like the shipping cost

so all + tax and included in the netto amount ?

 

must it looks like ????

 

You didn't mention ot_cod_fee before and now I'm confused about what it is you're trying to do.

 

Let me get this straight: the netto amount is actually the total minus the tax then? The changes I gave to you were for a subtotal amount that doesn't include tax.

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 didn't mention ot_cod_fee before and now I'm confused about what it is you're trying to do.

 

Let me get this straight: the netto amount is actually the total minus the tax then? The changes I gave to you were for a subtotal amount that doesn't include tax.

Sorry for don mention ot_cod_fee, i fergot it too :-(

I try to do get all fields (cod_fee field, and all other free feelds) with tax working. same like the shipping field works. so if i put in 16.00 in the shipping tax, than it should calc shipping-field, cod_fee-field and if there is any amont in one of the free-fields with the 16.00 tax.

The netto amount is subtotal without all tax.

 

sorry for my poor english...its difficult to explain, hope you know what i mean

Link to comment
Share on other sites

Sorry for don mention ot_cod_fee, i fergot it too :-(

I try to do get all fields (cod_fee field, and all other free feelds) with tax working. same like the shipping field works. so if i put in 16.00 in the shipping tax, than it should calc shipping-field, cod_fee-field and if there is any amont in one of the free-fields with the 16.00 tax.

The netto amount is subtotal without all tax.

 

sorry for my poor english...its difficult to explain, hope you know what i mean

 

Ah- so the netto amount is mostly ok but the tax total is wrong?

Edited by djmonkey1

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

In the sample above

the test1 5.00 and the cod_fee (nachnahmegeb?hr) 7.00 is only inside the subtotal

its missing in the taxtotal and inside the netto

Ok- let's take this slow.

 

In addition to the previous changes:

 

At about line 258 find

// 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

 

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") || ($ot_class == "ot_cod_fee") || ($ot_class == "ot_custom") )//a good place to add in custom total components

 

At about line 563 find

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

 

and change it to

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

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...