Skip to content

Commit

Permalink
MAGETWO-46808: [GITHUB] Admin order creation fails when "Include Tax …
Browse files Browse the repository at this point in the history
…In Order Total" set to yes #2675

 -- fixed undefined tax index when on backend order page when tax_amount is 0
  • Loading branch information
Robert He committed Dec 16, 2015
1 parent 8950a8e commit 156f449
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions app/code/Magento/Sales/view/adminhtml/templates/order/create/totals/tax.phtml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

// @codingStandardsIgnoreFile

$taxAmount = $block->getTotal()->getValue();
?>
<?php if (($taxAmount == 0 && $this->helper('Magento\Tax\Helper\Data')->displayZeroTax()) || ($taxAmount > 0)): ?>
<?php global $taxIter; $taxIter++; ?>
<?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?>
<?php $isTop = 1; ?>
Expand Down Expand Up @@ -50,3 +52,5 @@
</td>
<td style="<?php /* @escapeNotVerified */ echo $block->getTotal()->getStyle() ?>" class="admin__total-amount"><?php /* @escapeNotVerified */ echo $block->formatPrice($block->getTotal()->getValue()) ?></td>
</tr>
<?php endif;?>

16 changes: 7 additions & 9 deletions app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,13 @@ public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Qu
$area = 'taxes';
}

if ($amount != 0 || $this->_config->displayCartZeroTax($store)) {
$totals[] = [
'code' => $this->getCode(),
'title' => __('Tax'),
'full_info' => $applied ? $applied : [],
'value' => $amount,
'area' => $area,
];
}
$totals[] = [
'code' => $this->getCode(),
'title' => __('Tax'),
'full_info' => $applied ? $applied : [],
'value' => $amount,
'area' => $area,
];

/**
* Modify subtotal
Expand Down

0 comments on commit 156f449

Please sign in to comment.