employee loan balance amount having calculation mismatch (0001489)

This commit is contained in:
VE10-Sanjeev 2025-03-24 04:17:37 +00:00
parent 11e777baec
commit b2b0f86e60

View File

@ -48,6 +48,7 @@ $Remaining_Due = '';
$Paid_Due = '';
$Paid_Amount = 0;
$loanid = '';
$pending_due_amount = 0;
if (!empty($emppay)) {
@ -115,6 +116,7 @@ if (!empty($emppay)) {
$loanid = $ep->Loan_ID;
$request_letter = $ep->request_letter;
$payment_statement = $ep->payment_statement;
$pending_due_amount = $Remaining_Due * $Monthly_due;
}
}
@ -236,6 +238,12 @@ if (!empty($emppay)) {
<input type="text" class="form-control requried num" id="remaining_due" name="remaining_due" value="<?php echo $Remaining_Due; ?>" readonly>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="">Balance Amount</label>
<input type="text" class="form-control requried num" id="balance_due_amount" value="<?php echo $pending_due_amount; ?>" readonly>
</div>
</div>
</div>
@ -434,12 +442,14 @@ if (!empty($emppay)) {
Paid_Amount = document.getElementById('Paid_Amount').value;
loan = loan - Paid_Amount
totalDueAmt = loan / no_of_due;
balanceDueAmount = no_of_due * totalDueAmt;
document.getElementById('monthly_due').value = Math.ceil(totalDueAmt);
document.getElementById('remaining_due').value = Math.ceil(no_of_due);
document.getElementById('balance_due_amount').value = Math.ceil(balanceDueAmount);
}