Wednesday, 14 March 2018

Add page break after every 8 element in print format

   {% if loop.index % 8==0 -%}
            </tbody>
            </table>
        <div class="page-break"></div>
        <table class="table table-condensed table-bordered tableCentered">
        <tr>
            <th>{{ _("Item Code") }}</th>
            <th>{{ _("Description") }}</th>
            <th>{{ _("Unit") }}</th>
            <th>{{ _("Quantity") }}</th>
            <th>{{ _("Price") }}</th>
            <th>{{ _("Discount") }}</th>
            <th>{{ _("Sub Total") }}</th>
            <th>{{ _("Tax") }}</th>
        </tr>
        {%- endif %}
 
        {% if row.page_break -%}
            </tbody>
            </table>
        <div class="page-break"></div>

        <table class="table table-condensed table-bordered tableCentered tableLogo">
            <tr style="border:none !important;">
              <td rowspan="2" style="border:none !important;">
                <img src="/files/images.jpg" alt = "Levis Logo" style="width:150px !important;">
              </td>
              <td class="lineSpace" rowspan="2" style="border:none !important;">
                    <p class = "line_height" style="font-size:16px; padding-top:5px !important;"><label>{{ doc.company or "" }}</label></p>
                    {% set company = frappe.get_doc("Company", doc.company) %}
                   
              </td>
             
            </tr> 
           
            </tr>
        </table>

No comments:

Post a Comment

Django rest api - filter

views.py from django_filters.rest_framework import DjangoFilterBackend class PollList(viewsets.ModelViewSet):     queryset = X.objects...