-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FINERACT-1960: GL account mappings to use Savings product with Accrua… #3752
FINERACT-1960: GL account mappings to use Savings product with Accrua… #3752
Conversation
@adamsaghy could you please in reviewing this PR when ever you are available? |
150105f
to
79a4f01
Compare
@adamsaghy PR reviewed and updated, Thanks! |
final ProductToGLAccountMappingMapper rm = new ProductToGLAccountMappingMapper(); | ||
final String sql = "select " + rm.schema() + " and product_id = ? and payment_type is null and mapping.charge_id is null "; | ||
|
||
final List<Map<String, Object>> listOfProductToGLAccountMaps = this.jdbcTemplate.query(sql, rm, // NOSONAR | ||
new Object[] { PortfolioProductType.SAVING.getValue(), savingsProductId }); | ||
|
||
if (AccountingRuleType.CASH_BASED.getValue().equals(accountingType)) { | ||
Map<String, Object> accountMappingDetails = setBaseSavingsProductToGLAccountMaps(listOfProductToGLAccountMaps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not reuse cash based accounting settings.
Define the mapping for Cash based and for Accrual based separately. Even if there are common rules and accounts, still it is better to handle them and define them differently!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
for (TaxPaymentDTO taxPaymentDTO : taxDetails) { | ||
if (taxPaymentDTO.getAmount() != null) { | ||
if (taxPaymentDTO.getCreditAccountId() == null) { | ||
createCashBasedCreditJournalEntriesAndReversalsForSavings(office, currencyCode, accountTypeToBeCredited.getValue(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An accrual based journal entry should not call cashbased once... Please extract the logic into a common place if needed, but Cash based accounting and Accrual based accounting should not be mixed together!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
|
||
static final class GetFixedDepositProductsProductIdTransfersInSuspenseAccount { | ||
@Schema(example = "12") | ||
public Integer id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GL account id is long!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
|
||
static final class GetRecurringDepositProductsProductIdTransfersInSuspenseAccount { | ||
@Schema(example = "12") | ||
public Integer id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id is Long!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -115,7 +113,7 @@ public void validateForFixedDepositCreate(final String json) { | |||
|
|||
final JsonElement element = this.fromApiJsonHelper.parse(json); | |||
|
|||
validateDepositDetailForCreate(element, this.fromApiJsonHelper, baseDataValidator); | |||
validateDepositDetailForCreate(element, this.fromApiJsonHelper, baseDataValidator, DepositAccountType.RECURRING_DEPOSIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validation of Fixed deposit is the method name but here you are providing Recurring deposit. Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -479,6 +480,7 @@ public Collection<AccountTransferDTO> retrieveDataForInterestTransfer() { | |||
sqlBuilder.append( | |||
"and st.transaction_type_enum = ? and sa.status_enum = ? and st.is_reversed=false and st.transaction_date > coalesce(sa.lockedin_until_date_derived,sa.activatedon_date)"); | |||
|
|||
log.info("SQL {}", sqlBuilder.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to log at info level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comments!
Also there are a lot of changes, so my confidence in my review is not 100%!
It would be nice to see a summary of changes!
79a4f01
to
fe2d8a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Comments attended, Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fe2d8a6
to
3420436
Compare
3420436
to
67fa9f9
Compare
…l accounting
Description
Financial institutions will want to recognize expenses/incomes accrued on deposit product accounts too similar to the Loan products.
Today, In Fineract deposit products do not support accrual accounting. This spec is to enhance the accrual accounting in Fineract to support periodic accrual of expenses/incomes on deposit accounts too.
Deposit Products refers to the Savings products, Fixed Deposit Products, and Recurring Deposit Products of Fineract Application, and accrual accounting option should be available for all three types.
Deposit product expenses: Interest to be paid on deposit accounts
Deposit product incomes: fees, interest on overdrafts
FINERACT-1960
Checklist
[+] Include the three new parameters in the Deposit product creation and edition
[+] Add the support for Accrual accounting in the Deposit product and GL account mappings
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Write the commit message as per https://github.com/apache/fineract/#pull-requests
Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
Create/update unit or integration tests for verifying the changes made.
Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.