Match fields to update as Paid : Loan , Payment Date , Total Payment.
Loan > Repayment Schedule Table
Loan > Repayment Schedule (Form View)
In Salary Slip > Salary Slip Loan (Table) add field Repayment Date from the Loan Repayment Schedule Table, this can be used as connecting key to match the installment
On submit of salary slip , match the Loan , Repayment Date, Total Payment field values to mark the loan installment as "paid" in the loan repayment schedule table.
Reload the Loan Doctype , to update the Total Amount (total_amount_paid) value = (Total Payment Column, paid = true)
Salary Slip (on submit) > Salary Slip Loan > Loan Repayment Schedule (paid = true)
Match fields to update as Paid : Loan , Payment Date , Total Payment.
Loan > Repayment Schedule Table
Loan > Repayment Schedule (Form View)
In Salary Slip > Salary Slip Loan (Table) add field Repayment Date from the Loan Repayment Schedule Table, this can be used as connecting key to match the installment
On submit of salary slip , match the Loan , Repayment Date, Total Payment field values to mark the loan installment as "paid" in the loan repayment schedule table.
Reload the Loan Doctype , to update the Total Amount (total_amount_paid) value = (Total Payment Column, paid = true)
Salary Slip (on cancel ) > Salary Slip Loan > Loan Repayment Schedule (paid = false)
Reload the Loan Doctype , to update the Total Amount (total_amount_paid) field value = (Total Payment Column, paid = true)