[*] print → Save As Pdf (работает отлично, поддерживает макет и все остальное)
[*] прямое PDF -кнопку (разрывы: размер фонда, margins и изменение размера страницы)
печати CSS , что влияет на оба метода. Хотя некоторые изменения отражаются, это также нарушает «Print → Save As PDF». /> рендеринг wkhtmltopdf без CSS - Custom и Core - все стандартные решения не влияют - Ubuntu 18.04 < /li>
Сгенерированные PDF выглядят странно, wkhtmltopdf, no bootstrap css < /li>
wkhtml /> wkhtmltopdf Не загружая локальные CSS и изображения < /li>
< /ul>
что я пробовал, разрешил: < /h4>
[list]
restrection css в printmles < /strong> < /li>
eSeruction wkht Установлено (с использованием версии, приготовленной в QT 0.12.6 )
[*] Добавлен "host_name": "example.com" , в siteName/site_config.json и запустил командную скамейку Migrate
[*] в моем случае, qr, qr, qr, qr, qr, qr, qr, qr, qr, qr, qr, qr, qr, qr, qr. С путями
[/list]
Вопросы:
Как я могу применить стили специально для выхода кнопки pdf без влияния erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext erpnext. Выходы? и т. д. < /p>Я также прикрепил формат печати, чтобы понять применяемый CSS.[details="Print Format"]
.print-format table,
.print-format tr,
.print-format td {
font-family: serif;
line-height: 0.3 !important;
vertical-align: middle;
direction: rtl !important;
}
@media print {
body {
font-family: 'Cairo';
width: 220mm;
height: 297mm;
margin: 5mm 5mm 10mm 5mm;
footer {
page-break-after: always;
}
/* change the margins as you want them to be. */
}
}
@media screen {
.print-format {
width: 200mm;
padding: 5mm;
min-height: 297mm;
footer {
page-break-after: always;
}
}
}
table {
width: 100%;
white-space: nowrap;
}
th {
font-size: 10px;
color: black;
}
body:last-child .print-format td img {
width: 60% !important;
}
.ql-editor read-mode {
line-height: 1 !important;
}
.ql-editor p, .ql-editor h1, .ql-editor h2, .ql-editor h3, .ql-editor h4, .ql-editor h5, .ql-editor h6, .ql-editor span {
counter-reset: list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
line-height: 1.2;
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
display: inline-flex !important;
}
.print-format p {
margin: 3px 0px 3px;
display: inline-block !important;
}
.si {
color: darkblue !important;
margin-top: -5px !important;
}
.w1 {}
.w2 {
border-top: 3px solid #d1d8dd !important;
padding-top: 4px !important;
text-align: center;
direction: rtl;
margin-top: 15px;
}
@media print {
div.print-footer {
display:block !important;
position: fixed !important;
bottom: 0;
width: 97%;
background-color: white;
text-align: center;
padding: 2mm 2;
box-sizing: border-box;
page-break-after: always;
z-index: 9999;
}
div.print-footer .page-number {
position: absolute;
bottom: 5mm;
width: 100%;
text-align: center;
}
@page :first {
table:nth-of-type(4) tr:nth-child(n+10) {
page-break-after: always;
}
}
@page {
table tr:nth-child(28n+1) {
page-break-after: always;
}
}
}
* {
box-sizing: content-box !important;
}
body {
counter-reset: page;
}
/* Define a style for the page number */
.page-number:before {
counter-increment: page;
content: counter(page) " of "counter(pages);
}
window.onload = function() {
function insertPageBreaks(tableSelector, firstPageRows, nextPageRows) {
var tables = document.querySelectorAll(tableSelector);
tables.forEach(function(table) {
var rows = table.querySelectorAll('tr');
var rowCount = rows.length;
var currentPage = 1;
var rowsPerPage = currentPage === 1 ? firstPageRows : nextPageRows;
for (var i = rowsPerPage; i < rowCount; i += rowsPerPage) {
var pageBreakRow = document.createElement('tr');
pageBreakRow.className = 'page-break';
rows.parentNode.insertBefore(pageBreakRow, rows);
currentPage++;
rowsPerPage = nextPageRows;
}
});
}
insertPageBreaks('table:nth-of-type(4)', 23, 41);
insertPageBreaks('table:nth-of-type(n+5)', 41, 41);
};
{{ "TAX INVOICE" }}
{{ "فاتورة ضريبية " }}
{{ letter_head }}
{{ "رقم الفاتورة" }} :[/b]
{{ "تاريخ الفاتورة" }} :
{{ "رقم العقد " }} :
{{ "رقم أمر الشراء/الخدمة " }} :
{{ " تاريخ التوريد/الإنجاز " }} :
{{ "الرقم المرجعي " }} :
{{ "رمز البائع " }} :
{{ doc.name }}
{{ doc.get_formatted("posting_date") }}
{{ doc.custom_contract_number or "" }}
{{ doc.po_no or "" }}
{{ doc.delivery_date_and_time or "" }}
{{ doc.custom_rfx_number or "" }}
{{ doc.custom_vendor_no or "" }}
:{{ "Invoice No" }}
:{{ "Invoice Date" }}
:{{ "Contract Number" }}
:{{ "Order/Service No" }}
:{{ "Complet/Delivery Date" }}
:{{ " P.T.Ref" }}
:{{"Vender No " }}
{{ " Supplier " }}
{{ " المورد" }}
{{ "شركة الرواد الفنية للتجارة والمقاولات العامه المحدوده" }}
{{ "Trading & General Contracting Co. Ltd" }}
{{ "الرقم الضريبي" }}:
{{ doc.company_tax_id }}
:{{ "VAT ID" }}
ترخيص الموارد البشرية
85953
السجل التجاري (CR)
4030138666
التامينات الاجتماعية
511414695
{{ "العنوان" }}:
{{ frappe.db.get_value("Address", doc.company_address, "address_line1") or "" }}
{{ frappe.db.get_value("Address", doc.company_address, "address_in_arabic") or "" }}
:{{ "Address" }}
{{ " Customer " }}
{{ " العميل" }}
{{ doc.customer_name_in_arabic or "" }}
{{ doc.customer_name }}
{{ "الرقم الضريبي" }}:
{{ doc.tax_id or "" }}
:{{ "VAT ID" }}
{{ "رقم السجل التجاري"}}:
{{ frappe.get_doc("Customer", doc.customer).custom_company_cr or ""}}
:{{ "CR NO" }}
{{ "العنوان" }}:
{{ frappe.db.get_value("Address", doc.customer_address, "address_line1") or "" }}
{{ frappe.db.get_value("Address", doc.customer_address, "address_in_arabic") or "" }}
:{{ "Address" }}
{% set col = namespace(one = 2, two = 1) %} {% set length = doc.taxes | length %} {% set length = length / 2 | round %} {% set col.one = col.one + length %} {% set col.two = col.two + length %} {%- if(doc.taxes | length % 2 > 0 ) -%} {% set col.two =
col.two + 1 %} {% endif %}
{% set total = namespace(amount = 0) %}
S
م
Description
وصف المنتج
QTY
الكمية
Unit Price
سعر الوحدة
Taxable Amount
الاجمالي قبل الضريبة {% for row in doc.taxes %}
Tax Percentage
نسبة الضريبة
Tax Amount
مبلغ الضريبة {% endfor %}
Total With VAT
المجموع بالضريبة
{%- for item in doc.items -%} {% set total.amount = item.amount %}
{{ item.idx }}
{{ item.item_code }}
{{ item.qty }}
{{ item.get_formatted("rate") }}
{{ item.get_formatted("amount") }}
{% for row in doc.taxes %} {% set data_object = json.loads(row.item_wise_tax_detail) %} {% set key = item.item_code or item.item_name %} {% set taxable_amount = item.amount %} {% set tax_percentage = data_object[key][0] or 0 %} {% set tax_amount = taxable_amount
* (tax_percentage / 100) %} {% set total.amount = total.amount + tax_amount %}
{%- if data_object[key][0] -%} {{ frappe.format(data_object[key][0], {'fieldtype': 'Percent'}) }} {%- endif -%}
{% if data_object[key][0] %} {{ frappe.format_value(tax_amount, currency=doc.currency) }} {% endif %}
{% endfor %}
{{ frappe.format_value(frappe.utils.flt(total.amount, doc.precision('total_taxes_and_charges')), currency=doc.currency) }}
{{ item.description.replace('\n', ' ').replace('\r', '').replace('\t', '+').replace(' ', '+').strip() }}
{%- endfor -%}
{{ footer }}
[/details]< /code>
< /div>
< /div>
< /p>
оценил бы любое руководство от сообщества! Спасибо.
Подробнее здесь: https://stackoverflow.com/questions/795 ... ins-page-s