Server-side template & custom javascript function

55 views
Skip to first unread message

Nonnatee Kanjana

unread,
Aug 22, 2014, 10:49:00 PM8/22/14
to erpnext-dev...@googlegroups.com
Hi,
I have a javascript function to print amount in word for Thai lang. However, I cant seem to get it to work together with print format using server-side template. Plz help.

Rushabh Mehta

unread,
Aug 23, 2014, 4:46:47 AM8/23/14
to erpnext-dev...@googlegroups.com

On 23-Aug-2014, at 8:19 am, Nonnatee Kanjana <nonn...@ps-groups.com> wrote:

> Hi,
> I have a javascript function to print amount in word for Thai lang. However, I cant seem to get it to work together with print format using server-side template. Plz help.

Why don't you share what you have done so far?

>
> --
> Note:
>
> If you are posting an issue,
>
> 1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
> 2. 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.
> 3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
> 4. 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d6e56933-3011-4bc3-ab09-73d0ee396ca2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Nonnatee Kanjana

unread,
Aug 23, 2014, 10:41:19 AM8/23/14
to erpnext-dev...@googlegroups.com
Hi,

The print format code can be found here
The javascript for printing amount in word for Thai land is not very sophisticated. But readable.

Nonnatee Kanjana

unread,
Aug 24, 2014, 5:45:21 AM8/24/14
to erpnext-dev...@googlegroups.com
hi,

My post reply seem to disappear. nvm, here is the paste bin of the print format 
The javascript and css are not very sophisticated. 

Thanks. 

Rushabh Mehta

unread,
Aug 25, 2014, 3:06:25 AM8/25/14
to erpnext-dev...@googlegroups.com
So where are you stuck? What is your error message?



-- 
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. 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.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. 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...@googlegroups.com.

Nonnatee Kanjana

unread,
Aug 26, 2014, 4:59:13 PM8/26/14
to erpnext-dev...@googlegroups.com
Their is  no error msg. I just can’t get any javascript inside the <script> tag to execute.
eg. 

  1.                     <td class="field_label" width="20%">{{ _("Total of ") }}</td>
  2.                     <td class="field_label" style="text-align: center; width: 35%;">
  3.                         <div><script> (doc.entries.length) </script> &nbsp;
  4.                             <script>if (doc.entries.length > 1){ ('items.')}else{ ('item.')}</script> -</div>
  5.                         <div><i style="color:lightgray;">(E. &amp;O. E)</i></div>
  6.                     </td>
or
  1. <script>                    ThaiBaht(format_currency(doc.grand_total_export, doc.currency), doc.currency)
  2. </script>
 


On Saturday, August 23, 2014 9:49:00 AM UTC+7, Nonnatee Kanjana wrote:

Rushabh Mehta

unread,
Aug 27, 2014, 12:35:16 AM8/27/14
to erpnext-dev...@googlegroups.com
Why don't you generate your formats server side?


--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. 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.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. 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...@googlegroups.com.

Nonnatee Kanjana

unread,
Aug 27, 2014, 3:38:09 AM8/27/14
to erpnext-dev...@googlegroups.com
hi,

Not sure where to start. could you point me the right direction. so I could finally contribute. 

On Saturday, August 23, 2014 9:49:00 AM UTC+7, Nonnatee Kanjana wrote:

Rushabh Mehta

unread,
Aug 27, 2014, 4:37:35 AM8/27/14
to erpnext-dev...@googlegroups.com
On 27-Aug-2014, at 1:08 pm, Nonnatee Kanjana <nonn...@ps-groups.com> wrote:

hi,

Not sure where to start. could you point me the right direction. so I could finally contribute. 

mm - you will have to make this function translatable (add the _() to the strings) - then you can use it.


On Saturday, August 23, 2014 9:49:00 AM UTC+7, Nonnatee Kanjana wrote:
Hi,
I have a javascript function to print amount in word for Thai lang. However, I cant seem to get it to work together with print format using server-side template. Plz help.

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. 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.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. 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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages