Deduct loan on bank entry

HI,
I created a loan via loan doctype
loan repayment is calculated in salary slip
but when I perform Make Bank Entry the full salary goes to bank without dedcuting loan amount

how to solve that?

frappe version-15
erpnext version-15
hrms version-15
lending version-15