mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
feat: sticky columns in reports
Co-authored-by: diptanilsaha <diptanil@frappe.io>
This commit is contained in:
@@ -1199,6 +1199,7 @@ class ReceivablePayableReport:
|
|||||||
fieldtype="Dynamic Link",
|
fieldtype="Dynamic Link",
|
||||||
options="party_type",
|
options="party_type",
|
||||||
width=180,
|
width=180,
|
||||||
|
sticky=(self.party_naming_by not in ["Naming Series", "Auto Name"]),
|
||||||
)
|
)
|
||||||
if self.account_type == "Receivable":
|
if self.account_type == "Receivable":
|
||||||
label = _("Receivable Account")
|
label = _("Receivable Account")
|
||||||
@@ -1213,6 +1214,7 @@ class ReceivablePayableReport:
|
|||||||
fieldtype="Link",
|
fieldtype="Link",
|
||||||
options="Account",
|
options="Account",
|
||||||
width=180,
|
width=180,
|
||||||
|
sticky=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.party_naming_by == "Naming Series":
|
if self.party_naming_by == "Naming Series":
|
||||||
@@ -1226,6 +1228,7 @@ class ReceivablePayableReport:
|
|||||||
label=label,
|
label=label,
|
||||||
fieldname=fieldname,
|
fieldname=fieldname,
|
||||||
fieldtype="Data",
|
fieldtype="Data",
|
||||||
|
sticky=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.account_type == "Receivable":
|
if self.account_type == "Receivable":
|
||||||
@@ -1309,7 +1312,7 @@ class ReceivablePayableReport:
|
|||||||
if self.filters.show_remarks:
|
if self.filters.show_remarks:
|
||||||
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200)
|
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200)
|
||||||
|
|
||||||
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120):
|
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120, sticky=False):
|
||||||
if not fieldname:
|
if not fieldname:
|
||||||
fieldname = scrub(label)
|
fieldname = scrub(label)
|
||||||
if fieldtype == "Currency":
|
if fieldtype == "Currency":
|
||||||
@@ -1318,7 +1321,14 @@ class ReceivablePayableReport:
|
|||||||
width = 90
|
width = 90
|
||||||
|
|
||||||
self.columns.append(
|
self.columns.append(
|
||||||
dict(label=label, fieldname=fieldname, fieldtype=fieldtype, options=options, width=width)
|
dict(
|
||||||
|
label=label,
|
||||||
|
fieldname=fieldname,
|
||||||
|
fieldtype=fieldtype,
|
||||||
|
options=options,
|
||||||
|
width=width,
|
||||||
|
sticky=sticky,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def setup_ageing_columns(self):
|
def setup_ageing_columns(self):
|
||||||
|
|||||||
@@ -676,13 +676,20 @@ def get_columns(filters):
|
|||||||
"options": "GL Entry",
|
"options": "GL Entry",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
},
|
},
|
||||||
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 120},
|
{
|
||||||
|
"label": _("Posting Date"),
|
||||||
|
"fieldname": "posting_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 120,
|
||||||
|
"sticky": True,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": _("Account"),
|
"label": _("Account"),
|
||||||
"fieldname": "account",
|
"fieldname": "account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"width": 180,
|
"width": 180,
|
||||||
|
"sticky": True,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Debit ({0})").format(currency),
|
"label": _("Debit ({0})").format(currency),
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ def get_columns(filters):
|
|||||||
"fieldname": "item_code",
|
"fieldname": "item_code",
|
||||||
"options": "Item",
|
"options": "Item",
|
||||||
"width": 120,
|
"width": 120,
|
||||||
|
"sticky": True,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Item Name"),
|
"label": _("Item Name"),
|
||||||
@@ -41,6 +42,7 @@ def get_columns(filters):
|
|||||||
"fieldname": "item_group",
|
"fieldname": "item_group",
|
||||||
"options": "Item Group",
|
"options": "Item Group",
|
||||||
"width": 120,
|
"width": 120,
|
||||||
|
"sticky": True,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Description"),
|
"label": _("Description"),
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ def get_columns(filters):
|
|||||||
"fieldname": "item_code",
|
"fieldname": "item_code",
|
||||||
"options": "Item",
|
"options": "Item",
|
||||||
"width": 120,
|
"width": 120,
|
||||||
|
"sticky": True,
|
||||||
},
|
},
|
||||||
{"label": _("Item Name"), "fieldtype": "Data", "fieldname": "item_name", "width": 140},
|
{"label": _("Item Name"), "fieldtype": "Data", "fieldname": "item_name", "width": 140},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user