Merge pull request #22948 from AfshanKhan/dunning

fix: grand_total assignment before reference
This commit is contained in:
Rucha Mahabal 2020-08-07 16:12:56 +05:30 committed by GitHub
commit 67e54b1c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,6 +93,7 @@ def resolve_dunning(doc, state):
def calculate_interest_and_amount(posting_date, outstanding_amount, rate_of_interest, dunning_fee, overdue_days):
interest_amount = 0
grand_total = 0
if rate_of_interest:
interest_per_year = flt(outstanding_amount) * flt(rate_of_interest) / 100
interest_amount = (interest_per_year * cint(overdue_days)) / 365