You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2021/09/02 06:25:26 UTC
[GitHub] [fineract] luckyman20 commented on a change in pull request #1770: Feat: Collateral module
luckyman20 commented on a change in pull request #1770:
URL: https://github.com/apache/fineract/pull/1770#discussion_r700780679
##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java
##########
@@ -313,12 +322,28 @@ public ClientData retrieveOne(final Long clientId) {
final ClientData clientData = this.jdbcTemplate.queryForObject(sql, this.clientMapper,
new Object[] { hierarchySearchString, hierarchySearchString, clientId });
+ // Get client collaterals
+ final Collection<ClientCollateralManagement> clientCollateralManagements = this.clientCollateralManagementRepositoryWrapper
+ .getCollateralsPerClient(clientId);
+ final Set<ClientCollateralManagementData> clientCollateralManagementDataSet = new HashSet<>();
+
+ // Map to client collateral data class
+ for (ClientCollateralManagement clientCollateralManagement : clientCollateralManagements) {
+ BigDecimal pctToBase = clientCollateralManagement.getCollaterals().getPctToBase().divide(BigDecimal.valueOf(100));
+ BigDecimal basePrice = clientCollateralManagement.getCollaterals().getBasePrice();
+ BigDecimal quantity = clientCollateralManagement.getQuantity();
+ BigDecimal total = basePrice.multiply(quantity);
+ BigDecimal totalCollateral = total.multiply(pctToBase);
+ clientCollateralManagementDataSet
Review comment:
Is this resolved?
--
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: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org