FINERACT-321 - Manual Journal entries should not allowed to reverse after accounting closure is done for that branch
This commit is contained in:
+13
@@ -325,6 +325,19 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
|
||||
final boolean useDefaultComment = StringUtils.isBlank(reversalComment);
|
||||
|
||||
validateCommentForReversal(reversalComment);
|
||||
|
||||
//Before reversal validate accounting closure is done for that branch or not.
|
||||
final Date journalEntriesTransactionDate = journalEntries.get(0).getTransactionDate();
|
||||
final GLClosure latestGLClosureByBranch = this.glClosureRepository.getLatestGLClosureByBranch(officeId);
|
||||
if (latestGLClosureByBranch != null) {
|
||||
if (latestGLClosureByBranch.getClosingDate().after(journalEntriesTransactionDate)
|
||||
|| latestGLClosureByBranch.getClosingDate().equals(journalEntriesTransactionDate)) {
|
||||
final String accountName = null;
|
||||
final String accountGLCode = null;
|
||||
throw new JournalEntryInvalidException(GL_JOURNAL_ENTRY_INVALID_REASON.ACCOUNTING_CLOSED,
|
||||
latestGLClosureByBranch.getClosingDate(), accountName, accountGLCode);
|
||||
}
|
||||
}
|
||||
|
||||
for (final JournalEntry journalEntry : journalEntries) {
|
||||
JournalEntry reversalJournalEntry;
|
||||
|
||||
Reference in New Issue
Block a user