Server Side Prints

Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:

https://github.com/webnotes/erpnext/blob/edge/accounts/Print%20Format/SalesInvoice/SalesInvoice.html

Also separated styles, so that you can define multiple styles for the same print format:

https://github.com/webnotes/wnframework/tree/edge/core/doctype/print_format/styles

To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta



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 post to this group, send email to er...@googlegroups.com.

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

 

 

Hi Rushabh,

I am trying to make print formats for the server side, I was able to change the formats for sales invoice but when I try to copy the same format for say like sales order then I am unable to fetch the item detail table for sales order in the format, I am using this below code

{%- for row in doc.entries -%}
<tr>
<td style="width: 3%;">{{ row.idx }}</td>
<td style="width: 57%;">{{ row.description }}</td>
<td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("rate", doc) }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("amount", doc) }}</td>
</tr>
{%- endfor -%}

The full code can be found here.


On Friday, March 22, 2013 3:27:59 PM UTC+5:30, rushabh wrote:
Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:


Also separated styles, so that you can define multiple styles for the same print format:


To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/de95828b-524b-4808-bdee-77540285cfef%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
The table fieldname is "sales_order_details" (check the doctype)

so it must be

for row in doc.sales_order_details


On 18-Sep-2014, at 3:31 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi Rushabh,

I am trying to make print formats for the server side, I was able to change the formats for sales invoice but when I try to copy the same format for say like sales order then I am unable to fetch the item detail table for sales order in the format, I am using this below code

{%- for row in doc.entries -%}
<tr>
<td style="width: 3%;">{{ row.idx }}</td>
<td style="width: 57%;">{{ row.description }}</td>
<td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("rate", doc) }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("amount", doc) }}</td>
</tr>
{%- endfor -%}

The full code can be found here.


On Friday, March 22, 2013 3:27:59 PM UTC+5:30, rushabh wrote:
Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:


Also separated styles, so that you can define multiple styles for the same print format:


To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/de95828b-524b-4808-bdee-77540285cfef%40googlegroups.com.

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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/446B138B-E7AE-4A5A-8DCD-3AFAAF3E7753%40gmail.com.

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

Thanks for informing me about this.

So this is going to be old name in mysql sales_order_details, I thought it was renamed to sales_order_item. Also this means that old name for sales_invoice_item is entries

Now is there a way I could check the mysql table name in the system, I have tries this below code but I was unable to find any table named entries

show tables where tables_in_rigpl like '%entr%';


or am I missing something.

Actually the entries thing got me confused.

On Friday, September 19, 2014 10:18:06 AM UTC+5:30, rushabh wrote:
The table fieldname is "sales_order_details" (check the doctype)

so it must be

for row in doc.sales_order_details


On 18-Sep-2014, at 3:31 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi Rushabh,

I am trying to make print formats for the server side, I was able to change the formats for sales invoice but when I try to copy the same format for say like sales order then I am unable to fetch the item detail table for sales order in the format, I am using this below code

{%- for row in doc.entries -%}
<tr>
<td style="width: 3%;">{{ row.idx }}</td>
<td style="width: 57%;">{{ row.description }}</td>
<td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("rate", doc) }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("amount", doc) }}</td>
</tr>
{%- endfor -%}

The full code can be found here.


On Friday, March 22, 2013 3:27:59 PM UTC+5:30, rushabh wrote:
Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:


Also separated styles, so that you can define multiple styles for the same print format:


To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/de95828b-524b-4808-bdee-77540285cfef%40googlegroups.com.

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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/96eb1587-b5f9-47b2-8445-effe3903f653%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Just realized what you were trying to say, the fieldname in the parent doctype and not the table name ohh....sorry to bother you as it was there in customize form view,

On Friday, September 19, 2014 8:57:24 PM UTC+5:30, Aditya Duggal wrote:
Hi Rushabh,

Thanks for informing me about this.

So this is going to be old name in mysql sales_order_details, I thought it was renamed to sales_order_item. Also this means that old name for sales_invoice_item is entries

Now is there a way I could check the mysql table name in the system, I have tries this below code but I was unable to find any table named entries

show tables where tables_in_rigpl like '%entr%';


or am I missing something.

Actually the entries thing got me confused.

On Friday, September 19, 2014 10:18:06 AM UTC+5:30, rushabh wrote:
The table fieldname is "sales_order_details" (check the doctype)

so it must be

for row in doc.sales_order_details


On 18-Sep-2014, at 3:31 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi Rushabh,

I am trying to make print formats for the server side, I was able to change the formats for sales invoice but when I try to copy the same format for say like sales order then I am unable to fetch the item detail table for sales order in the format, I am using this below code

{%- for row in doc.entries -%}
<tr>
<td style="width: 3%;">{{ row.idx }}</td>
<td style="width: 57%;">{{ row.description }}</td>
<td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("rate", doc) }}</td>
<td style="width: 15%; text-align: right;">{{
row.get_formatted("amount", doc) }}</td>
</tr>
{%- endfor -%}

The full code can be found here.


On Friday, March 22, 2013 3:27:59 PM UTC+5:30, rushabh wrote:
Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:


Also separated styles, so that you can define multiple styles for the same print format:


To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/de95828b-524b-4808-bdee-77540285cfef%40googlegroups.com.

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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/339621c9-00f1-43cd-ad15-65b00c076dfb%40googlegroups.com.

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

Is it possible to have something like a page header which repeats on the server prints after every page. Since the client side print formats never used to support this kind of a thing.

I would like to know if I could somehow repeat the invoice number and page x of y on page header so that for multiple pages we know which invoice's page is the multiple page as currently there is no way of finding out whether the actual print of the page is for which invoice and seems like an orphan page if not stapled to the first page.

On Friday, March 22, 2013 3:27:59 PM UTC+5:30, rushabh wrote:
Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:


Also separated styles, so that you can define multiple styles for the same print format:


To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/56077243-da44-4204-afad-d6006ac8f9a3%40googlegroups.com.

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


On 20-Sep-2014, at 6:06 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi Rushabh,

Is it possible to have something like a page header which repeats on the server prints after every page. Since the client side print formats never used to support this kind of a thing.

I would like to know if I could somehow repeat the invoice number and page x of y on page header so that for multiple pages we know which invoice's page is the multiple page as currently there is no way of finding out whether the actual print of the page is for which invoice and seems like an orphan page if not stapled to the first page.

Makes sense - pls add a GitHub issue for this, we will add this.


On Friday, March 22, 2013 3:27:59 PM UTC+5:30, rushabh wrote:
Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:


Also separated styles, so that you can define multiple styles for the same print format:


To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/56077243-da44-4204-afad-d6006ac8f9a3%40googlegroups.com.

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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/3F44090A-81AD-421D-99AD-7AED248EB5C4%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
I have added this issue #861

On Monday, September 22, 2014 11:38:56 AM UTC+5:30, rushabh wrote:


On 20-Sep-2014, at 6:06 pm, Aditya Duggal <ad...@gmail.com> wrote:

Hi Rushabh,

Is it possible to have something like a page header which repeats on the server prints after every page. Since the client side print formats never used to support this kind of a thing.

I would like to know if I could somehow repeat the invoice number and page x of y on page header so that for multiple pages we know which invoice's page is the multiple page as currently there is no way of finding out whether the actual print of the page is for which invoice and seems like an orphan page if not stapled to the first page.

Makes sense - pls add a GitHub issue for this, we will add this.


On Friday, March 22, 2013 3:27:59 PM UTC+5:30, rushabh wrote:
Dear all,

Just released a beta feature in the "edge" branch to generate Server Side print formats. Will be added to master next week. 

In this, we generate print formats on the server-side using Jinja templates, so that they can be integrated with other apps and we will also use them in the webshop module.

Right now we have just made one format:


Also separated styles, so that you can define multiple styles for the same print format:


To generate the print format, use the print page with query parameters doctype, name, format and style. Example:

print?doctype=Sales Invoice&name=[invoice number]&format=SalesInvoice&style=standard

You must be logged in with appropriate permissions to the Invoice.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/56077243-da44-4204-afad-d6006ac8f9a3%40googlegroups.com.

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


  1. Please be kind and don't send large attachments
  2. For issues, features requests use https://github.com/frappe/erpnext/issues



    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/6bb06f16-ec7a-43cb-be27-63c879bd25f8%40googlegroups.com.

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