ItEr60S04ValidacionEProbasFuncionaisItEr59S04: [Bug #540] Fixing bugs.
Now the import work reports shows a friendly message when there is not any type of work reports with specified code.
This commit is contained in:
parent
d5c7bf25ec
commit
abafe1f74d
1 changed files with 8 additions and 3 deletions
|
|
@ -62,9 +62,14 @@ public final class WorkReportConverter {
|
|||
// Mandatory fields
|
||||
workReport.setCode(workReportDTO.code);
|
||||
|
||||
WorkReportType workReportType = Registry.getWorkReportTypeDAO()
|
||||
.findUniqueByCode(workReportDTO.workReportType);
|
||||
workReport.setWorkReportType(workReportType);
|
||||
try {
|
||||
WorkReportType workReportType = Registry.getWorkReportTypeDAO()
|
||||
.findUniqueByCode(workReportDTO.workReportType);
|
||||
workReport.setWorkReportType(workReportType);
|
||||
} catch (InstanceNotFoundException e) {
|
||||
throw new ValidationException(
|
||||
_("There is no type of work report with this code"));
|
||||
}
|
||||
|
||||
for (WorkReportLineDTO workReportLineDTO : workReportDTO.workReportLines) {
|
||||
workReport
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue