From aa65822cc80133eb5ada8dba0e83d587e1f189de Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Sat, 9 Oct 2021 14:51:40 +0200 Subject: [PATCH] add print formats for erpnext --- erpnext/print-formats/print-style.css | 82 +++++++++++++ erpnext/print-formats/quotations.html | 164 ++++++++++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 erpnext/print-formats/print-style.css create mode 100644 erpnext/print-formats/quotations.html diff --git a/erpnext/print-formats/print-style.css b/erpnext/print-formats/print-style.css new file mode 100644 index 0000000..d7bf3c8 --- /dev/null +++ b/erpnext/print-formats/print-style.css @@ -0,0 +1,82 @@ +.print-format { + font-size: 12px; + background: white; +} + +.print-heading { + border-bottom: none; + padding-bottom: 5px; + margin-bottom: 10px; +} + +.print-format .letter-head { + margin-bottom: 30px; +} + +.print-format label { + font-weight: normal; + font-size: 13px; + color: #4C5A67; + margin-bottom: 0; +} + +.print-format .data-field { + margin-top: 0; + margin-bottom: 0; +} + +.print-format .value { + color: #192734; + line-height: 1.8; +} + +.print-format .section-break:not(:last-child) { + margin-bottom: 0; +} + +.print-format .row:not(.section-break) { + line-height: 1.6; + margin-top: 15px !important; +} + +.print-format .important .value { + font-size: 13px; + font-weight: 600; +} + +.print-format th { + color: #74808b; + font-weight: normal; + border-bottom-width: 1px !important; +} + +.print-format .table-bordered td, .print-format .table-bordered th { + border: 1px solid #f4f5f6; +} + +.print-format .table-bordered { + border: 1px solid #f4f5f6; +} + +.print-format .table-bordered thead { + text-transform: uppercase; + font-size: 8px; +} + +.print-format .table-sr { + display: none; +} + +.print-format td, .print-format th { + padding: 5px 10px !important; +} + +.print-format .primary.compact-item { + font-weight: normal; +} + +.print-format table td .value { + font-size: 12px; + line-height: 1.8; +} + diff --git a/erpnext/print-formats/quotations.html b/erpnext/print-formats/quotations.html new file mode 100644 index 0000000..36e77c6 --- /dev/null +++ b/erpnext/print-formats/quotations.html @@ -0,0 +1,164 @@ + + +
+ + + + + + +{% set customer = frappe.get_list('Customer', filters = { 'customer_name': doc.customer_name}, fields = ['tax_id', 'fiscal_code']) %} +{% set contacts = frappe.get_all('Dynamic Link', filters={'link_doctype': 'Customer', 'link_name': doc.customer_name, 'parenttype': 'Contact'}, fields=['parent']) %} +{% if customer %} +
VAT {{ customer[0].tax_id }}
+
F.C. {{ customer[0].fiscal_code }}
+{% endif %} + +{% if contacts %} +
+EMAIL +{% set break = false %} +{% for contact_id in contacts if not break %} + {% set contact = frappe.get_doc('Contact', contact_id.parent) %} + {% if contact.is_billing_contact %} + {{ contact.email_id }} + {% set break = true %} + {% endif %} +{% endfor %} + +
+{% endif %} + + +
RECIPIENT
+
{{ doc.customer_name }}
+{% set links = frappe.get_all('Dynamic Link', filters={'link_doctype': 'Customer', 'link_name': doc.customer_name, 'parenttype': 'Address'}, fields=['parent']) %} +{% if links %} +
+ {{frappe.db.get_value("Address", links[0].parent, "address_line1")}} +
+
+ {{frappe.db.get_value("Address", links[0].parent, "state_code")}} {{frappe.db.get_value("Address", links[0].parent, "city")}} ({{ frappe.db.get_value("Address", links[0].parent, "state") }}) +
+
+ {{frappe.db.get_value("Address", links[0].parent, "country")}} +
+{% endif %} + + + + + +
+ + + + + + +
+ + + + + +
PAYMENT TERMS
+{% set bank_account = frappe.get_doc('Bank Account', 'BANK NAME') %} +{% if bank_account %} +
IBAN: {{ bank_account.iban }}
+
Holder: {{ bank_account.company }}
+
Bank: {{ bank_account.bank }}
+{% endif %} +
+ + + + + +{% set quotation_items = doc.items %} +{% set total_without_stamp = [] %} +{% set stamp = [0] %} +{% for item in quotation_items %} + {% if item.item_name != 'MARCADABOLLO' %} + {% set __ = total_without_stamp.append(item.base_amount) %} + {% else %} + {% set __ = stamp.append(1) %} + {% endif %} +{% endfor %} +{% set total = ("€ %.2f"|format(total_without_stamp|sum)).replace('.', ',') %} + +
+
+ + + + + + + + + + + + + + + {% if (stamp|sum) > 0 %} + + + + + + {% endif %} + +
VAT SummaryTaxableTaxes
+ 0% - Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190/2014 e succ. modifiche/ integrazioni + {{ total }}€ 0,00
0% - Escluso Art. 152,00€ 0,00
+
+
+
Taxable {{ total }}
+ {% if (stamp|sum) > 0 %} +
Not taxable € 2,00
+ {% endif %} +

{{ ("€ %.2f"|format(doc.grand_total)).replace('.', ',') }}

+
+
+
+ + + + + +
+ +{% if not no_letterhead and footer %} +{{ footer }} +{% endif %} + +
+