FINERACT-1943 Fix submitted on date references
This commit is contained in:
+35
-29
@@ -115,24 +115,26 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
final Money amount, final boolean isManualTransaction) {
|
||||
final boolean isReversed = false;
|
||||
final Boolean lienTransaction = false;
|
||||
final LocalDate submittedOnDate = DateUtils.getBusinessLocalDate();
|
||||
final SavingsAccountTransactionType savingsAccountTransactionType = SavingsAccountTransactionType.INTEREST_POSTING;
|
||||
SavingsAccountTransactionEnumData savingsAccountTransactionEnumData = new SavingsAccountTransactionEnumData(
|
||||
savingsAccountTransactionType.getValue().longValue(), savingsAccountTransactionType.getCode(),
|
||||
savingsAccountTransactionType.getValue().toString());
|
||||
return new SavingsAccountTransactionData(amount.getAmount(), date, savingsAccount.getId(), savingsAccountTransactionEnumData,
|
||||
isReversed, null, isManualTransaction, lienTransaction);
|
||||
isReversed, null, isManualTransaction, lienTransaction, submittedOnDate);
|
||||
}
|
||||
|
||||
public static SavingsAccountTransactionData overdraftInterest(final SavingsAccountData savingsAccount, final LocalDate date,
|
||||
final Money amount, final boolean isManualTransaction) {
|
||||
final boolean isReversed = false;
|
||||
final Boolean lienTransaction = false;
|
||||
final LocalDate submittedOnDate = DateUtils.getBusinessLocalDate();
|
||||
final SavingsAccountTransactionType savingsAccountTransactionType = SavingsAccountTransactionType.OVERDRAFT_INTEREST;
|
||||
SavingsAccountTransactionEnumData savingsAccountTransactionEnumData = new SavingsAccountTransactionEnumData(
|
||||
savingsAccountTransactionType.getValue().longValue(), savingsAccountTransactionType.getCode(),
|
||||
savingsAccountTransactionType.getValue().toString());
|
||||
return new SavingsAccountTransactionData(amount.getAmount(), date, savingsAccount.getId(), savingsAccountTransactionEnumData,
|
||||
isReversed, null, isManualTransaction, lienTransaction);
|
||||
isReversed, null, isManualTransaction, lienTransaction, submittedOnDate);
|
||||
}
|
||||
|
||||
public boolean isInterestPostingAndNotReversed() {
|
||||
@@ -305,14 +307,14 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
|
||||
private SavingsAccountTransactionData(final Long savingsId, final Long officeId, final PaymentDetailData paymentDetailData,
|
||||
final SavingsAccountTransactionEnumData savingsAccountTransactionType, final LocalDate transactionDate,
|
||||
final LocalDate createdDate, final BigDecimal amount, final boolean isReversed, final Long userId,
|
||||
final LocalDate submittedOnDate, final BigDecimal amount, final boolean isReversed, final Long userId,
|
||||
final boolean isManualTransaction, final Boolean lienTransaction) {
|
||||
this.savingsAccountId = savingsId;
|
||||
this.paymentDetailData = paymentDetailData;
|
||||
this.transactionType = savingsAccountTransactionType;
|
||||
this.entryType = transactionType == null ? null : transactionType.getTransactionTypeEnum().getEntryType();
|
||||
this.transactionDate = transactionDate;
|
||||
this.submittedOnDate = createdDate;
|
||||
this.submittedOnDate = submittedOnDate;
|
||||
this.amount = amount;
|
||||
this.isManualTransaction = isManualTransaction;
|
||||
this.lienTransaction = lienTransaction;
|
||||
@@ -435,12 +437,13 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
final boolean isReversed = false;
|
||||
final boolean isManualTransaction = false;
|
||||
final Boolean lienTransaction = false;
|
||||
final LocalDate submittedOnDate = DateUtils.getBusinessLocalDate();
|
||||
SavingsAccountTransactionType savingsAccountTransactionType = SavingsAccountTransactionType.WITHHOLD_TAX;
|
||||
SavingsAccountTransactionEnumData transactionType = new SavingsAccountTransactionEnumData(
|
||||
savingsAccountTransactionType.getValue().longValue(), savingsAccountTransactionType.getCode(),
|
||||
savingsAccountTransactionType.getValue().toString());
|
||||
SavingsAccountTransactionData accountTransaction = new SavingsAccountTransactionData(amount.getAmount(), date,
|
||||
savingsAccount.getId(), transactionType, isReversed, null, isManualTransaction, lienTransaction);
|
||||
savingsAccount.getId(), transactionType, isReversed, null, isManualTransaction, lienTransaction, submittedOnDate);
|
||||
updateTaxDetails(taxDetails, accountTransaction);
|
||||
return accountTransaction;
|
||||
}
|
||||
@@ -509,7 +512,7 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
|
||||
private SavingsAccountTransactionData(BigDecimal transactionAmount, LocalDate transactionDate, Long savingsAccountId,
|
||||
SavingsAccountTransactionEnumData transactionType, boolean isReversed, String locale, boolean isManualTransaction,
|
||||
final Boolean lienTransaction) {
|
||||
final Boolean lienTransaction, final LocalDate submittedOnDate) {
|
||||
this.id = null;
|
||||
this.transactionType = transactionType;
|
||||
this.entryType = transactionType == null ? null : transactionType.getTransactionTypeEnum().getEntryType();
|
||||
@@ -523,7 +526,7 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
this.runningBalance = null;
|
||||
this.reversed = isReversed;
|
||||
this.transfer = null;
|
||||
this.submittedOnDate = transactionDate;
|
||||
this.submittedOnDate = submittedOnDate;
|
||||
this.interestedPostedAsOn = false;
|
||||
this.rowIndex = null;
|
||||
this.savingsAccountId = savingsAccountId;
|
||||
@@ -673,11 +676,11 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
||||
final CurrencyData currency, final BigDecimal amount, final BigDecimal outstandingChargeAmount, final BigDecimal runningBalance,
|
||||
final boolean reversed, final AccountTransferData transfer, final boolean interestedPostedAsOn,
|
||||
final String submittedByUsername, final String note) {
|
||||
final String submittedByUsername, final String note, final LocalDate submittedOnDate) {
|
||||
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||
return new SavingsAccountTransactionData(id, transactionType, paymentDetailData, savingsId, savingsAccountNo, date, currency,
|
||||
amount, outstandingChargeAmount, runningBalance, reversed, transfer, paymentTypeOptions, interestedPostedAsOn,
|
||||
submittedByUsername, note, false);
|
||||
submittedByUsername, note, false, submittedOnDate);
|
||||
}
|
||||
|
||||
public static SavingsAccountTransactionData create(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
||||
@@ -715,30 +718,32 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
final Boolean lienTransaction = false;
|
||||
return new SavingsAccountTransactionData(id, transactionType, paymentDetailData, savingsId, savingsAccountNo, defaultLocalDate,
|
||||
currency, amount, outstandingChargeAmount, runningBalance, reversed, null, null, interestedPostedAsOn, submittedByUsername,
|
||||
note, lienTransaction);
|
||||
note, lienTransaction, defaultLocalDate);
|
||||
}
|
||||
|
||||
public static SavingsAccountTransactionData templateOnTop(final SavingsAccountTransactionData savingsAccountTransactionData,
|
||||
final Collection<PaymentTypeData> paymentTypeOptions) {
|
||||
return new SavingsAccountTransactionData(savingsAccountTransactionData.id, savingsAccountTransactionData.transactionType,
|
||||
savingsAccountTransactionData.paymentDetailData, savingsAccountTransactionData.accountId,
|
||||
savingsAccountTransactionData.accountNo, savingsAccountTransactionData.date, savingsAccountTransactionData.currency,
|
||||
savingsAccountTransactionData.amount, savingsAccountTransactionData.outstandingChargeAmount,
|
||||
savingsAccountTransactionData.runningBalance, savingsAccountTransactionData.reversed,
|
||||
savingsAccountTransactionData.transfer, paymentTypeOptions, savingsAccountTransactionData.interestedPostedAsOn,
|
||||
savingsAccountTransactionData.submittedByUsername, savingsAccountTransactionData.note,
|
||||
savingsAccountTransactionData.lienTransaction);
|
||||
return new SavingsAccountTransactionData(savingsAccountTransactionData.getId(), savingsAccountTransactionData.getTransactionType(),
|
||||
savingsAccountTransactionData.getPaymentDetailData(), savingsAccountTransactionData.getAccountId(),
|
||||
savingsAccountTransactionData.getAccountNo(), savingsAccountTransactionData.getDate(),
|
||||
savingsAccountTransactionData.getCurrency(), savingsAccountTransactionData.getAmount(),
|
||||
savingsAccountTransactionData.getOutstandingChargeAmount(), savingsAccountTransactionData.getRunningBalance(),
|
||||
savingsAccountTransactionData.isReversed(), savingsAccountTransactionData.getTransfer(), paymentTypeOptions,
|
||||
savingsAccountTransactionData.isInterestedPostedAsOn(), savingsAccountTransactionData.getSubmittedByUsername(),
|
||||
savingsAccountTransactionData.getNote(), savingsAccountTransactionData.getLienTransaction(),
|
||||
savingsAccountTransactionData.getSubmittedOnDate());
|
||||
}
|
||||
|
||||
private SavingsAccountTransactionData(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
||||
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
||||
final CurrencyData currency, final BigDecimal amount, final BigDecimal outstandingChargeAmount, final BigDecimal runningBalance,
|
||||
final boolean reversed, final AccountTransferData transfer, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||
final boolean interestedPostedAsOn, final String submittedByUsername, final String note, final Boolean lienTransaction) {
|
||||
final boolean interestedPostedAsOn, final String submittedByUsername, final String note, final Boolean lienTransaction,
|
||||
final LocalDate submittedOnDate) {
|
||||
|
||||
this(id, transactionType, paymentDetailData, savingsId, savingsAccountNo, date, currency, amount, outstandingChargeAmount,
|
||||
runningBalance, reversed, transfer, paymentTypeOptions, date, interestedPostedAsOn, submittedByUsername, note, null, null,
|
||||
lienTransaction, null, null);
|
||||
runningBalance, reversed, transfer, paymentTypeOptions, submittedOnDate, interestedPostedAsOn, submittedByUsername, note,
|
||||
null, null, lienTransaction, null, null);
|
||||
}
|
||||
|
||||
private SavingsAccountTransactionData(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
||||
@@ -787,14 +792,15 @@ public final class SavingsAccountTransactionData implements Serializable {
|
||||
final SavingsAccountTransactionEnumData transactionType = SavingsEnumerations
|
||||
.transactionType(SavingsAccountTransactionType.WITHDRAWAL.getValue());
|
||||
|
||||
return new SavingsAccountTransactionData(savingsAccountTransactionData.id, transactionType,
|
||||
savingsAccountTransactionData.paymentDetailData, savingsAccountTransactionData.accountId,
|
||||
savingsAccountTransactionData.accountNo, currentDate, savingsAccountTransactionData.currency,
|
||||
savingsAccountTransactionData.amount, savingsAccountTransactionData.outstandingChargeAmount,
|
||||
savingsAccountTransactionData.runningBalance, savingsAccountTransactionData.reversed,
|
||||
savingsAccountTransactionData.transfer, savingsAccountTransactionData.paymentTypeOptions,
|
||||
savingsAccountTransactionData.interestedPostedAsOn, savingsAccountTransactionData.submittedByUsername,
|
||||
savingsAccountTransactionData.note, savingsAccountTransactionData.lienTransaction);
|
||||
return new SavingsAccountTransactionData(savingsAccountTransactionData.getId(), transactionType,
|
||||
savingsAccountTransactionData.getPaymentDetailData(), savingsAccountTransactionData.getAccountId(),
|
||||
savingsAccountTransactionData.getAccountNo(), currentDate, savingsAccountTransactionData.getCurrency(),
|
||||
savingsAccountTransactionData.getAmount(), savingsAccountTransactionData.getOutstandingChargeAmount(),
|
||||
savingsAccountTransactionData.getRunningBalance(), savingsAccountTransactionData.isReversed(),
|
||||
savingsAccountTransactionData.getTransfer(), savingsAccountTransactionData.getPaymentTypeOptions(),
|
||||
savingsAccountTransactionData.isInterestedPostedAsOn(), savingsAccountTransactionData.getSubmittedByUsername(),
|
||||
savingsAccountTransactionData.getNote(), savingsAccountTransactionData.getLienTransaction(),
|
||||
savingsAccountTransactionData.getSubmittedOnDate());
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
|
||||
Reference in New Issue
Block a user