Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

Where does this value show up? In the totals components section? Also what is actually written in the database for this prior to using Order Editor on it? For example, is it something like

 

<font color="red">Redeemed Point</font>

 

 

Yes I am using the latest version, just downloaded and installed shortly before original post.

 

OK.. here's the info

 

I open an Order for a customer (regardless of status) and it appears like this

first.jpg

 

I then select edit and the screen shows this

second.jpg

 

This entry in the database is under the orders_total and is set up like this

third.jpg

 

If I edit the order and resave the order looks as it does in the first phote above, but the points are in black and are now added to the total (since it drops the - in front of the entery in the database.)

 

If I can be of any more help to fix this, let me know. I just finished d/l the contrib again adn went through all the step (to make sure I did it right and to make sure I did in fact d/l the latest and all the code match - looked at it through win merge also.)

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Yes I am using the latest version, just downloaded and installed shortly before original post.

 

OK.. here's the info

 

I open an Order for a customer (regardless of status) and it appears like this

 

 

I then select edit and the screen shows this

 

This entry in the database is under the orders_total and is set up like this

 

 

If I edit the order and resave the order looks as it does in the first phote above, but the points are in black and are now added to the total (since it drops the - in front of the entery in the database.)

 

If I can be of any more help to fix this, let me know. I just finished d/l the contrib again adn went through all the step (to make sure I did it right and to make sure I did in fact d/l the latest and all the code match - looked at it through win merge also.)

 

The screenshots were excellent- please post one of what orders_totals looks like on an order with points before you use Order Editor. I think I have an idea of what is happening and how to fix 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

The screenshots were excellent- please post one of what orders_totals looks like on an order with points before you use Order Editor. I think I have an idea of what is happening and how to fix it.

 

The 1st screen shot is Before

 

As you can see, in the 2nd when I clicked edit, the screen shot shows the number as positive, OE dropped the - from the value. So when I update it is now a positive.

 

A screen shot of afterwards wasn't included, though the difference from the 1st screen shot to afterwards is that it's all black, and since it is not a positive it is added to the total.

 

The third screen shot is the orders_total table Before using the editor. It's difficult to see, but the - is on the above line right after FF0000">

 

I like the negative showing as red, but that's not my concern... it more of the neg/pos reversal

Edited by custodian

My Contributions

 

Henry Smith

Link to comment
Share on other sites

The third screen shot is the orders_total table Before using the editor. It's difficult to see, but the - is on the above line right after FF0000">

 

I like the negative showing as red, but that's not my concern... it more of the neg/pos reversal

 

The problem lies with the Points Rewards contribution then. It has to write the "value" as -5.00 as well as writing the "text" as -$5.00.

 

Order Editor uses the "value" as it's doing calculations and it can't use the values with a $ in them.

 

When you first look at an order using Order Editor, OE has not changed anything. It's showing you exactly what is written in the database. Nothing is changed unless and until you hit "Update".

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

The problem lies with the Points Rewards contribution then. It has to write the "value" as -5.00 as well as writing the "text" as -$5.00.

 

Order Editor uses the "value" as it's doing calculations and it can't use the values with a $ in them.

 

When you first look at an order using Order Editor, OE has not changed anything. It's showing you exactly what is written in the database. Nothing is changed unless and until you hit "Update".

 

If the "value" has to be written as a positive number for Points Rewards to function properly, we will have to come up with custom code to account for 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

Well, here's another small concern, a logical and practical one ?

 

In the Table 4. Discount, Shipping and Total : the sub-total is displayed without tax. But the discount entered must include tax. And the tax displayed is only related to the sub-total, which creates confusion on the invoice (by the way, it's the same in the Oscommerce special option).

 

What would be great is to have the possibility of adding a discount by percentage on the price without tax (adding %, which is simplier than having to calculate) or number just like the special option. And to display the total tax of the subtotal and the discount.

 

Just an idea !

 

Thanks for all your efforts !

 

Ted

Link to comment
Share on other sites

Well, here's another small concern, a logical and practical one ?

 

In the Table 4. Discount, Shipping and Total : the sub-total is displayed without tax. But the discount entered must include tax. And the tax displayed is only related to the sub-total, which creates confusion on the invoice (by the way, it's the same in the Oscommerce special option).

 

What would be great is to have the possibility of adding a discount by percentage on the price without tax (adding %, which is simplier than having to calculate) or number just like the special option. And to display the total tax of the subtotal and the discount.

 

Just an idea !

 

Thanks for all your efforts !

 

Ted

 

You want to apply tax to discounts? So if you had a discount of 5.00 and a tax of 10%, the discount would really be $5.50?

 

Or you want to charge tax on discounts, so the discount in this example would only be $4.50?

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

The problem lies with the Points Rewards contribution then. It has to write the "value" as -5.00 as well as writing the "text" as -$5.00.

 

Order Editor uses the "value" as it's doing calculations and it can't use the values with a $ in them.

 

When you first look at an order using Order Editor, OE has not changed anything. It's showing you exactly what is written in the database. Nothing is changed unless and until you hit "Update".

 

So you're sayig the orders_total shouldn't have

 

<font="FF0000> - <--- Negative here as it current is

$5.00

 

 

But should be in the db as

 

<font="FF0000>

-$5.00

^--------------Negative Here in order of OE it process it properly

 

?

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Well, here's another small concern, a logical and practical one ?

 

In the Table 4. Discount, Shipping and Total : the sub-total is displayed without tax. But the discount entered must include tax. And the tax displayed is only related to the sub-total, which creates confusion on the invoice (by the way, it's the same in the Oscommerce special option).

 

Ted

 

I didn't know this!

 

Do you know for sure if this is for all states in the US or based on individual State tax laws?

(Ie: Some states can charge tax on Shipping, though in Pennsylvania we do not)

My Contributions

 

Henry Smith

Link to comment
Share on other sites

If the "value" has to be written as a positive number for Points Rewards to function properly, we will have to come up with custom code to account for this.

 

Nevermind, I was taking your word or "Value" as a variable and not as the actual "Value" table. I see what you mean, that it is -$5.00 in one field and 5.00 in the other.

 

I appreciate your efforts, though since this isn't an issue with OE, I'll shot over to PR and let them know.

 

Thanks for your time and effort in clearing this up.

My Contributions

 

Henry Smith

Link to comment
Share on other sites

Hi,

 

Thanks for your quick replies ! I'm in France and you know what it is, French people always create problems... :rolleyes: Yes I would like to apply tax on the discount. For instance :

I'm selling a product for $100 without tax. The tax is 10%. I would like to make a 20% discount, which usually applies to the price without tax.

 

So the ideal invoice would be :

 

- product : $100

- discount : -20% = -$20

 

- total without tax : $80

- tax : 10% on total = $8

- total with tax : $88

 

Actually the displayed tax is 10% on $100 = $10, which doesn't take account of the discount. And having the possibility of making the disount in percentage too would be great !

 

Ted

Link to comment
Share on other sites

Will post zip file into contribution once I change the code to proper osC spec, but here's a little hack for people using the SPPC contribution (Separate Price Per Customer contribution):

 

If you have the SPPC contribution installed, (any version) this addition to the Order Editor will make it respect the price group of the customer who's order is being edited -- when you add a product:

 

Find the following code around Line 485 of catalog/admin/edit_orders.php:

 

if ($new_price) 
{
$p_products_price = $new_price['specials_new_products_price'];
}

 

After it add:

 

 

	// first find out the customer associated with this order ID..
$c_id_result = tep_db_query('select customers_id from orders where orders_id="' . $oID . '"');
$cid = tep_db_fetch_array($c_id_result);
if ($cid){
	$cust_id = $cid['customers_id'];
	// now find the customer's group.
	$c_g_id_result = tep_db_query('select customers_group_id from customers where customers_id="' . $cust_id . '"');
	$c_g_id = tep_db_fetch_array($c_g_id_result);
	if ($c_g_id){
		$cust_group_id = $c_g_id['customers_group_id'];
		// get the price of the product from the products_groups table.
		$price_result = tep_db_query('select customers_group_price from products_groups where products_id="' . $p_products_id . '" and customers_group_id="' . $cust_group_id . '"');
		$price_array = tep_db_fetch_array($price_result);
		if ($price_array){
			// set the price of the new product to the group specific price.
			$p_products_price = $price_array['customers_group_price'];
		}
	}					
}

Link to comment
Share on other sites

Hi,

 

Thanks for your quick replies ! I'm in France and you know what it is, French people always create problems... :rolleyes: Yes I would like to apply tax on the discount. For instance :

I'm selling a product for $100 without tax. The tax is 10%. I would like to make a 20% discount, which usually applies to the price without tax.

 

So the ideal invoice would be :

 

- product : $100

- discount : -20% = -$20

 

- total without tax : $80

- tax : 10% on total = $8

- total with tax : $88

 

Actually the displayed tax is 10% on $100 = $10, which doesn't take account of the discount. And having the possibility of making the disount in percentage too would be great !

 

Ted

 

In it's current configuration, Order Editor calculates tax per product, not by the whole order. What this means is the tax total it calculates doesn't have anything to do with the subtotal- the two are figured independently. For instance, one could have an order where only some of the products are taxed, and the ones that are taxed could be taxed at different rates. This necessitates calculating tax per product.

 

Is this discount being calculated in the manner you're asking for during checkout?

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

Thanks for your quick replies ! I'm in France and you know what it is, French people always create problems... :rolleyes:

 

It hasn't escaped me that the overwhelming majority of people having problems with tax calcs are in France....

 

C'est la vie, eh?

 

:)

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

Nevermind, I was taking your word or "Value" as a variable and not as the actual "Value" table. I see what you mean, that it is -$5.00 in one field and 5.00 in the other.

 

I appreciate your efforts, though since this isn't an issue with OE, I'll shot over to PR and let them know.

 

Thanks for your time and effort in clearing this up.

 

Did you have to edit your admin/invoice.php to work with this contribution?

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 have to edit your admin/invoice.php to work with this contribution?

 

 

NO, (and I ran a diff on the stock file and mine to make sure)though I have do have 3 sections of the invoice.php that have been modified. I've installed Better Invoice Order Number; which shouldn't be casuing my problems That code is in two spots like such

 

<!-- order number addon START //-->
</TR>
<TR Align="RIGHT">
<TD><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></TD>

<!-- order number addon END //-->

 

The second part is

 <tr>
	<td class="main"><b><?php echo "ORDER#:"; ?></b></td>
	<td class="main"><?php echo tep_trans_id($order->info['date_purchased'], $oID); ?></td>
  </tr>

 

The Third section is an Improved Invoice Contrib that is the following

 

<!-- Improved Invoice -->
<?php
$orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
 while ($orders_status = tep_db_fetch_array($orders_status_query)) {
$orders_statuses[] = array('id' => $orders_status['orders_status_id'],
						   'text' => $orders_status['orders_status_name']);
$orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
 }
 ?>

<CENTER>
<table width="70%" border="1" cellspacing="0" cellpadding="2">
<P>
<BR>
<P>
<BR>
<P>
<BR>
<P>
<tr>
<td class="smallText" align="center"><b>Date Added</b></td>
<td class="smallText" align="center"><b>Status</b></td>
<td class="smallText" align="center"><b>Comments</b></td>
</tr>
<tr>
<?php
$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
if (tep_db_num_rows($orders_history_query)) {
  while ($orders_history = tep_db_fetch_array($orders_history_query)) {
	echo '		  <tr>' . "\n" .
		 '			<td class="smallText" valign="middle" align="center" width = 100>' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
		 '			<td class="smallText" valign="middle" align="center" width = 100>' . $orders_status_array[$orders_history['orders_status_id']] . ' </td>' . "\n" .
		 '			<td class="smallText" valign="middle">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .
		 '		  </tr>' . "\n";
  }
} else {
	echo '		  <tr>' . "\n" .
		 '			<td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
		 '		  </tr>' . "\n";
}
?>
</tr>
</table></CENTER>
<!-- End Improved Invoice -->

 

The entire code put together is

 

<?php
/*
 $Id: invoice.php,v 1.6 2003/06/20 00:37:30 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
 $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 include(DIR_WS_CLASSES . 'order.php');
 $order = new order($oID);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- body_text //-->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
	<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td>
  </tr>
</table></td>
 </tr>
 <tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
	<td colspan="2"><?php echo tep_draw_separator(); ?></td>
<!-- order number addon START //-->
</TR>
<TR Align="RIGHT">
<TD><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></TD>

<!-- order number addon END //-->
  </tr>
  <tr>
	<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo $order->customer['telephone']; ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
	  </tr>
	</table></td>
	<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>
	  </tr>
	</table></td>
  </tr>
</table></td>
 </tr>
 <tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
<td><table border="0" cellspacing="0" cellpadding="2">
  <tr>
	<td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
	<td class="main"><?php echo $order->info['payment_method']; ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo "ORDER#:"; ?></b></td>
	<td class="main"><?php echo tep_trans_id($order->info['date_purchased'], $oID); ?></td>
  </tr>
</table></td>
 </tr>
 <tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="dataTableHeadingRow">
	<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
	<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
	<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
	<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
	<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
	<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
	<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
  </tr>
<?php
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
  echo '	  <tr class="dataTableRow">' . "\n" .
	   '		<td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
	   '		<td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

  if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
	for ($j = 0; $j < $k; $j++) {
	  echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
	  if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
	  echo '</i></small></nobr>';
	}
  }

  echo '		</td>' . "\n" .
	   '		<td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
  echo '		<td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
	   '		<td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
  echo '	  </tr>' . "\n";
}
?>
  <tr>
	<td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
<?php
 for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
echo '		  <tr>' . "\n" .
	 '			<td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
	 '			<td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
	 '		  </tr>' . "\n";
 }
?>
	</table></td>
  </tr>
</table></td>
 </tr>
</table>

<!-- Improved Invoice -->
<?php
$orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
 while ($orders_status = tep_db_fetch_array($orders_status_query)) {
$orders_statuses[] = array('id' => $orders_status['orders_status_id'],
						   'text' => $orders_status['orders_status_name']);
$orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
 }
 ?>

<CENTER>
<table width="70%" border="1" cellspacing="0" cellpadding="2">
<P>
<BR>
<P>
<BR>
<P>
<BR>
<P>
<tr>
<td class="smallText" align="center"><b>Date Added</b></td>
<td class="smallText" align="center"><b>Status</b></td>
<td class="smallText" align="center"><b>Comments</b></td>
</tr>
<tr>
<?php
$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
if (tep_db_num_rows($orders_history_query)) {
  while ($orders_history = tep_db_fetch_array($orders_history_query)) {
	echo '		  <tr>' . "\n" .
		 '			<td class="smallText" valign="middle" align="center" width = 100>' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
		 '			<td class="smallText" valign="middle" align="center" width = 100>' . $orders_status_array[$orders_history['orders_status_id']] . ' </td>' . "\n" .
		 '			<td class="smallText" valign="middle">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .
		 '		  </tr>' . "\n";
  }
} else {
	echo '		  <tr>' . "\n" .
		 '			<td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
		 '		  </tr>' . "\n";
}
?>
</tr>
</table></CENTER>
<!-- End Improved Invoice -->
<!-- body_text_eof //-->

<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by custodian

My Contributions

 

Henry Smith

Link to comment
Share on other sites

It hasn't escaped me that the overwhelming majority of people having problems with tax calcs are in France....

 

C'est la vie, eh?

 

:)

 

:thumbsup: He he, djmonkey, you're right ! I think I'm gonna give up... the tax on individual products isn't really a problem, it's more that the tax displayed depends only on the original price without discount (that means that the seller collects more for the State than in reality (because he only receives the money with discount and has to recalculate the tax), which is annoying, no ?

 

But it would be great to have a % discount anyway...

 

Kepp on the good work and thanks !

 

Ted

Link to comment
Share on other sites

I am curious as to what instances one would need to change an order, when the customer has alreay paid for their order for there to be an order to edit?

 

If they entered their postcode incorrectly.

 

If they want to add a product.

 

If they want to delete a product.

 

If there was a problem with calculation done for taxes, shipping, etc during the checkout process.

 

If you want to give them a discount.

 

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

I am curious as to what instances one would need to change an order, when the customer has alreay paid for their order for there to be an order to edit?

 

I use it mainly for refund/adjustments - Items sell out fairly fast and sometimes I need to refund an item that is no logner available but has been ordered and paid for.

 

The only thing I do wish I could do is edit the invoice and have it show 0 (instead of removing it), this way they would know what they ordered, but also know that it was not included in their order (Backordered - out of stock - etc...)

My Contributions

 

Henry Smith

Link to comment
Share on other sites

I use it mainly for refund/adjustments - Items sell out fairly fast and sometimes I need to refund an item that is no logner available but has been ordered and paid for.

 

The only thing I do wish I could do is edit the invoice and have it show 0 (instead of removing it), this way they would know what they ordered, but also know that it was not included in their order (Backordered - out of stock - etc...)

 

You want it to not delete items with a zero quantity?

 

Find the following section of code:

 

if($products_details["qty"] > 0) { // a.) quantity found --> add to list & sum

			$Query = "UPDATE " . TABLE_ORDERS_PRODUCTS . " set
				products_model = '" . $products_details["model"] . "',
				products_name = '" . str_replace("'", "'", $products_details["name"]) . "',
				final_price = '" . $products_details["final_price"] . "',
				products_tax = '" . $products_details["tax"] . "',
				products_quantity = '" . $products_details["qty"] . "'
				where orders_products_id = '$orders_products_id';";
			tep_db_query($Query);

			// Update Tax and Subtotals: please choose sum WITH or WITHOUT tax, but activate only ONE version;-)

			// Correction tax calculation (Michel Haase, 2005-02-18)
			//$RunningSubTotal += (tep_add_tax(($products_details["qty"] * $products_details["final_price"]), $products_details["tax"])); // version WITH tax
			 //This subtotal and tax calculation is done as part of the foreach loop that handles updating products (adds each product into the mix one by one)
			$RunningSubTotal += $products_details["qty"] * $products_details["final_price"]; // version WITHOUT tax
			$RunningTax += (($products_details['tax']/100) * ($products_details['qty'] * $products_details['final_price']));

			// Update Any Attributes
			if(isset($products_details[attributes]))
			{
				foreach($products_details["attributes"] as $orders_products_attributes_id => $attributes_details)
				{
					$Query = "UPDATE " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
						products_options = '" . $attributes_details["option"] . "',
						products_options_values = '" . $attributes_details["value"] . "',
						options_values_price ='" . $attributes_details["price"] . "',
						price_prefix ='" . $attributes_details["prefix"] . "'
						where orders_products_attributes_id = '$orders_products_attributes_id';";
					tep_db_query($Query);
				}
			}

		} else { // b.) null quantity found --> delete

			$Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';";
			tep_db_query($Query);
			$order = tep_db_fetch_array($order_query);

			if ($products_details["qty"] != $order['products_quantity']){
				$quantity_difference = ($products_details["qty"] - $order['products_quantity']);
				tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");
			}

			$Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';";
			tep_db_query($Query);
		}
	}//end of foreach
	}//end of if (is_array())

 

and change it to

 

//if($products_details["qty"] > 0) { // a.) quantity found --> add to list & sum

			$Query = "UPDATE " . TABLE_ORDERS_PRODUCTS . " set
				products_model = '" . $products_details["model"] . "',
				products_name = '" . tep_html_quotes($products_details["name"]) . "',
				final_price = '" . $products_details["final_price"] . "',
				products_tax = '" . $products_details["tax"] . "',
				products_quantity = '" . $products_details["qty"] . "'
				where orders_products_id = '$orders_products_id';";
			tep_db_query($Query);

			// Update Tax and Subtotals: please choose sum WITH or WITHOUT tax, but activate only ONE version;-)

			// Correction tax calculation (Michel Haase, 2005-02-18)
			//$RunningSubTotal += (tep_add_tax(($products_details["qty"] * $products_details["final_price"]), $products_details["tax"])); // version WITH tax
			 //This subtotal and tax calculation is done as part of the foreach loop that handles updating products (adds each product into the mix one by one)
			$RunningSubTotal += $products_details["qty"] * $products_details["final_price"]; // version WITHOUT tax
			$RunningTax += (($products_details['tax']/100) * ($products_details['qty'] * $products_details['final_price']));

			// Update Any Attributes
			if(isset($products_details[attributes]))
			{
				foreach($products_details["attributes"] as $orders_products_attributes_id => $attributes_details)
				{
					$Query = "UPDATE " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
						products_options = '" . $attributes_details["option"] . "',
						products_options_values = '" . $attributes_details["value"] . "',
						options_values_price ='" . $attributes_details["price"] . "',
						price_prefix ='" . $attributes_details["prefix"] . "'
						where orders_products_attributes_id = '$orders_products_attributes_id';";
					tep_db_query($Query);
				}
			}

		/*} else { // b.) null quantity found --> delete

			$Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';";
			tep_db_query($Query);
			$order = tep_db_fetch_array($order_query);

			if ($products_details["qty"] != $order['products_quantity']){
				$quantity_difference = ($products_details["qty"] - $order['products_quantity']);
				tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");
			}

			$Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';";
			tep_db_query($Query);
		}*/
	}//end of foreach
	}//end of if (is_array())

 

You should also do something about the "Hint" for deleting a product, probably just modify it in your language definition file.

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's fantastic!

 

I'll need to give this a try tonight during some scheduled down-time.

 

I often need to note on the account coments what was removed due to being out of stock or back ordered.

 

Will this list the price as $0.00 also?

 

Not that it needs to be, just cusrious as what to expect.

Edited by custodian

My Contributions

 

Henry Smith

Link to comment
Share on other sites

That's fantastic!

 

I'll need to give this a try tonight during some scheduled down-time.

 

I often need to note on the account coments what was removed due to being out of stock or back ordered.

 

Will this list the price as $0.00 also?

 

Not that it needs to be, just cusrious as what to expect.

 

The "Total (excl.) Total (incl.)" both show as $0.00, the products price is whatever you want it to be.

 

I'll have to do it this way from now on and add a checkbox for deleting the item. This way also allows for negative items, complete with negative tax, in case you want to issue a credit for something.

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