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)
96
96
97
97
if ($ entity ->getGrandTotal () <= 0 ) {
98
98
$ messages [] = __ ('The credit memo \'s total must be positive. ' );
99
- } elseif ($ totalQuantity <= 0 && !$ this ->canRefundShipping ($ order )) {
99
+ } elseif ($ totalQuantity < 0 && !$ this ->canRefundShipping ($ order )) {
100
100
$ messages [] = __ ('You can \'t create a creditmemo without products. ' );
101
101
}
102
102
Original file line number Diff line number Diff line change @@ -229,6 +229,15 @@ public function dataProviderForValidateQty()
229
229
'total ' => 15 ,
230
230
'expected ' => []
231
231
],
232
+ [
233
+ 'orderId ' => 1 ,
234
+ 'orderItemId ' => 1 ,
235
+ 'qtyToRequest ' => 0 ,
236
+ 'qtyToRefund ' => 0 ,
237
+ 'sku ' ,
238
+ 'total ' => 15 ,
239
+ 'expected ' => []
240
+ ],
232
241
[
233
242
'orderId ' => 1 ,
234
243
'orderItemId ' => 1 ,
You can’t perform that action at this time.
0 commit comments