Print format - including company file data

75 views
Skip to first unread message

Paul Dowd

unread,
Mar 26, 2014, 8:33:01 PM3/26/14
to erpnext-u...@googlegroups.com
Hi,

How can I include data from the company file on print format invoices, quotes etc. 

I have added custom fields for "Tax registration code (GST number)" and "company registration number" to the company file and I want to use these on print formats. I will also need to add some industry certification codes as well which need to be on all print views as part of the company details.

Many thanks

Paul

Paul Dowd

unread,
Mar 26, 2014, 8:36:29 PM3/26/14
to erpnext-u...@googlegroups.com
Is it possible to include this in the "Letterhead" section and then define where to include the "Letterhead" within the print format? 

E.g.

<div - print format>
<div - header>
<div - left column of header> some print format specific content here </div>
<div - print header> the "Letterhead" </div>
</div>
<div - rest of invoice></div>
</div>

Rushabh Mehta

unread,
Mar 27, 2014, 1:17:38 AM3/27/14
to erpnext-u...@googlegroups.com
Paul,

You will have to create a new Print Format via the UI. Go to Setup > Printing > Print Format. Check out an existing one on how to include values.

best,
Rushabh

Paul Dowd

unread,
Mar 27, 2014, 2:12:59 AM3/27/14
to erpnext-u...@googlegroups.com
Hi Rushabh,

I have done this, the issue is with including fields from the company file rather than the invoice file. Can you please post some code for getting fields from a the company file? E.g. the company name?

Thanks

Paul

Umair Sayyed

unread,
Mar 27, 2014, 7:36:41 AM3/27/14
to ERPNext User's Forum
Hello Paul,

Adding these static values (GST No./registration no.) in Letterhead would be good solution. Letterhead by default is shown as header in print formats.

Using terms and condition master to pull these details in transaction is another alternative. Terms is an open tax field where you can enter these details.

Selling >> Terms and Condition


--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/f8224600-1ba7-44fe-9d81-db5fb7216465%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks and Regards,
Umair Sayyed
www.erpnext.com

Paul Dowd

unread,
Mar 30, 2014, 5:37:29 PM3/30/14
to erpnext-u...@googlegroups.com
Hi
 
Thanks for the replies to date, unfortunately they don't really help :/

I suppose the main question is: How do I access data from a different form in the print format?

e.g. in the Delivery note print format I can easily access a custom UID Number fields using <script>doc.uid_number</script>

How do I access for instance the Batch batch_id field in the Delivery Note print format?

Thanks

Umair Sayyed

unread,
Mar 31, 2014, 2:49:31 AM3/31/14
to ERPNext User's Forum
Paul,

Batch Id field is located under Delivery Note Item table, which is the child table under Delivery Note.

In the Print Format's script, if you add Batch Id's field name in the script written for item table, it will be shown in the Delivery Note Print Format.


--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Paul Dowd

unread,
Apr 2, 2014, 7:08:26 PM4/2/14
to erpnext-u...@googlegroups.com
ok, so that was a terrible example for me to use

How about we go back to the original question around including information from the Company file. How do I include the Company doc-type custom field "exporter_number".

Thanks

Paul


On Monday, 31 March 2014 19:49:31 UTC+13, Umair Sayyed wrote:
Paul,

Batch Id field is located under Delivery Note Item table, which is the child table under Delivery Note.

In the Print Format's script, if you add Batch Id's field name in the script written for item table, it will be shown in the Delivery Note Print Format.
On Mon, Mar 31, 2014 at 3:07 AM, Paul Dowd <pd...@myzealand.com> wrote:
Hi
 
Thanks for the replies to date, unfortunately they don't really help :/

I suppose the main question is: How do I access data from a different form in the print format?

e.g. in the Delivery note print format I can easily access a custom UID Number fields using <script>doc.uid_number</script>

How do I access for instance the Batch batch_id field in the Delivery Note print format?

Thanks

--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

Paul Dowd

unread,
Apr 2, 2014, 7:14:05 PM4/2/14
to erpnext-u...@googlegroups.com
to further clarify, I'm looking for a code example I can use in print formats to access any field from any doc-type in a static manner. 

Something like <script>Doc-Type(ID).field_name</script> would be amazing if it worked.

thanks

Paul

Maxwell Morais

unread,
Apr 2, 2014, 9:17:13 PM4/2/14
to erpnext-u...@googlegroups.com

​Hi, Paul!

you can use a query in server to get some informations eg:

var company;
wn.call({
    method: "webnotes.client.get",
    args: {
        doctype: "Company",
        name: "Your company name"
    },
    callback: function(resp){
        if (resp.exc) throw resp.exc;
        company = resp.message[0];
    }
})​;


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/3ac4ecc0-6f24-47ab-badd-00d73fb23c5c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Best Regards.

Maxwell Morais
Python Developer powered by Webnotes framework <3

Paul Dowd

unread,
Apr 3, 2014, 9:19:41 PM4/3/14
to erpnext-u...@googlegroups.com
thanks Maxwell!

I'll give this a go for the static data. 

For linked data, how can I for instance get the "Expiry Date" field from the Batch?? Batch ID is easy, as has been shown previously in this topic, but on the Delivery Note we need to show Batch ID, Batch Expiry, and Batch Manufacture Date. 

If I need to add a new custom field to the Delivery Note Item doc-type so that it can be brought through then that is OK, but then the question will become what do I put in the "Options" field once I've selected the "Link" type to create the link to the Batch/Expiry Date field rather than just to Batch??

Paul


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsubscribe@googlegroups.com.



--
Thanks and Regards,
Umair Sayyed
www.erpnext.com

--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

Maxwell Morais

unread,
Apr 3, 2014, 9:42:52 PM4/3/14
to erpnext-u...@googlegroups.com

Paul, you can replace the method webnotes.client.get to webnotes.client.get_value and pass the field name in parameters eg: {doctype: "Company", fieldname: "exporter_number", filters: {name: "You Company Name"}}

For the complete API check https://github.com/webnotes/wnframework/blob/develop/webnotes/client.py



To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/c5ade28f-3c44-4224-91d0-1343286e3d0f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages