SDF57 поиск счетов c_acc_deb/c_acc_cred -> acc_deb/acc_kr

This commit is contained in:
ialbert 2023-06-28 18:44:18 +03:00
parent fda13da0fd
commit b59cd10acc

View file

@ -46,18 +46,18 @@ public enum Sdf57ValidationRule implements IValidationRule<ImdgValidationContext
Optional<Account> accountDebFound = Optional.empty();
Optional<Account> accountCredFound = Optional.empty();
if (!TextUtil.isEmpty(sdf57.getC_acc_deb())) {
accountDebFound = Optional.ofNullable(accountImdg.getSingleObjectBySQL("account = '" + sdf57.getC_acc_deb() + "'"));
if (!TextUtil.isEmpty(sdf57.getAcc_deb())) {
accountDebFound = Optional.ofNullable(accountImdg.getSingleObjectBySQL("account = '" + sdf57.getAcc_deb() + "'"));
accountDebFound.ifPresent(accountDeb -> context.storeObject(ValidationStored.Sdf57AccountDeb, accountDeb));
}
if (!TextUtil.isEmpty(sdf57.getC_acc_cred())) {
accountCredFound = Optional.ofNullable(accountImdg.getSingleObjectBySQL("account = '" + sdf57.getC_acc_cred() + "'"));
if (!TextUtil.isEmpty(sdf57.getAcc_kr())) {
accountCredFound = Optional.ofNullable(accountImdg.getSingleObjectBySQL("account = '" + sdf57.getAcc_kr() + "'"));
accountCredFound.ifPresent(accountCred -> context.storeObject(ValidationStored.Sdf57AccountCred, accountCred));
}
if (accountDebFound.isEmpty() && accountCredFound.isEmpty()) {
return of(ClearingError.AccountNotPresent, String.format("accDeb = '%s'/ accCred = '%s'",
sdf57.getC_acc_deb(), sdf57.getC_acc_cred()));
sdf57.getAcc_deb(), sdf57.getAcc_kr()));
}
return empty();
}