Need some quick help for a custom script footer

Hey guys,

I am pretty good in understanding HTML and also in editing the print forms in ERPnext. I only have problems with scripts. So I would be really thankful if you could give me some help in regard to below issue.

What I basically want to do is adding a footer to quotation / invoice / purchase orders etc printouts (with our legal company details etc).

So the only thing I need is a line of script which enables me to do the following;

1) Whether the footer is shown / printed depends on whether the letterhead checkbox is ticked in the print screen (if that is not possible I am ok with adding another check box via custom fields function)

2) I am utilizing multiple companies in ERPNext so I need to use two different footers. Which footer is shown should then be depended on the value of the field "Letter Head" in the More Info section of e.g. a quotation.



3) The html code for the footer I will add myself. 

So summarizing I am just seraching for a short line of code which does the following

If Letterhead Checkbox = True
Second If Letterhead Select = "Company1" then show "HTML-Code1" (in footer)
Third If Letterhead Select = "Company2" then show "HTML-Code2" (in footer)
Else Dont show any Header or Footer

Hope its understandable what I mean.

Thanks a lot for your help! Really appreciate it!
Kind regards,
Flo



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

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

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/225a8120-b445-46b0-9121-522ccb8807c2%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
You will need to create a new Print Format.

In v3, you can write that script via Javascript. Add <script> tags where ever you want dynamic code like 

<script>doc.company=="Company 1" ? doc.html1 : doc.html2</script>

here are some old formats you can take for reference.

https://github.com/frappe/erpnext-print-templates

On Friday, April 25, 2014 4:09:27 PM UTC+5:30, fl...@gmail.com wrote:
Hey guys,

I am pretty good in understanding HTML and also in editing the print forms in ERPnext. I only have problems with scripts. So I would be really thankful if you could give me some help in regard to below issue.

What I basically want to do is adding a footer to quotation / invoice / purchase orders etc printouts (with our legal company details etc).

So the only thing I need is a line of script which enables me to do the following;

1) Whether the footer is shown / printed depends on whether the letterhead checkbox is ticked in the print screen (if that is not possible I am ok with adding another check box via custom fields function)

2) I am utilizing multiple companies in ERPNext so I need to use two different footers. Which footer is shown should then be depended on the value of the field "Letter Head" in the More Info section of e.g. a quotation.



3) The html code for the footer I will add myself. 

So summarizing I am just seraching for a short line of code which does the following

If Letterhead Checkbox = True
Second If Letterhead Select = "Company1" then show "HTML-Code1" (in footer)
Third If Letterhead Select = "Company2" then show "HTML-Code2" (in footer)
Else Dont show any Header or Footer

Hope its understandable what I mean.

Thanks a lot for your help! Really appreciate it!
Kind regards,
Flo



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

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

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/03ecf60b-8ae5-470b-a38b-c47499095dbf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Thanks a lot for your post.

I already created the print form and prepared everything. I just need to work on this last piece of script now.

The link you posted is unfortunately not really helpful as none includes any of the script I need.

Could you kindly have a look at it again and help me out on how to do what I described in point 1 (footer shows only when letterhead checkbox is ticked in the print window) & 2 (dependance on used company what html code is used). Where is the html-code for the doc.html1 attribue stored?

I really appreciate you help.

Thanks a lot,
Flo

On Friday, 25 April 2014 19:08:21 UTC+4, rushabh wrote:
You will need to create a new Print Format.

In v3, you can write that script via Javascript. Add <script> tags where ever you want dynamic code like 

<script>doc.company=="Company 1" ? doc.html1 : doc.html2</script>

here are some old formats you can take for reference.

https://github.com/frappe/erpnext-print-templates

On Friday, April 25, 2014 4:09:27 PM UTC+5:30, fl...@gmail.com wrote:
Hey guys,

I am pretty good in understanding HTML and also in editing the print forms in ERPnext. I only have problems with scripts. So I would be really thankful if you could give me some help in regard to below issue.

What I basically want to do is adding a footer to quotation / invoice / purchase orders etc printouts (with our legal company details etc).

So the only thing I need is a line of script which enables me to do the following;

1) Whether the footer is shown / printed depends on whether the letterhead checkbox is ticked in the print screen (if that is not possible I am ok with adding another check box via custom fields function)

2) I am utilizing multiple companies in ERPNext so I need to use two different footers. Which footer is shown should then be depended on the value of the field "Letter Head" in the More Info section of e.g. a quotation.



3) The html code for the footer I will add myself. 

So summarizing I am just seraching for a short line of code which does the following

If Letterhead Checkbox = True
Second If Letterhead Select = "Company1" then show "HTML-Code1" (in footer)
Third If Letterhead Select = "Company2" then show "HTML-Code2" (in footer)
Else Dont show any Header or Footer

Hope its understandable what I mean.

Thanks a lot for your help! Really appreciate it!
Kind regards,
Flo



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

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

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d20fe43c-9316-4c85-87d8-200e689916d7%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
What did you try so far?


On Saturday, April 26, 2014 3:43:09 AM UTC+5:30, fl...@gmail.com wrote:
Thanks a lot for your post.

I already created the print form and prepared everything. I just need to work on this last piece of script now.

The link you posted is unfortunately not really helpful as none includes any of the script I need.

Could you kindly have a look at it again and help me out on how to do what I described in point 1 (footer shows only when letterhead checkbox is ticked in the print window) & 2 (dependance on used company what html code is used). Where is the html-code for the doc.html1 attribue stored?

I really appreciate you help.

Thanks a lot,
Flo

On Friday, 25 April 2014 19:08:21 UTC+4, rushabh wrote:
You will need to create a new Print Format.

In v3, you can write that script via Javascript. Add <script> tags where ever you want dynamic code like 

<script>doc.company=="Company 1" ? doc.html1 : doc.html2</script>

here are some old formats you can take for reference.

https://github.com/frappe/erpnext-print-templates

On Friday, April 25, 2014 4:09:27 PM UTC+5:30, fl...@gmail.com wrote:
Hey guys,

I am pretty good in understanding HTML and also in editing the print forms in ERPnext. I only have problems with scripts. So I would be really thankful if you could give me some help in regard to below issue.

What I basically want to do is adding a footer to quotation / invoice / purchase orders etc printouts (with our legal company details etc).

So the only thing I need is a line of script which enables me to do the following;

1) Whether the footer is shown / printed depends on whether the letterhead checkbox is ticked in the print screen (if that is not possible I am ok with adding another check box via custom fields function)

2) I am utilizing multiple companies in ERPNext so I need to use two different footers. Which footer is shown should then be depended on the value of the field "Letter Head" in the More Info section of e.g. a quotation.



3) The html code for the footer I will add myself. 

So summarizing I am just seraching for a short line of code which does the following

If Letterhead Checkbox = True
Second If Letterhead Select = "Company1" then show "HTML-Code1" (in footer)
Third If Letterhead Select = "Company2" then show "HTML-Code2" (in footer)
Else Dont show any Header or Footer

Hope its understandable what I mean.

Thanks a lot for your help! Really appreciate it!
Kind regards,
Flo



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

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

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/438dd8e5-ba25-4c42-b260-6b6d8b915e65%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
To be honest I have no clue about JavaScript. I also tried to read into it but I just dont get ahead. I also tried to copy some stuff of the "Discount" function in the quotation template but I just was not able to get anything done. My company really wants to utilize erpnext but if we dont get this footer thing sorted out they gonna reject it. It would be great if you could give me some more ideas on what to do. thanks.



On Saturday, 26 April 2014 08:06:59 UTC+4, rushabh wrote:
What did you try so far?


On Saturday, April 26, 2014 3:43:09 AM UTC+5:30, fl...@gmail.com wrote:
Thanks a lot for your post.

I already created the print form and prepared everything. I just need to work on this last piece of script now.

The link you posted is unfortunately not really helpful as none includes any of the script I need.

Could you kindly have a look at it again and help me out on how to do what I described in point 1 (footer shows only when letterhead checkbox is ticked in the print window) & 2 (dependance on used company what html code is used). Where is the html-code for the doc.html1 attribue stored?

I really appreciate you help.

Thanks a lot,
Flo

On Friday, 25 April 2014 19:08:21 UTC+4, rushabh wrote:
You will need to create a new Print Format.

In v3, you can write that script via Javascript. Add <script> tags where ever you want dynamic code like 

<script>doc.company=="Company 1" ? doc.html1 : doc.html2</script>

here are some old formats you can take for reference.

https://github.com/frappe/erpnext-print-templates

On Friday, April 25, 2014 4:09:27 PM UTC+5:30, fl...@gmail.com wrote:
Hey guys,

I am pretty good in understanding HTML and also in editing the print forms in ERPnext. I only have problems with scripts. So I would be really thankful if you could give me some help in regard to below issue.

What I basically want to do is adding a footer to quotation / invoice / purchase orders etc printouts (with our legal company details etc).

So the only thing I need is a line of script which enables me to do the following;

1) Whether the footer is shown / printed depends on whether the letterhead checkbox is ticked in the print screen (if that is not possible I am ok with adding another check box via custom fields function)

2) I am utilizing multiple companies in ERPNext so I need to use two different footers. Which footer is shown should then be depended on the value of the field "Letter Head" in the More Info section of e.g. a quotation.



3) The html code for the footer I will add myself. 

So summarizing I am just seraching for a short line of code which does the following

If Letterhead Checkbox = True
Second If Letterhead Select = "Company1" then show "HTML-Code1" (in footer)
Third If Letterhead Select = "Company2" then show "HTML-Code2" (in footer)
Else Dont show any Header or Footer

Hope its understandable what I mean.

Thanks a lot for your help! Really appreciate it!
Kind regards,
Flo



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

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

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e61d8a79-43e2-4c06-9bc3-0a4f6e374dca%40googlegroups.com.

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

You should engage the help of a freelancer (there could be a few on this forum) to help you out. If you are stuck somewhere but would be happy to help you out. But if you have no clue about javascript, then thats not a very good starting point.


On Saturday, April 26, 2014 2:46:18 PM UTC+5:30, fl...@gmail.com wrote:
To be honest I have no clue about JavaScript. I also tried to read into it but I just dont get ahead. I also tried to copy some stuff of the "Discount" function in the quotation template but I just was not able to get anything done. My company really wants to utilize erpnext but if we dont get this footer thing sorted out they gonna reject it. It would be great if you could give me some more ideas on what to do. thanks.



On Saturday, 26 April 2014 08:06:59 UTC+4, rushabh wrote:
What did you try so far?


On Saturday, April 26, 2014 3:43:09 AM UTC+5:30, fl...@gmail.com wrote:
Thanks a lot for your post.

I already created the print form and prepared everything. I just need to work on this last piece of script now.

The link you posted is unfortunately not really helpful as none includes any of the script I need.

Could you kindly have a look at it again and help me out on how to do what I described in point 1 (footer shows only when letterhead checkbox is ticked in the print window) & 2 (dependance on used company what html code is used). Where is the html-code for the doc.html1 attribue stored?

I really appreciate you help.

Thanks a lot,
Flo

On Friday, 25 April 2014 19:08:21 UTC+4, rushabh wrote:
You will need to create a new Print Format.

In v3, you can write that script via Javascript. Add <script> tags where ever you want dynamic code like 

<script>doc.company=="Company 1" ? doc.html1 : doc.html2</script>

here are some old formats you can take for reference.

https://github.com/frappe/erpnext-print-templates

On Friday, April 25, 2014 4:09:27 PM UTC+5:30, fl...@gmail.com wrote:
Hey guys,

I am pretty good in understanding HTML and also in editing the print forms in ERPnext. I only have problems with scripts. So I would be really thankful if you could give me some help in regard to below issue.

What I basically want to do is adding a footer to quotation / invoice / purchase orders etc printouts (with our legal company details etc).

So the only thing I need is a line of script which enables me to do the following;

1) Whether the footer is shown / printed depends on whether the letterhead checkbox is ticked in the print screen (if that is not possible I am ok with adding another check box via custom fields function)

2) I am utilizing multiple companies in ERPNext so I need to use two different footers. Which footer is shown should then be depended on the value of the field "Letter Head" in the More Info section of e.g. a quotation.



3) The html code for the footer I will add myself. 

So summarizing I am just seraching for a short line of code which does the following

If Letterhead Checkbox = True
Second If Letterhead Select = "Company1" then show "HTML-Code1" (in footer)
Third If Letterhead Select = "Company2" then show "HTML-Code2" (in footer)
Else Dont show any Header or Footer

Hope its understandable what I mean.

Thanks a lot for your help! Really appreciate it!
Kind regards,
Flo



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

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

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/33fb4aed-ba68-4219-876f-1f153b566312%40googlegroups.com.

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