FINERACT-2181:improve code quality
This commit is contained in:
committed by
Adam Saghy
parent
62afd41182
commit
6d49d76e73
+3
-4
@@ -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);
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user