Quote Originally Posted by swguy View Post
The root cause of the deleted tax line is in the block that handles the "rogue" ot_tax value.
(Around 1449 of ./includes/functions/extra_functions/edit_orders_functions.php).

My tax title is Sales tax (if any) + Shipping Tax (0.0000%) + Tax:

which does not work for the clause

`title` NOT IN ($tax_groups)

Perhaps a LIKE would be better - something like

Code:
foreach ($tax_groups as &$tax_group) {
   $tax_group = '%' . $db->prepareInput($tax_group) .'%'. ':';
}
$tax_groups = "'" . implode("', '", $tax_groups) . "'";
...
$query = 
                "DELETE FROM " . TABLE_ORDERS_TOTAL . "
                  WHERE orders_id = $oID
                    AND `class` = 'ot_tax'
                    AND `title` NOT IN (";  
for ($i = 0; $i < count($tax_groups); $i++) {
   if ($i > 0) $query .= ","; 
   $query .= $tax_groups[$i]; 
}
$query .= ")";
Hmm, looks like you've got My Store::Show Split Tax Lines set to false. Let me investigate further.