This commit is contained in:
wujinliang
2026-08-25 22:08:44 +08:00
parent 0def6114ee
commit 897ddd476f
5 changed files with 128 additions and 15 deletions
@@ -68,7 +68,9 @@ public class ReconciliationStatementService {
CustomerProfile customer = customer(request.customerId());
long subjectId = activeSubject();
List<Source> sources = eligibleSources(request);
if (sources.isEmpty()) throw error("FIN_409", "没有符合结算条件的CNY应收费用来源");
if (sources.isEmpty()) {
throw error("FIN_409", "当前客户在所选账期内没有可生成的CNY应收费用,请调整账期或选择其他客户后重试");
}
BigDecimal total = sources.stream().map(Source::amount).reduce(BigDecimal.ZERO, BigDecimal::add);
LocalDate dueDate = request.periodEnd().plusDays(customer.creditDays());
String statementNo = documentNumbers.next("REC");