Skip to content

Commit d3021f9

Browse files
author
madhu-ranosys
committed
fix-26191
1 parent c2e2646 commit d3021f9

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

app/code/Magento/Sales/Block/Adminhtml/Order/Totals.php

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function _initTotals()
4848
'strong' => true,
4949
'value' => $this->getSource()->getTotalDue(),
5050
'base_value' => $this->getSource()->getBaseTotalDue(),
51-
'label' => __('Total Due'),
51+
'label' => $this->getSource()->getTotalDueCancelLabel(),
5252
'area' => 'footer',
5353
]
5454
);

app/code/Magento/Sales/Model/Order.php

100644100755
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,29 @@ public function getTotalDue()
18161816
$total = $this->priceCurrency->round($total);
18171817
return max($total, 0);
18181818
}
1819+
1820+
/**
1821+
* Retrieve order total due or cancel label
1822+
*
1823+
* @return float|null
1824+
*/
1825+
public function getTotalDueCancelLabel() {
1826+
$itemCancel = true;
1827+
foreach ($this->getAllItems() as $item) {
1828+
if ($item->getQtyCanceled() > 0) {
1829+
$itemCancel = false;
1830+
break;
1831+
}
1832+
}
1833+
if ($this->isCanceled() || $itemCancel == false) {
1834+
1835+
$label = __('Total Cancel');
1836+
} else {
1837+
1838+
$label = __('Total Due');
1839+
}
1840+
return $label;
1841+
}
18191842

18201843
/**
18211844
* Retrieve order total due value

0 commit comments

Comments
 (0)