Skip to content

Commit 3ef3e80

Browse files
committed
ACP2E-92: Credit memo with decimal qty could be created via API even in case decimal qty disabled
1 parent be9b1fe commit 3ef3e80

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

app/code/Magento/Sales/Model/Order/Creditmemo/Validation/QuantityValidator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ public function validate($entity)
8383
}
8484
$orderItem = $orderItemsById[$item->getOrderItemId()];
8585

86+
if (!$orderItem->getIsQtyDecimal() && (floor($item->getQty()) !== $item->getQty())) {
87+
$messages[] =__(
88+
'You cannot use decimal quantity to refund item "%1".',
89+
$item->getSku()
90+
);
91+
continue;
92+
}
93+
8694
if (!$this->canRefundItem($orderItem, $item->getQty(), $invoiceQtysRefundLimits) ||
8795
!$this->isQtyAvailable($orderItem, $item->getQty())
8896
) {

app/code/Magento/Sales/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,3 +806,4 @@ If set YES Email field will be required during Admin order creation for new Cust
806806
"The coupon code has been removed.","The coupon code has been removed."
807807
"This creditmemo no longer exists.","This creditmemo no longer exists."
808808
"Add to address book","Add to address book"
809+
"You cannot use decimal quantity to refund item","You cannot use decimal quantity to refund item"

0 commit comments

Comments
 (0)