ERPNext Eigene Formulare

Euch gefällt das generierte Formular Ausgangsrechnung oder Lieferscheine in ERPNext nicht? Ihr könnt das Formular mithilfe von Bootstrap ein eigenes Formular erstellen. Hier ein kleines Beispiel.

 · 3 min read

Bitte beachtet das dies nur kurze Informationen sind und Text und Layout nach und nach angepasst werden.


Eine kleine nicht perfekt Ausgangsrechnung.


{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}
   {% if letter_head and not no_letterhead %}
   <div class="letter-head">{{ letter_head }}</div>
   {% endif %}
{%- endmacro -%}
<div id="header-html" class="visible-pdf">
    {{ add_header(0,1,doc,letter_head, no_letterhead) }}
</div>
<div class="row">
   <div class="col-xs-offset-1 col-xs-8">
       {% set com = 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']) %}
       {{ com.name }}<br>
       {% if links %}
           {{frappe.db.get_value("Address", links[0].parent, "address_line1")}}<br>
           {{frappe.db.get_value("Address", links[0].parent, "pincode")}} {{frappe.db.get_value("Address", links[0].parent, "city")}}
       {% endif %}
   </div>
</div>
<div class="row" style="padding-top: 85px;">
   <div class="col-xs-offset-1 col-xs-4">
       {{ doc.customer_name }}<br>
       {{frappe.db.get_value("Address", doc.customer_address, "address_line1")}}<br>
       {% if frappe.db.get_value("Address", doc.customer_address, "address_line2") %}{{ frappe.db.get_value("Address", doc.customer_address, "address_line2") }}<br>{% endif -%}
       {% if frappe.db.get_value("Address", doc.customer_address, "pincode") %}{{ frappe.db.get_value("Address", doc.customer_address, "pincode") }} {% endif -%} {{ frappe.db.get_value("Address", doc.customer_address, "city") }}<br>
   </div>
   <div class="col-xs-7">
       <div class="row">
    <div class="col-xs-8 text-right"><strong>Rechnungsdatum:</strong></div>
    <div class="col-xs-4">{{ doc.get_formatted('posting_date') }}</div>
       </div>
   </div>
</div>
<div class="row" style="padding-top: 70px;">
</div>
<h3>{{ doc.select_print_heading or "Rechnung" }} {% if doc.status == "Draft" -%}{{ doc.get_formatted('status') }}{% else %}{{ doc.name }}{%- endif %}</h3><br>

   {% if doc.po_no %}
   <div class="row">
    <div class="col-md-12">{{ doc.po_no }}
    </div>
   </div>
   {% endif %}
<div class="page">
   <table class="table table-bordered" style="padding-top: 60px;">
       <thead>
           <tr>
        <th rowspan="2">#</th>
        <th colspan="4">Buchungstext</th>
    </tr>
           <tr>
        <th class="text-right">Menge</th>
        <th class="text-right">Rabatt</th>
        <th class="text-right">Preis/ME</th>
        <th class="text-right">Betrag</th>
    </tr>
       </thead>
       <tbody>
    {%- for row in doc.items -%}
    <tr>
        <td style="width: 4%;" rowspan="2">{{ row.idx }}</td>
        <td colspan="4" style='word-wrap:break-word;'>{{ row.description }}</td>
    </tr>
    <tr>
        <td style="width: 56%; text-align: right;">{{ row.get_formatted("qty", doc) }} {{ row.uom or row.stock_uom }}</td>
        <td style="width: 13%; text-align: right;"> {% if row.discount_percentage != 0 -%}{{ row.get_formatted("discount_percentage", doc) }}{%- endif %}</td>
        <td style="width: 13%; text-align: right;">{{ row.get_formatted("rate", doc) }}</td>
        <td style="width: 14%; text-align: right;">{{ row.get_formatted("amount", doc) }}</td>
    </tr>
    {%- endfor -%}
       </tbody>
       <tfoot>
       {% if doc.taxes %}
    <tr>
        <td style="border:none" colspan="2"></td>
        <td style="text-align: right;" colspan="2">Nettosumme:</td>
        <td style="text-align: right;">{{ doc.get_formatted("net_total") }}</td>
    </tr>
    {%- for tax in doc.taxes -%}
    <tr>
        <td style="border:none" colspan="2"></td>
        <td style="text-align: right;" colspan="2">MwSt. {{ tax.get_formatted("rate", doc) }}%:</td>
        <td style="text-align: right;">{{ tax.get_formatted("tax_amount_after_discount_amount", doc) }}</td>
    </tr>
    {%- endfor -%}
       {% endif %}
    <tr>
        <td style="border:none" colspan="2"></td>
        <td style="text-align: right;" colspan="2"><b>Gesamtsumme:</b></td>
        <td style="text-align: right;"><b>{{ doc.get_formatted("base_grand_total") }}</b></td>
    </tr>
    {% if is_discounted %}
    <tr>
        <td style="text-align: right;" colspan="4">enthaltener Positionsrabatt:</td>
        <td style="text-align: right;">{{ doc.get_formatted("") }}</td>
    </tr>
    {% endif %}
       </tfoot>
   </table>
   <div class="row">
    <div class="col-md-12">Wenn nicht anderweitig angegeben entspricht das Leistungsdatum dem Rechnungsdatum.
    </div>
   </div>
   {% if not doc.taxes %}
   <div class="row">
    <div class="col-md-12">Es wird gemäß §19 Abs. 1 Umsatzsteuergesetz keine Umsatzsteuer erhoben.
    </div>
   </div>
   {% endif %}
   
   <div class="row" style="padding-top: 30px;">
    {%- for pays in doc.payment_schedule -%}
    <div class="col-md-12">Zahlungsziel: {{ pays.description }} {{ pays.get_formatted("due_date", doc) }}
    </div>
    {%- endfor -%}
   </div>
</div>
<div>
   <div id="footer-html" class="visible-pdf">
{% if not no_letterhead and footer %}
 <div class="letter-head-footer">
  {{ footer }}
 </div>
{% endif %}
</div>

No comments yet.

Einen Kommentar hinzufügen
"Strg + Enter" um Kommentar hinzuzufügen