fix minor issues in Mifosx-437
This commit is contained in:
@@ -11072,6 +11072,26 @@ Request Body:
|
||||
This field is mandatory if <i>chargeTimeType</i> is of type <b>Monthly Fee</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=alt>
|
||||
<td>minCap</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class=fielddesc>minimum cap: a 2% fee with a minimum cap of 500<br/>
|
||||
In case of a 5000 loan, the 2% is 100, and therefore automatically 500 is used as the value of the charge.<br/>
|
||||
This field is optional and can be used along when ChargeCalculationType equals (2) PERCENT_OF_AMOUNT
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr class=alt>
|
||||
<td>maxCap</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class=fielddesc>maximum cap: A 2% fee, with a maximum of 2000. <br/>
|
||||
In case of a 150000 loan, the 2% adds up to 3000 charge, and therefore the maximum cap of 2000 will be used. <br />
|
||||
This field is optional and can be used along when ChargeCalculationType equals (2) PERCENT_OF_AMOUNT
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+5
-2
@@ -123,8 +123,7 @@ public class Charge extends AbstractPersistable<Long> {
|
||||
this.penalty = penalty;
|
||||
this.active = active;
|
||||
this.chargePaymentMode = paymentMode == null ? null : paymentMode.getValue();
|
||||
this.minCap = minCap;
|
||||
this.maxCap = maxCap;
|
||||
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<ApiParameterError>();
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("charges");
|
||||
@@ -162,6 +161,10 @@ public class Charge extends AbstractPersistable<Long> {
|
||||
.failWithCodeNoParameterAddedToErrorCode("not.allowed.charge.time.for.loan");
|
||||
}
|
||||
}
|
||||
if(isPercentageOfAmount()){
|
||||
this.minCap = minCap;
|
||||
this.maxCap = maxCap;
|
||||
}
|
||||
|
||||
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user