If I trick function eoGetOrderTotalTax to return the tax on the quantity discount and make it a negative quantity, the order total and order tax is correct. In my test cases, the discount is $5.00 and the tax is 6%, or $0.30. See code below.
Code:
// -----
// 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'], array('ot_subtotal', 'ot_tax', 'ot_shipping', 'ot_total'))) {
continue;
}
$current_total_tax = $eo->eoGetOrderTotalTax($oID, $current_total['class']);
$current_total_tax = -0.3; // trick out function for test case
$order->info['tax'] -= $current_total_tax;
}
Bookmarks