fix: Make repayment entry only if amount exists

This commit is contained in:
Deepesh Garg 2020-11-13 17:57:57 +05:30
parent 78690af440
commit a862eb25e6

View File

@ -107,10 +107,11 @@ def execute():
''', (loan.name, loan.loan_account), as_dict=1)
for payment in payments:
if payment.credit_in_account_currency:
repayment_entry = make_repayment_entry(loan.name, loan.loan_applicant_type, loan.applicant,
loan_type, loan.company)
repayment_entry.amount_paid = payment.debit_in_account_currency
repayment_entry.amount_paid = payment.credit_in_account_currency
repayment_entry.posting_date = payment.posting_date
repayment_entry.save()
repayment_entry.submit()