wkigenyi commented on code in PR #3795:
URL: https://github.com/apache/fineract/pull/3795#discussion_r1545549114


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java:
##########
@@ -32,15 +32,15 @@
 public class DefaultPaymentPeriodsInOneYearCalculator implements 
PaymentPeriodsInOneYearCalculator {
 
     @Override
-    public Integer calculate(final PeriodFrequencyType repaymentFrequencyType) 
{
+    public Integer calculate(final PeriodFrequencyType 
repaymentFrequencyType,final PeriodFrequencyType interestRateFrequencyMethod) {
 
         Integer paymentPeriodsInOneYear = 0;
         switch (repaymentFrequencyType) {
             case DAYS:
-                paymentPeriodsInOneYear = 365;
+                paymentPeriodsInOneYear = 
interestRateFrequencyMethod.isMonthly() ? Integer.valueOf(360) : 
Integer.valueOf(365);
             break;
             case WEEKS:
-                paymentPeriodsInOneYear = 52;
+                paymentPeriodsInOneYear = 
interestRateFrequencyMethod.isMonthly() ? Integer.valueOf(48) : 
Integer.valueOf(52);

Review Comment:
   If the interest frequency is monthly, it looks more reasonable to assume 
there are four weeks in a month, so with 4 weeks in a month and 12 months in a 
year we shall have 4 x 12 = 48 weeks in a year.  



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