accounting for savings now picks us office from transaction
This commit is contained in:
+7
-1
@@ -12,6 +12,7 @@ import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionEnumDat
|
|||||||
|
|
||||||
public class SavingsTransactionDTO {
|
public class SavingsTransactionDTO {
|
||||||
|
|
||||||
|
private final Long officeId;
|
||||||
private final String transactionId;
|
private final String transactionId;
|
||||||
private final Date transactionDate;
|
private final Date transactionDate;
|
||||||
private final Long paymentTypeId;
|
private final Long paymentTypeId;
|
||||||
@@ -22,7 +23,7 @@ public class SavingsTransactionDTO {
|
|||||||
/*** Boolean values determines if the transaction is reversed ***/
|
/*** Boolean values determines if the transaction is reversed ***/
|
||||||
private final boolean reversed;
|
private final boolean reversed;
|
||||||
|
|
||||||
public SavingsTransactionDTO(final Long paymentTypeId, final String transactionId, final Date transactionDate,
|
public SavingsTransactionDTO(final Long officeId, final Long paymentTypeId, final String transactionId, final Date transactionDate,
|
||||||
final SavingsAccountTransactionEnumData transactionType, final BigDecimal amount, final boolean reversed) {
|
final SavingsAccountTransactionEnumData transactionType, final BigDecimal amount, final boolean reversed) {
|
||||||
this.paymentTypeId = paymentTypeId;
|
this.paymentTypeId = paymentTypeId;
|
||||||
this.transactionId = transactionId;
|
this.transactionId = transactionId;
|
||||||
@@ -30,6 +31,11 @@ public class SavingsTransactionDTO {
|
|||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.reversed = reversed;
|
this.reversed = reversed;
|
||||||
this.transactionType = transactionType;
|
this.transactionType = transactionType;
|
||||||
|
this.officeId = officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOfficeId() {
|
||||||
|
return this.officeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTransactionId() {
|
public String getTransactionId() {
|
||||||
|
|||||||
+3
-2
@@ -122,6 +122,7 @@ public class AccountingProcessorHelper {
|
|||||||
final List<Map<String, Object>> newTransactionsMap = (List<Map<String, Object>>) accountingBridgeData.get("newSavingsTransactions");
|
final List<Map<String, Object>> newTransactionsMap = (List<Map<String, Object>>) accountingBridgeData.get("newSavingsTransactions");
|
||||||
|
|
||||||
for (final Map<String, Object> map : newTransactionsMap) {
|
for (final Map<String, Object> map : newTransactionsMap) {
|
||||||
|
final Long transactionOfficeId = (Long) map.get("officeId");
|
||||||
final String transactionId = ((Long) map.get("id")).toString();
|
final String transactionId = ((Long) map.get("id")).toString();
|
||||||
final Date transactionDate = ((LocalDate) map.get("date")).toDate();
|
final Date transactionDate = ((LocalDate) map.get("date")).toDate();
|
||||||
final SavingsAccountTransactionEnumData transactionType = (SavingsAccountTransactionEnumData) map.get("type");
|
final SavingsAccountTransactionEnumData transactionType = (SavingsAccountTransactionEnumData) map.get("type");
|
||||||
@@ -129,8 +130,8 @@ public class AccountingProcessorHelper {
|
|||||||
final boolean reversed = (Boolean) map.get("reversed");
|
final boolean reversed = (Boolean) map.get("reversed");
|
||||||
final Long paymentTypeId = (Long) map.get("paymentTypeId");
|
final Long paymentTypeId = (Long) map.get("paymentTypeId");
|
||||||
|
|
||||||
final SavingsTransactionDTO transaction = new SavingsTransactionDTO(paymentTypeId, transactionId, transactionDate,
|
final SavingsTransactionDTO transaction = new SavingsTransactionDTO(transactionOfficeId, paymentTypeId, transactionId,
|
||||||
transactionType, amount, reversed);
|
transactionDate, transactionType, amount, reversed);
|
||||||
|
|
||||||
newSavingsTransactions.add(transaction);
|
newSavingsTransactions.add(transaction);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -29,12 +29,12 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
|
|||||||
@Override
|
@Override
|
||||||
public void createJournalEntriesForSavings(SavingsDTO savingsDTO) {
|
public void createJournalEntriesForSavings(SavingsDTO savingsDTO) {
|
||||||
final GLClosure latestGLClosure = this.helper.getLatestClosureByBranch(savingsDTO.getOfficeId());
|
final GLClosure latestGLClosure = this.helper.getLatestClosureByBranch(savingsDTO.getOfficeId());
|
||||||
final Office office = this.helper.getOfficeById(savingsDTO.getOfficeId());
|
|
||||||
final Long savingsProductId = savingsDTO.getSavingsProductId();
|
final Long savingsProductId = savingsDTO.getSavingsProductId();
|
||||||
final Long savingsId = savingsDTO.getSavingsId();
|
final Long savingsId = savingsDTO.getSavingsId();
|
||||||
for (final SavingsTransactionDTO savingsTransactionDTO : savingsDTO.getNewSavingsTransactions()) {
|
for (final SavingsTransactionDTO savingsTransactionDTO : savingsDTO.getNewSavingsTransactions()) {
|
||||||
final Date transactionDate = savingsTransactionDTO.getTransactionDate();
|
final Date transactionDate = savingsTransactionDTO.getTransactionDate();
|
||||||
final String transactionId = savingsTransactionDTO.getTransactionId();
|
final String transactionId = savingsTransactionDTO.getTransactionId();
|
||||||
|
final Office office = this.helper.getOfficeById(savingsTransactionDTO.getOfficeId());
|
||||||
final Long paymentTypeId = savingsTransactionDTO.getPaymentTypeId();
|
final Long paymentTypeId = savingsTransactionDTO.getPaymentTypeId();
|
||||||
final boolean isReversal = savingsTransactionDTO.isReversed();
|
final boolean isReversal = savingsTransactionDTO.isReversed();
|
||||||
final BigDecimal amount = savingsTransactionDTO.getAmount();
|
final BigDecimal amount = savingsTransactionDTO.getAmount();
|
||||||
|
|||||||
+1
@@ -230,6 +230,7 @@ public final class SavingsAccountTransaction extends AbstractPersistable<Long> {
|
|||||||
final SavingsAccountTransactionEnumData transactionType = SavingsEnumerations.transactionType(this.typeOf);
|
final SavingsAccountTransactionEnumData transactionType = SavingsEnumerations.transactionType(this.typeOf);
|
||||||
|
|
||||||
thisTransactionData.put("id", getId());
|
thisTransactionData.put("id", getId());
|
||||||
|
thisTransactionData.put("officeId", this.office.getId());
|
||||||
thisTransactionData.put("type", transactionType);
|
thisTransactionData.put("type", transactionType);
|
||||||
thisTransactionData.put("reversed", Boolean.valueOf(isReversed()));
|
thisTransactionData.put("reversed", Boolean.valueOf(isReversed()));
|
||||||
thisTransactionData.put("date", getTransactionLocalDate());
|
thisTransactionData.put("date", getTransactionLocalDate());
|
||||||
|
|||||||
Reference in New Issue
Block a user