Skip to content

Commit 8101648

Browse files
ENGCOM-5511: Resolve Incorrect Quantity Displayed In Admin Area when used 'Qty s Decimals' issue 23940 #23943
- Merge Pull Request #23943 from edenduong/magento2:2.3-bugfix/incorrect_qty_display_issue23940 - Merged commits: 1. e2968e5 2. 8140afe
2 parents d3c55bb + 8140afe commit 8101648

File tree

15 files changed

+25
-25
lines changed

15 files changed

+25
-25
lines changed

app/code/Magento/Sales/view/adminhtml/templates/items/column/qty.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@
88
<table class="qty-table">
99
<tr>
1010
<th><?= $block->escapeHtml(__('Ordered')); ?></th>
11-
<td><?= (int) $item->getQtyOrdered() ?></td>
11+
<td><?= (float) $item->getQtyOrdered() ?></td>
1212
</tr>
1313

1414
<?php if ((float)$item->getQtyInvoiced()) : ?>
1515
<tr>
1616
<th><?= $block->escapeHtml(__('Invoiced')); ?></th>
17-
<td><?= (int) $item->getQtyInvoiced() ?></td>
17+
<td><?= (float) $item->getQtyInvoiced() ?></td>
1818
</tr>
1919
<?php endif; ?>
2020

2121
<?php if ((float)$item->getQtyShipped()) : ?>
2222
<tr>
2323
<th><?= $block->escapeHtml(__('Shipped')); ?></th>
24-
<td><?= (int) $item->getQtyShipped() ?></td>
24+
<td><?= (float) $item->getQtyShipped() ?></td>
2525
</tr>
2626
<?php endif; ?>
2727

2828
<?php if ((float)$item->getQtyRefunded()) : ?>
2929
<tr>
3030
<th><?= $block->escapeHtml(__('Refunded')); ?></th>
31-
<td><?= (int) $item->getQtyRefunded() ?></td>
31+
<td><?= (float) $item->getQtyRefunded() ?></td>
3232
</tr>
3333
<?php endif; ?>
3434

3535
<?php if ((float)$item->getQtyCanceled()) : ?>
3636
<tr>
3737
<th><?= $block->escapeHtml(__('Canceled')); ?></th>
38-
<td><?= (int) $item->getQtyCanceled() ?></td>
38+
<td><?= (float) $item->getQtyCanceled() ?></td>
3939
</tr>
4040
<?php endif; ?>
4141

app/code/Magento/Sales/view/adminhtml/templates/order/create/items/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
<td class="col-qty">
116116
<input name="item[<?= (int) $_item->getId() ?>][qty]"
117117
class="input-text item-qty admin__control-text"
118-
value="<?= (int) $_item->getQty() ?>"
118+
value="<?= (float) $_item->getQty() ?>"
119119
maxlength="12" />
120120
</td>
121121
<td class="col-subtotal col-price">

app/code/Magento/Sales/view/adminhtml/templates/order/create/sidebar/items.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
<?php if ($block->canDisplayItemQty()) : ?>
6060
<td class="col-qty">
61-
<?= (int) $block->getItemQty($_item) ?>
61+
<?= (float) $block->getItemQty($_item) ?>
6262
</td>
6363
<?php endif; ?>
6464

@@ -105,7 +105,7 @@
105105
type="checkbox"
106106
class="admin__control-checkbox"
107107
name="sidebar[<?= $block->escapeHtmlAttr($block->getSidebarStorageAction()) ?>][<?= (int) $block->getIdentifierId($_item) ?>]"
108-
value="<?= $block->canDisplayItemQty() ? (int) $_item->getQty() : 1 ?>"
108+
value="<?= $block->canDisplayItemQty() ? (float) $_item->getQty() : 1 ?>"
109109
title="<?= $block->escapeHtml(__('Add To Order')) ?>"/>
110110
<label class="admin__field-label"
111111
for="sidebar-<?= $block->escapeHtmlAttr($block->getSidebarStorageAction()) ?>-<?= (int) $block->getIdentifierId($_item) ?>">

app/code/Magento/Sales/view/adminhtml/templates/order/creditmemo/create/items/renderer/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<input type="text"
3030
class="input-text admin__control-text qty-input"
3131
name="creditmemo[items][<?= (int) $_item->getOrderItemId() ?>][qty]"
32-
value="<?= (int) $_item->getQty() ?>"/>
32+
value="<?= (float) $_item->getQty() ?>"/>
3333
<?php else : ?>
34-
<?= (int) $_item->getQty() ?>
34+
<?= (float) $_item->getQty() ?>
3535
<?php endif; ?>
3636
</td>
3737
<td class="col-subtotal">

app/code/Magento/Sales/view/adminhtml/templates/order/creditmemo/view/items/renderer/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<td class="col-price">
1414
<?= $block->getColumnHtml($_item, 'price') ?>
1515
</td>
16-
<td class="col-qty"><?= (int) $_item->getQty() ?></td>
16+
<td class="col-qty"><?= (float) $_item->getQty() ?></td>
1717
<td class="col-subtotal">
1818
<?= $block->getColumnHtml($_item, 'subtotal') ?>
1919
</td>

app/code/Magento/Sales/view/adminhtml/templates/order/details.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $_order = $block->getOrder() ?>
4141
<br /><?= $block->escapeHtml(__('Message:')) ?><br /> <?= $block->escapeHtml($_giftMessage->getMessage()) ?>
4242
<?php endif; ?>
4343
</td>
44-
<td align="center" valign="top" style="padding:3px 9px"><?= (int) $_item->getQtyOrdered() ?></td>
44+
<td align="center" valign="top" style="padding:3px 9px"><?= (float) $_item->getQtyOrdered() ?></td>
4545
<td align="right" valign="top" style="padding:3px 9px"><?= /* @noEscape */ $_order->formatPrice($_item->getRowTotal()) ?></td>
4646
</tr>
4747
<?php endforeach; ?>

app/code/Magento/Sales/view/adminhtml/templates/order/invoice/create/items/renderer/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<?php if ($block->canEditQty()) : ?>
1717
<input type="text" class="input-text admin__control-text qty-input"
1818
name="invoice[items][<?= (int) $_item->getOrderItemId() ?>]"
19-
value="<?= (int) $_item->getQty() ?>"/>
19+
value="<?= (float) $_item->getQty() ?>"/>
2020
<?php else : ?>
21-
<?= (int) $_item->getQty() ?>
21+
<?= (float) $_item->getQty() ?>
2222
<?php endif; ?>
2323
</td>
2424
<td class="col-subtotal">

app/code/Magento/Sales/view/adminhtml/templates/order/invoice/view/items/renderer/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<td class="col-price">
1414
<?= $block->getColumnHtml($_item, 'price') ?>
1515
</td>
16-
<td class="col-qty"><?= (int) $_item->getQty() ?></td>
16+
<td class="col-qty"><?= (float) $_item->getQty() ?></td>
1717
<td class="col-subtotal">
1818
<?= $block->getColumnHtml($_item, 'subtotal') ?>
1919
</td>

app/code/Magento/Sales/view/frontend/templates/email/items/creditmemo/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<?php endif; ?>
2828
<?= $block->escapeHtml($_item->getDescription()) ?>
2929
</td>
30-
<td class="item-qty"><?= (int) $_item->getQty() ?></td>
30+
<td class="item-qty"><?= (float) $_item->getQty() ?></td>
3131
<td class="item-price">
3232
<?= /* @noEscape */ $block->getItemPrice($_item) ?>
3333
</td>

app/code/Magento/Sales/view/frontend/templates/email/items/invoice/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<?php endif; ?>
2727
<?= $block->escapeHtml($_item->getDescription()) ?>
2828
</td>
29-
<td class="item-qty"><?= (int) $_item->getQty() ?></td>
29+
<td class="item-qty"><?= (float) $_item->getQty() ?></td>
3030
<td class="item-price">
3131
<?= /* @noEscape */ $block->getItemPrice($_item->getOrderItem()) ?>
3232
</td>

0 commit comments

Comments
 (0)