fix Order::getRemainingUnrefundedItems

This commit is contained in:
Jérémy Munsch 2023-05-19 15:44:50 +02:00
parent 9a0f882025
commit 68c8705dd3
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -393,14 +393,10 @@ class Order extends Model
$orderedItems->each(function (
object $basketItem
) use (
$shippedItems,
$refundedTransactionsQtys,
$remainingItems
) {
$qty = $basketItem->qty;
if ($shippedItems->contains('id', $basketItem->id)) {
$qty -= $shippedItems->where('id', $basketItem->id)->first()->qty;
}
if ($refundedTransactionsQtys->contains('id', $basketItem->id)) {
$qty -= $refundedTransactionsQtys->where('id', $basketItem->id)->first()->qty;
}