adamsaghy commented on code in PR #6285:
URL: https://github.com/apache/fineract/pull/6285#discussion_r3934041672


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -487,7 +488,19 @@ public CommandProcessingResult disburseLoan(final Long 
loanId, final JsonCommand
         for (final LoanCharge loanCharge : loanCharges) {
             if (loanCharge.isDueAtDisbursement() && 
loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()
                     && loanCharge.isChargePending()) {
-                disBuLoanCharges.put(loanCharge.getId(), 
loanCharge.amountOutstanding());
+                if (loanCharge.getCharge().getTaxGroup() != null && 
log.isInfoEnabled()) {
+                    log.info(
+                            "Disbursement charge tax evaluation: loanId={}, 
loanChargeId={}, txDate={}, baseAmount={}, applicableTaxComponents={}",
+                            loanId, loanCharge.getId(), 
actualDisbursementDate, loanCharge.amountOutstanding(),
+                            
TaxUtils.getApplicableTaxComponentSummaries(loanCharge.getCharge().getTaxGroup(),
 actualDisbursementDate));
+                }
+                final BigDecimal chargeAmountWithTax = 
TaxUtils.calculateChargeAmountWithTax(loanCharge.amountOutstanding(),
+                        loanCharge.getCharge().getTaxGroup(), 
actualDisbursementDate, loan.getCurrency().getDigitsAfterDecimal());
+                if (loanCharge.getCharge().getTaxGroup() != null && 
log.isInfoEnabled()) {
+                    log.info("Disbursement charge tax result: loanId={}, 
loanChargeId={}, txDate={}, amountAfterTax={}", loanId,
+                            loanCharge.getId(), actualDisbursementDate, 
chargeAmountWithTax);
+                }

Review Comment:
   Please remove this



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -836,7 +849,19 @@ public Map<String, Object> bulkLoanDisbursal(final 
JsonCommand command, final Co
             for (final LoanCharge loanCharge : loanCharges) {
                 if (loanCharge.isDueAtDisbursement() && 
loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()
                         && loanCharge.isChargePending()) {
-                    disBuLoanCharges.put(loanCharge.getId(), 
loanCharge.amountOutstanding());
+                    if (loanCharge.getCharge().getTaxGroup() != null && 
log.isInfoEnabled()) {
+                        log.info(
+                                "Disbursement charge tax evaluation: 
loanId={}, loanChargeId={}, txDate={}, baseAmount={}, 
applicableTaxComponents={}",
+                                loan.getId(), loanCharge.getId(), 
actualDisbursementDate, loanCharge.amountOutstanding(),
+                                
TaxUtils.getApplicableTaxComponentSummaries(loanCharge.getCharge().getTaxGroup(),
 actualDisbursementDate));
+                    }

Review Comment:
   Please remove this



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -836,7 +849,19 @@ public Map<String, Object> bulkLoanDisbursal(final 
JsonCommand command, final Co
             for (final LoanCharge loanCharge : loanCharges) {
                 if (loanCharge.isDueAtDisbursement() && 
loanCharge.getChargePaymentMode().isPaymentModeAccountTransfer()
                         && loanCharge.isChargePending()) {
-                    disBuLoanCharges.put(loanCharge.getId(), 
loanCharge.amountOutstanding());
+                    if (loanCharge.getCharge().getTaxGroup() != null && 
log.isInfoEnabled()) {
+                        log.info(
+                                "Disbursement charge tax evaluation: 
loanId={}, loanChargeId={}, txDate={}, baseAmount={}, 
applicableTaxComponents={}",
+                                loan.getId(), loanCharge.getId(), 
actualDisbursementDate, loanCharge.amountOutstanding(),
+                                
TaxUtils.getApplicableTaxComponentSummaries(loanCharge.getCharge().getTaxGroup(),
 actualDisbursementDate));
+                    }
+                    final BigDecimal chargeAmountWithTax = 
TaxUtils.calculateChargeAmountWithTax(loanCharge.amountOutstanding(),
+                            loanCharge.getCharge().getTaxGroup(), 
actualDisbursementDate, loan.getCurrency().getDigitsAfterDecimal());
+                    if (loanCharge.getCharge().getTaxGroup() != null && 
log.isInfoEnabled()) {
+                        log.info("Disbursement charge tax result: loanId={}, 
loanChargeId={}, txDate={}, amountAfterTax={}", loan.getId(),
+                                loanCharge.getId(), actualDisbursementDate, 
chargeAmountWithTax);
+                    }

Review Comment:
   Please remove this



-- 
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]

Reply via email to