fix: allocation logic on 'Get Outstanding Invoices' btn in PE
1. fixed broken `payment_term` filter in Payment References section 2. Throw error if user fails to select 'Payment Term' for an invoice with 'Payment Term based allocation' enabled.
This commit is contained in:
@@ -874,3 +874,18 @@ def get_fields(doctype, fields=None):
|
||||
fields.insert(1, meta.title_field.strip())
|
||||
|
||||
return unique(fields)
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
@frappe.validate_and_sanitize_search_inputs
|
||||
def get_payment_terms_for_references(doctype, txt, searchfield, start, page_len, filters) -> list:
|
||||
terms = []
|
||||
if filters:
|
||||
terms = frappe.db.get_all(
|
||||
"Payment Schedule",
|
||||
filters={"parent": filters.get("reference")},
|
||||
fields=["payment_term"],
|
||||
limit=page_len,
|
||||
as_list=1,
|
||||
)
|
||||
return terms
|
||||
|
||||
Reference in New Issue
Block a user