Created
February 26, 2014 12:46
-
-
Save punkstar/9228896 to your computer and use it in GitHub Desktop.
A core Magento fix for if you have negative subtotals on invoices after applying at least a 100% discount to the order (but the customer has to pay shipping).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php | |
index 25bbcc7..38587f4 100644 | |
--- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php | |
+++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php | |
@@ -47,7 +47,8 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In | |
$orderItem = $item->getOrderItem(); | |
$orderItemQty = $orderItem->getQtyOrdered(); | |
- if ($orderItem->getTaxAmount() && $orderItemQty) { | |
+ // Need to check if we've got tax or hidden_tax applied to the item so that we calculate the row subtotal correctly | |
+ if (($orderItem->getTaxAmount() || $orderItem->getHiddenTaxAmount()) && $orderItemQty) { | |
if ($item->getOrderItem()->isDummy()) { | |
continue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the fix; I've entered it an prioritized in our backlog.