تخصيص تنسيق الطباعة
تنسيقات الطباعة هي التخطيطات التي يتم إنشاؤها عندما تريد طباعة معاملة أو إرسالها بالبريد الإلكتروني.
هذه الميزة مفيدة لجميع المعاملات في BITEX مثل جميع معاملات البيع والشراء ومستندات HR وغير ذلك الكثير.
في BITEX، هناك ثلاثة أنواع من تنسيقات الطباعة، وهي تنسيق الطباعة القياسي وتنسيق الطباعة المخصص وتنسيق الطباعة HTML.
تنسيق الطباعة القياسي
سيكون لكل نوع مستند قابل للطباعة في BITEX تنسيق طباعة قياسي خاص به والذي يتم إنشاؤه بواسطة Frappe Framework. سيعتمد موضع الحقل في تنسيقات الطباعة القياسية على موضع الحقول المعنية في المستند.
Any changes made to the Standard Print Format will have to be done using a Customize Form. You can also checkout adding fields in Print Formats.
تنسيق الطباعة المخصص
You can also create your own custom Print Formats by using a tool called Print Format Builder. This tool will help you in making a simple Customized Print Format by dragging and dropping fields in a format as per your preference.
لإنشاء تنسيقات طباعة مخصصة، يأتي BITEX مزودًا بالعديد من القوالب المحددة مسبقًا في ثلاثة أنماط، وهي الحديثة وأحادية اللون والكلاسيكية.
لإنشاء إصداراتك، افتح قالبًا موجودًا من:
بناء > طرق العرض > تنسيق الطباعة
إعدادات الطباعة
لتحرير/تحديث إعدادات الطباعة وPDF، انتقل إلى:
الإعدادات > إعدادات الطباعة
تنسيق الطباعة HTML
لإنشاء تنسيق طباعة HTML، سوف تحتاج إلى بعض المعرفة بـ HTML، وCSS، وPython. فيما يلي مثال لكيفية تصميم تنسيق طباعة له تنسيق محدد للغاية.
Print Formats are provided on the server-side using the Jinja Templating Language. All forms have access to the doc object which contains information about the document that is being formatted. You can also access common utilities via the frappe module. To avail support when creating an HTML based print format, you can refer to BITEX Community forum, or start a new post for your query.
For styling, the Bootstrap CSS Framework is provided and you can enjoy the full range of classes.
المراجع
مثال
<h3>{{ doc.select_print_heading or "Invoice" }}</h3>
<div class="row">
<div class="col-md-3 text-right">Customer Name</div>
<div class="col-md-9">{{ doc.customer_name }}</div>
</div>
<div class="row">
<div class="col-md-3 text-right">Date</div>
<div class="col-md-9">{{ doc.get_formatted("invoice_date") }}</div>
</div>
{%- for row in doc.items -%}
{%- endfor -%}
<table class="table table-bordered">
<tbody>
<tr>
<th>Sr</th>
<th>Item Name</th>
<th>Description</th>
<th class="text-right">Qty</th>
<th class="text-right">Rate</th>
<th class="text-right">Amount</th>
</tr><tr>
<td style="width: 3%;">{{ row.idx }}</td>
<td style="width: 20%;">
{{ row.item_name }}
{% if row.item_code != row.item_name -%}
<br>Item Code: {{ row.item_code}}
{%- endif %}
</td>
<td style="width: 37%;">
<div style="border: 0px;">{{ row.description }}</div>
</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></tbody>
</table>
ملاحظات
- للحصول على القيم المنسقة للتاريخ والعملة، استخدم
doc.get_formatted("fieldname") - بالنسبة للسلاسل القابلة للترجمة، استخدم
{{ _("This string is translated") }}