mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
refactor: remove flex usage for better wkhtmltopdf support
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead, footer, print_settings=None,
|
{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead, footer, print_settings=None,
|
||||||
print_heading_template=None) -%} {% if letter_head and not no_letterhead %}
|
print_heading_template=None) -%}
|
||||||
<div class="letter-head">{{ letter_head }}</div>
|
{% if letter_head and not no_letterhead %}
|
||||||
{% endif %} {% if print_heading_template %} {{ frappe.render_template(print_heading_template, {"doc":doc}) }}
|
<div class="letter-head">{{ letter_head }}</div>
|
||||||
{% endif %} {%- endmacro -%} {% for page in layout %}
|
{% endif %}
|
||||||
|
{% if print_heading_template %}
|
||||||
|
{{ frappe.render_template(print_heading_template, {"doc":doc}) }}
|
||||||
|
{% endif %}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{% for page in layout %}
|
||||||
<div class="page-break invoice-page">
|
<div class="page-break invoice-page">
|
||||||
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
|
<div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
|
||||||
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer, print_settings) }}
|
{{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer, print_settings) }}
|
||||||
@@ -11,7 +16,7 @@ print_heading_template=None) -%} {% if letter_head and not no_letterhead %}
|
|||||||
<style>
|
<style>
|
||||||
.letter-head {
|
.letter-head {
|
||||||
padding-top: 12px !important;
|
padding-top: 12px !important;
|
||||||
/* margin-top: 0px !important; */
|
padding-bottom: 12px !important;
|
||||||
}
|
}
|
||||||
.invoice-page {
|
.invoice-page {
|
||||||
font-family: Inter, sans-serif;
|
font-family: Inter, sans-serif;
|
||||||
@@ -86,13 +91,13 @@ print_heading_template=None) -%} {% if letter_head and not no_letterhead %}
|
|||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.items-table tr:first-child td:first-child,
|
.items-table thead tr:first-child td:first-child,
|
||||||
.tax-table tr:first-child td:first-child {
|
.tax-table thead tr:first-child td:first-child {
|
||||||
border-top-left-radius: 10px;
|
border-top-left-radius: 10px;
|
||||||
border-bottom-left-radius: 10px;
|
border-bottom-left-radius: 10px;
|
||||||
}
|
}
|
||||||
.items-table tr:first-child td:last-child,
|
.items-table thead tr:first-child td:last-child,
|
||||||
.tax-table tr:first-child td:last-child {
|
.tax-table thead tr:first-child td:last-child {
|
||||||
border-top-right-radius: 10px;
|
border-top-right-radius: 10px;
|
||||||
border-bottom-right-radius: 10px;
|
border-bottom-right-radius: 10px;
|
||||||
}
|
}
|
||||||
@@ -113,19 +118,6 @@ print_heading_template=None) -%} {% if letter_head and not no_letterhead %}
|
|||||||
background: #f8f8f8;
|
background: #f8f8f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-thumb {
|
|
||||||
min-width: 24px;
|
|
||||||
min-height: 24px;
|
|
||||||
max-width: 24px;
|
|
||||||
max-height: 24px;
|
|
||||||
border-radius: 6px;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-card {
|
.info-card {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
color: #7c7c7c;
|
color: #7c7c7c;
|
||||||
@@ -156,17 +148,22 @@ print_heading_template=None) -%} {% if letter_head and not no_letterhead %}
|
|||||||
|
|
||||||
.tax-table td,
|
.tax-table td,
|
||||||
.items-table td {
|
.items-table td {
|
||||||
height: 40px;
|
height: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tax-table thead td,
|
.tax-table thead td,
|
||||||
.items-table thead td {
|
.items-table thead td {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-img td {
|
||||||
|
border: none !important;
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="print-format-body">
|
<div class="print-format-body">
|
||||||
<table class="info-table col-xs-12" style="width: 100%">
|
<table class="info-table col-xs-12" style="width: 100%; margin-left: 12px">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="col-xs-7" style="padding: 0 !important">
|
<td class="col-xs-7" style="padding: 0 !important">
|
||||||
<div class="title col-xs-5 p-0">
|
<div class="title col-xs-5 p-0">
|
||||||
@@ -219,16 +216,32 @@ print_heading_template=None) -%} {% if letter_head and not no_letterhead %}
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="text-center">{{ loop.index }}</td>
|
<td class="text-center">{{ loop.index }}</td>
|
||||||
<td class="text-left">
|
<td class="text-left">
|
||||||
<div style="display: flex; align-items: center; gap: 8px">
|
<table class="item-img" style="border-collapse: collapse">
|
||||||
<div class="img-thumb">
|
<tr>
|
||||||
{% if item.image %}
|
{% if item.image %}
|
||||||
<div>
|
<td class="no-style" style="border-radius: 6px; vertical-align: middle">
|
||||||
<img src="{{ item.image }}" alt="{{ item.item_name }}" />
|
<img
|
||||||
</div>
|
src="{{ item.image }}"
|
||||||
|
alt="{{ item.item_name }}"
|
||||||
|
style="
|
||||||
|
border-radius: 6px;
|
||||||
|
max-height: 24px;
|
||||||
|
min-height: 24px;
|
||||||
|
max-width: 24px;
|
||||||
|
min-width: 24px;
|
||||||
|
margin-right: 8px;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
<td
|
||||||
<div>{{ item.item_name }}</div>
|
class="no-style"
|
||||||
</div>
|
style="vertical-align: middle !important; padding: 0 !important"
|
||||||
|
>
|
||||||
|
{{ item.item_name }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-center">{{ item.gst_hsn_code }}</td>
|
<td class="text-center">{{ item.gst_hsn_code }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user