Skip to content

Commit

Permalink
Update ProductsToPick_4EyesReview_ProcessAll.java
Browse files Browse the repository at this point in the history
show the action when there are unprocessed rows and all of them are eligible

metasfresh/metasfresh#4967
  • Loading branch information
teosarca committed Mar 7, 2019
1 parent 9109fd7 commit d93e51b
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -68,7 +68,12 @@ protected ProcessPreconditionsResolution checkPreconditionsApplicable()
return ProcessPreconditionsResolution.rejectWithInternalReason("not all rows were approved");
}

if (!getRowsNotAlreadyProcessed().stream().allMatch(this::isEligibleForProcessing))
final List<ProductsToPickRow> rows = getRowsNotAlreadyProcessed();
if (rows.isEmpty())
{
return ProcessPreconditionsResolution.rejectWithInternalReason("no unprocessed rows");
}
if (!rows.stream().allMatch(this::isEligibleForProcessing))
{
return ProcessPreconditionsResolution.rejectWithInternalReason("not all rows eligible for processing");
}
Expand All @@ -86,6 +91,7 @@ protected String doIt()

final List<PickingCandidate> pickingCandidates = processAllPickingCandidates();
deliverAndInvoice(pickingCandidates);

return MSG_OK;
}

Expand Down

0 comments on commit d93e51b

Please sign in to comment.