adamsaghy commented on code in PR #3366:
URL: https://github.com/apache/fineract/pull/3366#discussion_r1301312262
##########
fineract-core/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java:
##########
@@ -192,29 +159,24 @@ public String getValue() {
public enum LoanProductAccountingDataParams {
- FUND_SOURCE("fundSourceAccount"), //
- LOAN_PORTFOLIO("loanPortfolioAccount"), //
- INTEREST_ON_LOANS("interestOnLoanAccount"), //
- INCOME_FROM_FEES("incomeFromFeeAccount"), //
- INCOME_FROM_PENALTIES("incomeFromPenaltyAccount"), //
- LOSSES_WRITTEN_OFF("writeOffAccount"), //
- GOODWILL_CREDIT("goodwillCreditAccount"), //
- OVERPAYMENT("overpaymentLiabilityAccount"), //
- INTEREST_RECEIVABLE("receivableInterestAccount"), //
- FEES_RECEIVABLE("receivableFeeAccount"), //
- PENALTIES_RECEIVABLE("receivablePenaltyAccount"), //
- TRANSFERS_SUSPENSE("transfersInSuspenseAccount"), //
- INCOME_ACCOUNT_ID("incomeAccount"), //
- INCOME_FROM_RECOVERY("incomeFromRecoveryAccount"), //
- LIABILITY_TRANSFER_SUSPENSE("liabilityTransferInSuspenseAccount"), //
- INCOME_FROM_CHARGE_OFF_INTEREST("incomeFromChargeOffInterestAccount"),
//
- INCOME_FROM_CHARGE_OFF_FEES("incomeFromChargeOffFeesAccount"), //
- CHARGE_OFF_EXPENSE("chargeOffExpenseAccount"), //
- CHARGE_OFF_FRAUD_EXPENSE("chargeOffFraudExpenseAccount"), //
- INCOME_FROM_CHARGE_OFF_PENALTY("incomeFromChargeOffPenaltyAccount"), //
-
INCOME_FROM_GOODWILL_CREDIT_INTEREST("incomeFromGoodwillCreditInterestAccount"),
//
-
INCOME_FROM_GOODWILL_CREDIT_FEES("incomeFromGoodwillCreditFeesAccount"), //
-
INCOME_FROM_GOODWILL_CREDIT_PENALTY("incomeFromGoodwillCreditPenaltyAccount");
//
+ FUND_SOURCE("fundSourceAccount"),
LOAN_PORTFOLIO("loanPortfolioAccount"), INTEREST_ON_LOANS(
Review Comment:
Please undo this. The ordering was intentional.
##########
fineract-core/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java:
##########
@@ -237,16 +199,8 @@ public String getValue() {
***/
public enum CashAccountsForSavings {
- SAVINGS_REFERENCE(1), //
- SAVINGS_CONTROL(2), //
- INTEREST_ON_SAVINGS(3), //
- INCOME_FROM_FEES(4), //
- INCOME_FROM_PENALTIES(5), //
- TRANSFERS_SUSPENSE(10), //
- OVERDRAFT_PORTFOLIO_CONTROL(11), //
- INCOME_FROM_INTEREST(12), //
- LOSSES_WRITTEN_OFF(13), //
- ESCHEAT_LIABILITY(14); //
+ SAVINGS_REFERENCE(1), SAVINGS_CONTROL(2), INTEREST_ON_SAVINGS(3),
INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), TRANSFERS_SUSPENSE(
Review Comment:
Please undo this. The ordering was intentional.
##########
fineract-core/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java:
##########
@@ -277,28 +231,63 @@ public static CashAccountsForSavings fromInt(final int i)
{
}
}
+ /***
+ * Accounting placeholders for periodic accrual based accounting for
savings products
+ ***/
+ public enum AccrualAccountsForSavings {
+
+ SAVINGS_REFERENCE(1), SAVINGS_CONTROL(2), INTEREST_ON_SAVINGS(3),
INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), TRANSFERS_SUSPENSE(
+ 10), OVERDRAFT_PORTFOLIO_CONTROL(11),
INCOME_FROM_INTEREST(12), LOSSES_WRITTEN_OFF(
+ 13), ESCHEAT_LIABILITY(14), FEES_RECEIVABLE(15),
PENALTIES_RECEIVABLE(16), INTEREST_PAYABLE(17);
+
+ private final Integer value;
+
+ AccrualAccountsForSavings(final Integer value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return name().toString().replaceAll("_", " ");
+ }
+
+ public Integer getValue() {
+ return this.value;
+ }
+
+ private static final Map<Integer, AccrualAccountsForSavings>
intToEnumMap = new HashMap<>();
+
+ static {
+ for (final AccrualAccountsForSavings type :
AccrualAccountsForSavings.values()) {
+ intToEnumMap.put(type.value, type);
+ }
+ }
+
+ public static AccrualAccountsForSavings fromInt(final int i) {
+ final AccrualAccountsForSavings type =
intToEnumMap.get(Integer.valueOf(i));
+ return type;
+ }
+ }
+
/***
* Enum of all accounting related input parameter names used while
creating/updating a savings product
***/
public enum SavingProductAccountingParams {
- SAVINGS_REFERENCE("savingsReferenceAccountId"), //
- SAVINGS_CONTROL("savingsControlAccountId"), //
- INCOME_FROM_FEES("incomeFromFeeAccountId"), //
- INCOME_FROM_PENALTIES("incomeFromPenaltyAccountId"), //
- INTEREST_ON_SAVINGS("interestOnSavingsAccountId"), //
-
PAYMENT_CHANNEL_FUND_SOURCE_MAPPING("paymentChannelToFundSourceMappings"), //
- PAYMENT_TYPE("paymentTypeId"), //
- FUND_SOURCE("fundSourceAccountId"), //
- TRANSFERS_SUSPENSE("transfersInSuspenseAccountId"), //
- FEE_INCOME_ACCOUNT_MAPPING("feeToIncomeAccountMappings"), //
- PENALTY_INCOME_ACCOUNT_MAPPING("penaltyToIncomeAccountMappings"), //
- CHARGE_ID("chargeId"), //
- INCOME_ACCOUNT_ID("incomeAccountId"), //
- OVERDRAFT_PORTFOLIO_CONTROL("overdraftPortfolioControlId"), //
- INCOME_FROM_INTEREST("incomeFromInterestId"), //
- LOSSES_WRITTEN_OFF("writeOffAccountId"), //
- ESCHEAT_LIABILITY("escheatLiabilityId"); //
+ SAVINGS_REFERENCE("savingsReferenceAccountId"),
SAVINGS_CONTROL("savingsControlAccountId"), INCOME_FROM_FEES(
Review Comment:
Please undo this. The ordering was intentional.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]