General Ledger print formt customization

I am trying to customize print format of general ledger. I want to print employee name instead of its Id when party type is employee. but somehow i am not able to access frappe.db.get_value in general_ledger.html. is there any other way to achieve it?

Deep Trivedi

Hi @Deep

You can use frappe.db.get_value(“Employee”, doc.employee, “employee_name”)
Did you make custom print format? Please share the code


Hey @rohit_w thanks for replying.
I am customizing general_ledger.html file.
following code is not working in that file.

{% if(filters.party_type == “Employee”) { %}
{%= frappe.db.get_value(“Employee”,, “employee_name”) %}
{% } %}

Hi Deep,

Sorry for bumping old topic, but i do have similar problem here.

Did you manage to get the db value inside the HTML .

I just want to get the customer name when the party type is Customer in General ledger print.


@naim5441 As of now we cannot use frappe.db.get_value in Print format of any report. But you can make and new filter filed ( a data filed) and set the value of customer name there and use it in the print format of report like filters.field_name .

Yeap, that was my current design also, need to add data field . Just thinking if it is possible by just adding sql query in the html .I think its because the format type is JS, if Server type we can add query like we do on print format.

Thanks for your reply.