File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Model/Order/Creditmemo/Validation
Test/Unit/Model/Order/Creditmemo/Validation Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public function validate($entity)
9696
9797 if ($ entity ->getGrandTotal () <= 0 ) {
9898 $ messages [] = __ ('The credit memo \'s total must be positive. ' );
99- } elseif ($ totalQuantity <= 0 && !$ this ->canRefundShipping ($ order )) {
99+ } elseif ($ totalQuantity < 0 && !$ this ->canRefundShipping ($ order )) {
100100 $ messages [] = __ ('You can \'t create a creditmemo without products. ' );
101101 }
102102
Original file line number Diff line number Diff line change @@ -229,6 +229,15 @@ public function dataProviderForValidateQty()
229229 'total ' => 15 ,
230230 'expected ' => []
231231 ],
232+ [
233+ 'orderId ' => 1 ,
234+ 'orderItemId ' => 1 ,
235+ 'qtyToRequest ' => 0 ,
236+ 'qtyToRefund ' => 0 ,
237+ 'sku ' ,
238+ 'total ' => 15 ,
239+ 'expected ' => []
240+ ],
232241 [
233242 'orderId ' => 1 ,
234243 'orderItemId ' => 1 ,
You can’t perform that action at this time.
0 commit comments