refactor: provision to set remarks length in accounts settings

This commit is contained in:
ruthra kumar
2023-11-18 09:04:36 +05:30
parent a5a5341643
commit 97090ff367
2 changed files with 41 additions and 3 deletions

View File

@@ -164,7 +164,12 @@ def get_gl_entries(filters, accounting_dimensions):
credit_in_account_currency """
if filters.get("show_remarks"):
select_fields += """,remarks"""
if remarks_length := frappe.db.get_single_value(
"Accounts Settings", "general_ledger_remarks_length"
):
select_fields += f",substr(remarks, 1, {remarks_length}) as 'remarks'"
else:
select_fields += """,remarks"""
order_by_statement = "order by posting_date, account, creation"