From 046ec928e0c1bb6dfd57c6207ac280f4e9e3857e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:21:21 +0530 Subject: [PATCH 1/2] fix: Display appropriate message if different Payment Terms are used in PE and its Payment References (#27763) (cherry picked from commit 9f14695743f2d0243c572d2cd7285ea71c624687) Co-authored-by: GangaManoj Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com> --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 607f85c87bd..1e9c0098bc7 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -390,6 +390,9 @@ class PaymentEntry(AccountsController): invoice_paid_amount_map[invoice_key]['discounted_amt'] = ref.total_amount * (term.discount / 100) for key, allocated_amount in iteritems(invoice_payment_amount_map): + if not invoice_paid_amount_map.get(key): + frappe.throw(_('Payment term {0} not used in {1}').format(key[0], key[1])) + outstanding = flt(invoice_paid_amount_map.get(key, {}).get('outstanding')) discounted_amt = flt(invoice_paid_amount_map.get(key, {}).get('discounted_amt')) From 32d72fdecb04d99453e015bdc87851e1e0ab237d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:49:06 +0530 Subject: [PATCH 2/2] fix: Only calculate first_respone_time if SLA is set (#27789) (#27793) Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com> (cherry picked from commit ad03eb25df6c07beb744a0fe3003a4c6fb19b98e) Co-authored-by: Ganga Manoj --- erpnext/support/doctype/issue/issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index 272e3be2648..91ef68ae001 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -539,7 +539,7 @@ def get_time_in_timedelta(time): def set_first_response_time(communication, method): if communication.get('reference_doctype') == "Issue": issue = get_parent_doc(communication) - if is_first_response(issue): + if is_first_response(issue) and issue.service_level_agreement: first_response_time = calculate_first_response_time(issue, get_datetime(issue.first_responded_on)) issue.db_set("first_response_time", first_response_time)