
Originally Posted by
carlwhat
my guess is extraorderfee
Actually, it turns out that any taxable order-total exhibits this issue. See https://github.com/lat9/edit_orders/issues/198 for the upcoming changes for EO v4.6.0.
Any site experiencing this issue can correct via edit to /YOUR_ADMIN/includes/functions/extra_functions/edit_order_functions.php, removing (or commenting out) the highlighted lines below:
Code:
function eo_update_database_order_totals($oID)
{
global $db, $order, $eo;
// Load required modules for order totals if enabled
if (defined('MODULE_ORDER_TOTAL_INSTALLED') && !empty(MODULE_ORDER_TOTAL_INSTALLED)) {
$eo->eoLog(PHP_EOL . 'eo_update_database_order_totals, taxes/totals on entry. ' . $eo->eoFormatTaxInfoForLog(true), 'tax');
$eo->tax_updated = false;
$order->info['shipping_tax'] = 0;
// Load order totals.
require_once DIR_FS_CATALOG . DIR_WS_CLASSES . 'order_total.php';
$GLOBALS['order_total_modules'] = new order_total();
// Load the shopping cart class into the session
eo_shopping_cart();
// -----
// Cycle through the order-totals to see if any are currently taxed. If so, remove the
// tax from the current order in preparation for its recalculation.
//
foreach ($order->totals as $current_total) {
if (in_array($current_total['class'], ['ot_subtotal', 'ot_tax', 'ot_shipping', 'ot_total', 'ot_misc_cost'])) {
continue;
}
$current_total_tax = $eo->eoGetOrderTotalTax($oID, $current_total['class']);
$order->info['tax'] -= $current_total_tax;
}
// Reset the final total (include tax if not already tax-inc)
// This code causes the order totals to be correctly calculated.
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$order->info['total'] = $order->info['subtotal'] + $order->info['shipping_cost'];
} else {
$order->info['total'] = $order->info['subtotal'] + $order->info['tax'] + $order->info['shipping_cost'];
}