Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@

import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;
import lombok.Setter;

@Data
@Getter
@Setter
@NoArgsConstructor
@Builder
@AllArgsConstructor
@FieldNameConstants
public class CollectionSheetRequest implements Serializable {

@Serial
Expand All @@ -41,6 +42,7 @@ public class CollectionSheetRequest implements Serializable {
private String locale;
private String actualDisbursementDate;
private String transactionDate;
private DisbursementTransactionsRequest bulkDisbursementTransactions;

private List<DisbursementTransactionsRequest> bulkDisbursementTransactions;
Copy link
Contributor

@adamsaghy adamsaghy Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes appear to be breaking ones. Are you refactoring this class, or is this meant to fix a bug? (Did this ever actually work?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code works! The original code does not work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure i am following you. Is this PR a refactor? It says refactor and the FINERACT-2362 does not share any more information but a request that was created by you?

Have you tried the original solution works?
Why did you decide to change the request object?

private List<RepaymentTransactionRequest> bulkRepaymentTransactions;
private List<SavingDueTransactionRequest> bulkSavingsDueTransactions;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,31 @@

import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;
import lombok.Setter;

@Data
@Getter
@Setter
@NoArgsConstructor
@FieldNameConstants
@AllArgsConstructor
@Builder
public class DisbursementTransactionsRequest implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

private List<RepaymentTransactionRequest> bulkRepaymentTransactions;
private List<SavingDueTransactionRequest> bulkSavingsDueTransactions;
private Long loanId;
private BigDecimal transactionAmount;
private Long paymentTypeId;
private String externalId;
private String note;
private String accountNumber;
private String checkNumber;
private String routingCode;
private String receiptNumber;
private String bankNumber;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;
import lombok.Setter;

@Data
@Getter
@Setter
@NoArgsConstructor
@FieldNameConstants
@AllArgsConstructor
@Builder
public class RepaymentTransactionRequest implements Serializable {
Expand All @@ -40,6 +40,7 @@ public class RepaymentTransactionRequest implements Serializable {
private Long loanId;
private BigDecimal transactionAmount;
private Long paymentTypeId;
private String note;
private String accountNumber;
private String checkNumber;
private String routingCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;
import lombok.Setter;

@Data
@Getter
@Setter
@NoArgsConstructor
@FieldNameConstants
@AllArgsConstructor
@Builder
public class SavingDueTransactionRequest implements Serializable {
Expand All @@ -41,6 +41,7 @@ public class SavingDueTransactionRequest implements Serializable {
private BigDecimal transactionAmount;
private Long depositAccountType;
private Long paymentTypeId;
private String note;
private String accountNumber;
private String checkNumber;
private String routingCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,13 @@ private static final class IndividualCollectionSheetFaltDataMapper implements Ro
sb.append("ln.fee_charges_repaid_derived As feePaid ");
sb.append("FROM m_loan ln ");
sb.append("JOIN m_client cl ON cl.id = ln.client_id ");
sb.append("LEFT JOIN m_office of ON of.id = cl.office_id AND of.hierarchy like :officeHierarchy ");
sb.append("LEFT JOIN m_office ofc ON ofc.id = cl.office_id AND ofc.hierarchy like " + ":officeHierarchy ");
sb.append("LEFT JOIN m_product_loan pl ON pl.id = ln.product_id ");
sb.append("LEFT JOIN m_currency rc on rc." + sqlGenerator.escape("code") + " = ln.currency_code ");
sb.append("JOIN m_loan_repayment_schedule ls ON ls.loan_id = ln.id AND ls.completed_derived = 0 AND ls.duedate <= :dueDate ");
sb.append("where ");
if (checkForOfficeId) {
sb.append("of.id = :officeId and ");
sb.append("ofc.id = :officeId and ");
}
if (checkforStaffId) {
sb.append("ln.loan_officer_id = :staffId and ");
Expand Down Expand Up @@ -829,12 +829,12 @@ private static final class IndividualMandatorySavingsCollectionsheetExtractor
"LEFT JOIN m_deposit_account_recurring_detail dard ON sa.id = dard.savings_account_id AND dard.is_mandatory = true AND dard.is_calendar_inherited = false ");
sb.append(
"LEFT JOIN m_mandatory_savings_schedule mss ON mss.savings_account_id=sa.id AND mss.completed_derived = 0 AND mss.duedate <= :dueDate ");
sb.append("LEFT JOIN m_office of ON of.id = cl.office_id AND of.hierarchy like :officeHierarchy ");
sb.append("LEFT JOIN m_office ofc ON ofc.id = cl.office_id AND ofc.hierarchy like " + ":officeHierarchy ");
sb.append("LEFT JOIN m_currency rc on rc." + sqlGenerator.escape("code") + " = sa.currency_code ");
sb.append("WHERE sa.status_enum=300 and sa.group_id is null and sa.deposit_type_enum in (100,300,400) ");
sb.append("and (cl.status_enum = 300 or (cl.status_enum = 600 and cl.closedon_date >= :dueDate)) ");
if (checkForOfficeId) {
sb.append("and of.id = :officeId ");
sb.append("and ofc.id = :officeId ");
}
if (checkforStaffId) {
sb.append("and sa.field_officer_id = :staffId ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
import org.apache.fineract.portfolio.collectionsheet.command.CollectionSheetBulkDisbursalCommand;
import org.apache.fineract.portfolio.collectionsheet.command.CollectionSheetBulkRepaymentCommand;
import org.apache.fineract.portfolio.collectionsheet.data.CollectionSheetTransactionDataValidator;
Expand Down Expand Up @@ -142,7 +143,8 @@ private Map<String, Object> updateBulkMandatorySavingsDuePayments(final JsonComm
.mandatorySavingsAccountDeposit(savingsAccountTransactionDTO);
depositTransactionIds.add(savingsAccountTransaction.getId());
} catch (Exception e) {
// TODO: handle exception
throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist", "Validation errors exist.",
e.getMessage(), e);
}
}
changes.put("SavingsTransactions", depositTransactionIds);
Expand Down
Loading