FINERACT-2181:improve code quality

This commit is contained in:
a7med3del1973
2025-05-16 15:45:37 +02:00
committed by Adam Saghy
parent 62afd41182
commit 6d49d76e73
3 changed files with 8 additions and 9 deletions
@@ -72,10 +72,9 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure
} }
// shouldn't be before an existing accounting closure // shouldn't be before an existing accounting closure
final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(officeId); final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(officeId);
if (latestGLClosure != null) { if (latestGLClosure != null && DateUtils.isAfter(latestGLClosure.getClosingDate(), closureDate)) {
if (DateUtils.isAfter(latestGLClosure.getClosingDate(), closureDate)) { throw new GLClosureInvalidException(GlClosureInvalidReason.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate());
throw new GLClosureInvalidException(GlClosureInvalidReason.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate());
}
} }
final GLClosure glClosure = GLClosure.fromJson(office, command); final GLClosure glClosure = GLClosure.fromJson(office, command);
@@ -31,17 +31,17 @@ public class GLAccountInvalidUpdateException extends AbstractPlatformDomainRuleE
TRANSANCTIONS_LOGGED; TRANSANCTIONS_LOGGED;
public String errorMessage() { public String errorMessage() {
if (name().toString().equalsIgnoreCase("TRANSANCTIONS_LOGGED")) { if (name().equalsIgnoreCase("TRANSANCTIONS_LOGGED")) {
return "This Usage of this (detail) GL Account as it already has transactions logged against it"; return "This Usage of this (detail) GL Account as it already has transactions logged against it";
} }
return name().toString(); return name();
} }
public String errorCode() { public String errorCode() {
if (name().toString().equalsIgnoreCase("TRANSANCTIONS_LOGGED")) { if (name().equalsIgnoreCase("TRANSANCTIONS_LOGGED")) {
return "error.msg.glaccount.glcode.invalid.update.transactions.logged"; return "error.msg.glaccount.glcode.invalid.update.transactions.logged";
} }
return name().toString(); return name();
} }
} }
@@ -52,7 +52,7 @@ public enum JournalEntryJsonInputParams {
@Override @Override
public String toString() { public String toString() {
return name().replaceAll("_", " "); return name().replace("_", " ");
} }
public String getValue() { public String getValue() {