165 lines
5.5 KiB
HTML
165 lines
5.5 KiB
HTML
|
<!-- HEADING SECTION -->
|
||
|
<div class="print-heading row">
|
||
|
<div class="col-xs-4">
|
||
|
<a href=""> <img src="" alt="logo" style="font-family: 'Oxygen', 'Helvetica Neue', 'Arial', 'sans-serif' !important;max-width: 600px;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;border: none;"></a>
|
||
|
</div>
|
||
|
<div class="col-xs-8 text-right">
|
||
|
{% set u_company = frappe.get_doc('Company', doc.company) %}
|
||
|
{% set links = frappe.get_all('Dynamic Link', filters={'link_doctype': 'Company', 'link_name': doc.company, 'parenttype': 'Address'}, fields=['parent']) %}
|
||
|
<div class="strong">{{ doc.company }}</div>
|
||
|
{% if links %}
|
||
|
<div>
|
||
|
|
||
|
{{frappe.db.get_value("Address", links[0].parent, "address_line1")}} -
|
||
|
{{frappe.db.get_value("Address", links[0].parent, "pincode")}} -
|
||
|
{{frappe.db.get_value("Address", links[0].parent, "city")}}
|
||
|
{% set province = frappe.db.get_value("Address", links[0].parent, "state") %}
|
||
|
{% if province %}
|
||
|
({{ province }})
|
||
|
{% endif %}
|
||
|
|
||
|
</div>
|
||
|
{% endif %}
|
||
|
VAT: {{ u_company.tax_id }} - F.C.: {{ u_company.fiscal_code }}
|
||
|
<br>
|
||
|
<div class="h5"><strong>QUOTATION</strong> nr. <strong>{{ doc.name }}</strong> of <strong>{{ frappe.utils.formatdate(doc.get('transaction_date'),"dd-mm-yyyy") }}</strong></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr>
|
||
|
<!-- END SECTION -->
|
||
|
|
||
|
|
||
|
|
||
|
<!-- SECTION 2 COLUMNS -->
|
||
|
<!-- FIRST COLUMN -->
|
||
|
{% 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 %}
|
||
|
<div><strong>VAT</strong> {{ customer[0].tax_id }}</div>
|
||
|
<div><strong>F.C.</strong> {{ customer[0].fiscal_code }}</div>
|
||
|
{% endif %}
|
||
|
|
||
|
{% if contacts %}
|
||
|
<div>
|
||
|
<strong>EMAIL </strong>
|
||
|
{% 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 %}
|
||
|
|
||
|
</div>
|
||
|
{% endif %}
|
||
|
|
||
|
<!-- SECOND COLUMN -->
|
||
|
<div><small>RECIPIENT</small></div>
|
||
|
<div><strong>{{ doc.customer_name }}</strong></div>
|
||
|
{% set links = frappe.get_all('Dynamic Link', filters={'link_doctype': 'Customer', 'link_name': doc.customer_name, 'parenttype': 'Address'}, fields=['parent']) %}
|
||
|
{% if links %}
|
||
|
<div>
|
||
|
{{frappe.db.get_value("Address", links[0].parent, "address_line1")}}
|
||
|
</div>
|
||
|
<div>
|
||
|
{{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") }})
|
||
|
</div>
|
||
|
<div>
|
||
|
{{frappe.db.get_value("Address", links[0].parent, "country")}}
|
||
|
</div>
|
||
|
{% endif %}
|
||
|
<!-- END SECTION -->
|
||
|
|
||
|
|
||
|
|
||
|
<!-- SECTION 1 COLUMN -->
|
||
|
<hr>
|
||
|
<!-- END SECTION -->
|
||
|
|
||
|
|
||
|
|
||
|
<!-- SECTION 1 COLUMN -->
|
||
|
<!-- ADD ITEMS (TABLE): Description, Amount, Tax Amount -->
|
||
|
<hr>
|
||
|
<!-- END SECTION -->
|
||
|
|
||
|
|
||
|
|
||
|
<!-- SECTION 1 COLUMN -->
|
||
|
<div><small>PAYMENT TERMS</small></div>
|
||
|
{% set bank_account = frappe.get_doc('Bank Account', 'BANK NAME') %}
|
||
|
{% if bank_account %}
|
||
|
<div>IBAN: <strong>{{ bank_account.iban }}</strong></div>
|
||
|
<div>Holder: <strong>{{ bank_account.company }}</strong></div>
|
||
|
<div>Bank: <strong>{{ bank_account.bank }}</strong></div>
|
||
|
{% endif %}
|
||
|
<hr>
|
||
|
<!-- END SECTION -->
|
||
|
|
||
|
|
||
|
|
||
|
<!-- SECTION 1 COLUMN -->
|
||
|
{% 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('.', ',') %}
|
||
|
|
||
|
<div class="row" style="margin-top: 0">
|
||
|
<div class="col-xs-7" style="border-right: 1px solid #ddd;">
|
||
|
<table class="table table-borderless table-condensed">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>VAT Summary</th>
|
||
|
<th class="text-right" width=100>Taxable</th>
|
||
|
<th class="text-right" width=75>Taxes</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td>
|
||
|
0% - <span class="font-italic">Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190/2014 e succ. modifiche/ integrazioni</span>
|
||
|
</td>
|
||
|
<td class="text-right">{{ total }}</td>
|
||
|
<td class="text-right">€ 0,00</td>
|
||
|
</tr>
|
||
|
{% if (stamp|sum) > 0 %}
|
||
|
<tr>
|
||
|
<td>0% - <span class="font-italic">Escluso Art. 15</span></td>
|
||
|
<td class="text-right">2,00</td>
|
||
|
<td class="text-right">€ 0,00</td>
|
||
|
</tr>
|
||
|
{% endif %}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="col-xs-5 text-right">
|
||
|
<div>Taxable {{ total }}</div>
|
||
|
{% if (stamp|sum) > 0 %}
|
||
|
<div>Not taxable € 2,00</div>
|
||
|
{% endif %}
|
||
|
<h1>{{ ("€ %.2f"|format(doc.grand_total)).replace('.', ',') }}</h1>
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr>
|
||
|
<!-- END SECTION -->
|
||
|
|
||
|
|
||
|
|
||
|
<!-- SECTION 1 COLUMN -->
|
||
|
<div class="col-xs-12">
|
||
|
|
||
|
{% if not no_letterhead and footer %}
|
||
|
{{ footer }}
|
||
|
{% endif %}
|
||
|
|
||
|
</div>
|
||
|
<!-- END SECTION -->
|