From 9cc60c9b7e37649eb5740faa9d18bf12a99793ef Mon Sep 17 00:00:00 2001 From: Satish Date: Mon, 19 Dec 2016 11:56:10 +0530 Subject: [PATCH] Fixed issue with Create Center --- ...pesWritePlatformServiceJpaRepositoryImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java index f485af843..a3837c064 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImpl.java @@ -209,14 +209,16 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group this.groupRepository.saveAndFlush(newGroup); newGroup.captureStaffHistoryDuringCenterCreation(staff, activationDate); - if(command.parameterExists(GroupingTypesApiConstants.datatables)){ - this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getCode().longValue(), - EntityTables.GROUP.getName(), newGroup.getId(), null, - command.arrayOfParameterNamed(GroupingTypesApiConstants.datatables)); - } + if (newGroup.isGroup()) { + if (command.parameterExists(GroupingTypesApiConstants.datatables)) { + this.entityDatatableChecksWritePlatformService.saveDatatables(StatusEnum.CREATE.getCode().longValue(), + EntityTables.GROUP.getName(), newGroup.getId(), null, + command.arrayOfParameterNamed(GroupingTypesApiConstants.datatables)); + } - this.entityDatatableChecksWritePlatformService.runTheCheck(newGroup.getId(), EntityTables.GROUP.getName(), - StatusEnum.CREATE.getCode().longValue(), EntityTables.GROUP.getForeignKeyColumnNameOnDatatable()); + this.entityDatatableChecksWritePlatformService.runTheCheck(newGroup.getId(), EntityTables.GROUP.getName(), + StatusEnum.CREATE.getCode().longValue(), EntityTables.GROUP.getForeignKeyColumnNameOnDatatable()); + } return new CommandProcessingResultBuilder() // .withCommandId(command.commandId()) //