Update SettlementCarryServiceImpl.java

This commit is contained in:
jinbooks_dev
2025-06-10 16:16:05 +08:00
parent ad249a0c84
commit b5cc499762

View File

@ -223,8 +223,8 @@ public class SettlementCarryServiceImpl extends ServiceImpl<SettlementMapper, Se
private boolean addVoucherItems(String bookId,String subjectCode,List<VoucherItemChangeDto> items,VoucherTemplateItem templateItem) {
List<BookSubject> subjectList = bookSubjectService.selectSubjectAndChild(bookId, subjectCode);
for(BookSubject s : subjectList ) {
if(isLeafSubject(s,subjectList) && s.getBalance().compareTo(BigDecimal.ZERO) > 0) {
items.add(createVoucherItemDtoBySubject(bookId,s,templateItem,s.getBalance()));
if(isLeafSubject(s,subjectList) && s.getBalance().compareTo(BigDecimal.ZERO) != 0) {
items.add(createVoucherItemDtoBySubject(bookId,s,templateItem,s.getBalance().abs()));
}
}
return true;