Skip to content

Commit e88177a

Browse files
Robert HeYaroslav Voronoy
Robert He
authored and
Yaroslav Voronoy
committed
MAGETWO-46808: [GITHUB] Admin order creation fails when "Include Tax In Order Total" set to yes #2675
-- fixed undefined tax index when on backend order page when tax_amount is 0
1 parent 91b73d5 commit e88177a

File tree

2 files changed

+11
-9
lines changed
  • app/code/Magento
    • Sales/view/adminhtml/templates/order/create/totals
    • Tax/Model/Sales/Total/Quote

2 files changed

+11
-9
lines changed

app/code/Magento/Sales/view/adminhtml/templates/order/create/totals/tax.phtml

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
// @codingStandardsIgnoreFile
88

9+
$taxAmount = $block->getTotal()->getValue();
910
?>
11+
<?php if (($taxAmount == 0 && $this->helper('Magento\Tax\Helper\Data')->displayZeroTax()) || ($taxAmount > 0)): ?>
1012
<?php global $taxIter; $taxIter++; ?>
1113
<?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?>
1214
<?php $isTop = 1; ?>
@@ -50,3 +52,5 @@
5052
</td>
5153
<td style="<?php /* @escapeNotVerified */ echo $block->getTotal()->getStyle() ?>" class="admin__total-amount"><?php /* @escapeNotVerified */ echo $block->formatPrice($block->getTotal()->getValue()) ?></td>
5254
</tr>
55+
<?php endif;?>
56+

app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php

100644100755
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,13 @@ public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Qu
311311
$area = 'taxes';
312312
}
313313

314-
if ($amount != 0 || $this->_config->displayCartZeroTax($store)) {
315-
$totals[] = [
316-
'code' => $this->getCode(),
317-
'title' => __('Tax'),
318-
'full_info' => $applied ? $applied : [],
319-
'value' => $amount,
320-
'area' => $area,
321-
];
322-
}
314+
$totals[] = [
315+
'code' => $this->getCode(),
316+
'title' => __('Tax'),
317+
'full_info' => $applied ? $applied : [],
318+
'value' => $amount,
319+
'area' => $area,
320+
];
323321

324322
/**
325323
* Modify subtotal

0 commit comments

Comments
 (0)