ERPNext Conference 2019* ERPNext.com Blog

How to Get value from another document in script report?


#1

I can Get value from another document in Print Format.

frappe.db.get_value("[doctype]", "[name]", "fieldname")

How to Get value from another document in script report ?


#2

Same script should work. Did you try?


#3

Thank rmehta.
In General Leger report. in file : general_leger.html
I want to get Addrees company.

<h2 class="text-center">{%= __("Statement of Account") %}</h2>
<h4 class="text-center">{%= filters.account && (filters.account + ", ")  || "" %} {%= filters.company %}</h4>
<h2 class="text-center">{%= frappe.db.get_value("Company", filters.company, "address") %}</h2>

It error.
JackLe


#4

Hi, rmehta
I want to view company address in Gerneral Leger report. How to do that ?
JackLe


#5

This is the print format and is generated on the client side. You can’t use python functions here.

Make a letter head based on company name. All letter heads are loaded in boot so you can use:

{%= frappe.boot.letter_heads["my company letterhead"] %}

#6

Thanks, rmehta.
I don’t understand . Can you explain to me ?.
I want to view company address in Gerneral Leger report.
Can you review some code ?
I think it likes Scrip in Print Format. But I can’t do that.
JackLe,


#7

What did you not understand? Did you try my suggestion?


#8

Hi rmehta.


I want to view my company address.

How can i do that ?
Jack Le.


#9

Add your address in your letter head.

Or you can send your company address via boot.py and then access it in the client site at frappe.boot.address


#10

@rmehta I have create python function to get the Customer address from sales Invoice. Now I want to replicate this address in Custom Script Report. I am trying with jinja. but I am not getting address into report.


Display Customer address into Custom Script Report?