New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let users create their own templates #283
Comments
Customizable templates is something we will be adding in once most of the basic requirements such as import, export, etc are taken care of. The question is how customizable. ERPNext has the Print Format Builder (docs are outdated, I'd suggest checking it on a trial instance it's pretty neat), but this doesn't allow for coded templates as of yet. Mostly initial implementation of this request will include a draggable interface a la Print Format Builder, then move onto support code templates. Will keep you updated wrt progress on this. |
Yeah sounds like a plan! Ideally, I wouldn't have to code at all. I would want to have a way to access available variables (through print format builder for example) but also know which classes I can style with my own css. I think my main problem was not knowing which classes and styles get applied to the printing preview, then to the pdf dialog, and to the print itself. They all had different classes and styles, so it was difficult to anticipate which styles to reset and why some changes weren't being applied etc... In the end I wasn't able to use my styled invoice without dedicating more time to it, so I never really got into using the whole system (which isn't ideal and probably not super common, but I really need the aesthetics to be right). So yeah to recap, these could be solving the problem without too much change in the roadmap:
I'll attach a screenshot of the design I've tried to replicate. |
Ok I definitely need to try again using the print format builder, it looks really useful.
|
Having such a feature would be great or even a new template that contains the customer and company details in two columns like in leprodude image. |
is there any project that does "print format builder" outside of erpnext ? like a library or something? |
In the next version of Frappe Books the Template Builder will be included, you'll be able to create custom templates using this. |
Love the look and feel so far. One thing I'd love and why I'm still not really using ERPNext is that designing my own invoice templates is a real pain in the butt.
Here is what I have in mind:
You might want to look into using MJML as helper for that. It's open-source and meant for responsive Email, but I could imagine using their App to design my template, then just copy paste the HTML into a file and use that as template here.
That would make it much easier to design customised, beautiful invoices. Especially, because I could add {{ doc.customer_name }} as text in my design and just copy paste the whole thing over into my Books template file. Making small adjustments is much smoother that way.
They also have some json capability etc, so I can imagine there should be a relatively easy way of setting it up so that this "Email HTML" can generate a PDF.
<mj-section background-color="#fff"> <mj-column width="100%"> <mj-text css-class="bold" mj-class="is-size-6">{{ doc.select_print_heading or doc.doctype }}</mj-text> <mj-text css-class="bold" mj-class="is-size-7">{{ doc.customer_name }}</mj-text> </mj-column> <mj-column width="60%"> <mj-text css-class="" mj-class="is-size-7">{{ doc.address_display }}<br>{{ doc.territory }}</mj-text> <mj-text css-class="bold" mj-class="is-size-7">{{ doc.transaction_date }}</mj-text> <mj-text css-class="" mj-class="is-size-7">{{ doc.territory }}</mj-text> </mj-column> <mj-column width="39%"> <mj-text mj-class="is-size-7"><strong>{{ doc.select_print_heading or doc.doctype }}-No:</strong> {{ doc.name }}<br><strong>Date:</strong> {{ doc.transaction_date }}</mj-text> </mj-column> </mj-section>
This is my start on integrating ERPNext doc variables into my MJML template. It works fine so far, but PDF preview and generation look off, so I stopped in frustration for now...
Happy to test and help out with this, it's one of the features I haven't really seen in tools so far.
The text was updated successfully, but these errors were encountered: