Skip to content

Commit

Permalink
Fix Journal Entries for Savings Accrual Transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
IOhacker committed Oct 8, 2024
1 parent 45520ae commit fc7bcdc
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.time.LocalDate;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.fineract.accounting.closure.domain.GLClosure;
import org.apache.fineract.accounting.common.AccountingConstants.AccrualAccountsForSavings;
import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
Expand All @@ -33,6 +34,7 @@

@Component
@RequiredArgsConstructor
@Slf4j
public class AccrualBasedAccountingProcessorForSavings implements AccountingProcessorForSavings {

private final AccountingProcessorHelper helper;
Expand Down Expand Up @@ -180,9 +182,16 @@ else if (savingsTransactionDTO.getTransactionType().isInterestPosting()) {
}

else if (savingsTransactionDTO.getTransactionType().isAccrual()) {
// Post journal entry for Accrual Recognition
log.error("Post journal entry for Accrual Recognition");
if (savingsTransactionDTO.getAmount().compareTo(BigDecimal.ZERO) > 0) {
if (feePayments.size() > 0 || penaltyPayments.size() > 0) {
if (feePayments.size() > 0 || penaltyPayments.size() > 0) {
log.error("if (feePayments.size() > 0 || penaltyPayments.size() > 0)" );
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
AccrualAccountsForSavings.FEES_RECEIVABLE.getValue(), AccrualAccountsForSavings.INCOME_FROM_FEES.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
else {
log.error("else " );
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
AccrualAccountsForSavings.INTEREST_ON_SAVINGS.getValue(),
AccrualAccountsForSavings.INTEREST_PAYABLE.getValue(), savingsProductId, paymentTypeId, savingsId,
Expand All @@ -192,6 +201,7 @@ else if (savingsTransactionDTO.getTransactionType().isAccrual()) {
}

else if (savingsTransactionDTO.getTransactionType().isWithholdTax()) {
log.error("else if (savingsTransactionDTO.getTransactionType().isWithholdTax()) " );
this.helper.createAccrualBasedJournalEntriesAndReversalsForSavingsTax(office, currencyCode,
AccrualAccountsForSavings.SAVINGS_CONTROL, AccrualAccountsForSavings.SAVINGS_REFERENCE, savingsProductId,
paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal,
Expand Down

0 comments on commit fc7bcdc

Please sign in to comment.