Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- function addRow() {
- var table = document.getElementById("container");
- var heig = table.offsetHeight;
- var count = "{{ doc.entries|length }}";
- var rowCount = table.rows.length;
- var cont2 = document.getElementById("container2")
- var row = table.insertRow(rowCount);
- var cell1 = row.insertCell(0);
- var cell2 = row.insertCell(1);
- var cell3 = row.insertCell(2);
- var cell4 = row.insertCell(3);
- var cell5 = row.insertCell(4);
- var cell6 = row.insertCell(5);
- var controll = document.getElementById("test");
- controll = "1";
- if (heig < 560 ){
- row.className = "dontdo";
- cell1.innerHTML = "{{ item.idx }}";
- cell2.innerHTML = "{{ item.item_code }}";
- cell3.innerHTML = "{{ item.item_name }}<br>{{ item.item_description }}";
- cell4.innerHTML = "{{ item.qty }}";
- cell5.innerHTML = '{{ item.get_formatted("price_list_rate") }}{%- if item.discount_percentage -%}<br>- {{ item.discount_percentage }} %{%- endif -%}';
- cell6.innerHTML = '{{ item.get_formatted("amount") }}';
- controll.innerHTML = "1"
- }else if (heig > 560){
- if (controll == 1 ){
- cont2.innerHTML = '</table><br><br><br><br><br><br><table width="100%" id="container3"><thead style="border-top:1px solid #DDDDDD;border-bottom:1px solid #DDDDDD;"<tr><th width="5%">Pos.</b></th><th width="10%">Art. Nr.</b></th><th width="54%">Beschreibung</b></th><th width="7%" class="text-right">Menge</th><th width="12%" class="text-right">Preis</th><th width="12%" class="text-right">Gesamt</th></tr></thead>'
- var table2 = document.getElementById("container3");
- var rowCount2 = table2.rows.length;
- var row2 = table2.insertRow(rowCount2);
- var cell1_1 = row2.insertCell(0);
- var cell2_2 = row2.insertCell(1);
- var cell3_3 = row2.insertCell(2);
- var cell4_4 = row2.insertCell(3);
- var cell5_5 = row2.insertCell(4);
- var cell6_6 = row2.insertCell(5);
- row2.className = "break";
- cell1_1.innerHTML = "{{ item.idx }}";
- cell2_2.innerHTML = "{{ item.item_code }}";
- cell3_3.innerHTML = "{{ item.item_name }}<br>{{ item.item_description }}";
- cell4_4.innerHTML = "{{ item.qty }}";
- cell5_5.innerHTML = '{{ item.get_formatted("price_list_rate") }}{%- if item.discount_percentage -%}<br>- {{ item.discount_percentage }} %{%- endif -%}';
- cell6_6.innerHTML = '{{ item.get_formatted("amount") }}';
- controll.innerHTML = "2";
- }else if (controll == 2){
- var table2 = document.getElementById("container3");
- var rowCount2 = table2.rows.length;
- var row2 = table2.insertRow(rowCount2);
- var cell1_1 = row2.insertCell(0);
- var cell2_2 = row2.insertCell(1);
- var cell3_3 = row2.insertCell(2);
- var cell4_4 = row2.insertCell(3);
- var cell5_5 = row2.insertCell(4);
- var cell6_6 = row2.insertCell(5);
- row2.className = "dontdo";
- cell1_1.innerHTML = "{{ item.idx }}";
- cell2_2.innerHTML = "{{ item.item_code }}";
- cell3_3.innerHTML = "{{ item.item_name }}<br>{{ item.item_description }}";
- cell4_4.innerHTML = "{{ item.qty }}";
- cell5_5.innerHTML = '{{ item.get_formatted("price_list_rate") }}{%- if item.discount_percentage -%}<br>- {{ item.discount_percentage }} %{%- endif -%}';
- cell6_6.innerHTML = '{{ item.get_formatted("amount") }}';
- controll.innerHTML = "2";
- }
- }
- }
- </script>
- <!--
- cell1.innerHTML =;
- cell2.innerHTML = rowCount + 1;
- var cell3 = row.insertCell(2);
- -->
- <style>
- .print-format table, .print-format tr,
- .print-format td, .print-format div, .print-format p {
- font-family: Helvetica;
- line-height: 200%;
- vertical-align: middle;
- }
- .break
- {
- page-break-after: always;
- page-break-before: always;
- page-break-inside: avoid;
- border-top: none;
- border-bottom:1px solid #DDDDDD !important;
- }
- .dontdo
- {
- page-break-after: avoid;
- page-break-before: avoid;
- page-break-inside: avoid;
- border-top: none;
- border-bottom:1px solid #DDDDDD !important;
- }
- @media print and (width: 21cm) and (height: 29.7cm) {
- @page {
- margin: 2cm;
- }
- }
- </style>
- <!-- 560 px dürfen es sein -->
- <body class="abstand" onLoad="">
- <table width="100%">
- <tr>
- <td width="60%">
- <p style="line-height:145%;">{{ doc.customer_name }}<br>{{ doc.address_display }}<br>
- <div id="test" style="display:none;"></div>
- </p>
- </td>
- <td width="40%">
- <!-- Rechnungsnummer und so -->
- <table style="line-height:145%;" width="100%">
- <tr>
- <td width="50%">Rechnungsnr.</td>
- <td width="50%" style="text-align:right;">{{ doc.name }}</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <br><br>
- <table width="100%">
- <tr>
- <td width="50%">
- <div id="Rechnung">
- </div>
- <big><big><big><big>Rechnung</big></big></big></big>
- </td>
- <td width="50%" style="text-align:right; valign:top;">
- <b>Datum:</b> {{ doc.get_formatted("posting_date") }}<br>
- </td>
- </tr>
- </table>
- <br><br>
- <table class="" width="100%" id="container">
- <thead style="border-top:1px solid #DDDDDD;border-bottom:1px solid #DDDDDD;">
- <tr>
- <th width="5%">Pos.</b></th>
- <th width="10%">Art. Nr.</b></th>
- <th width="54%">Beschreibung</b></th>
- <th width="7%" class="text-right">Menge</th>
- <th width="12%" class="text-right">Preis</th>
- <th width="12%" class="text-right">Gesamt</th>
- </tr>
- </thead>
- {%- for item in doc.entries -%}
- <div onLoad="addRow()" id="container2">
- <!-- content goes here -->
- </div>
- {%- endfor -%}
- <!--<tr style="border-top: none; border-bottom:1px solid #DDDDDD !important;">
- <td>{{ item.idx }}</td>
- <td>
- {{ item.item_code }}
- </td>
- <td>{{ item.item_name }}<br>{{ item.description }}</td>
- <td class="text-right">{{ item.qty }}</td>
- <td class="text-right">{{ item.get_formatted("price_list_rate") }}{%- if item.discount_percentage -%}<br>- {{ item.discount_percentage }} %{%- endif -%}
- </td>
- <td class="text-right">{{ item.get_formatted("amount") }}</td>
- </tr>
- -->
- </table>
- <table width="100%" padding="0" margin="0">
- <tr>
- <td width="50%" style="padding:0px !important;">
- <br>
- <table width="100%">
- <tr>
- <td width="40%">Lieferbedingungen</td>
- <td width="60%">{{ doc.shipping_rule }}</td>
- </tr>
- <tr>
- <td width="40%">Zahlungsbedingungen</td>
- <td width="60%">{{ doc.mode_of_payment }}</td>
- </tr>
- <tr>
- <td width="40%">Fälligkeitsdatum</td>
- <td width="60%">{{ doc.due_date }}</td>
- </tr>
- </table>
- </td>
- <td width="50%" style="padding:0px !important;">
- <table width="100%">
- <tr>
- <td class="text-right" style="width: 70%">
- Zwischensumme
- </td>
- <td class="text-right">
- {{ doc.get_formatted("net_total_export") }}
- </td>
- </tr>
- {%- for row in doc.other_charges -%}
- {%- if row.included_in_print_rate -%}
- <tr style="border-bottom:1px solid #DDDDDD;">
- <td class="text-right" style="width: 70%">
- MwSt.
- </td>
- <td class="text-right">
- {{ row.get_formatted("tax_amount", doc) }}
- </td>
- <tr>
- {%- endif -%}
- {%- endfor -%}
- {%- if doc.discount_amount -%}
- <tr>
- <td class="text-right" style="width: 70%">
- Gesamtrabatt
- </td>
- <td class="text-right">
- {{ doc.get_formatted("discount_amount") }}
- </td>
- </tr>
- {%- endif -%}
- <tr>
- <td class="text-right" style="width: 70%">
- <b>Rechnungsbetrag</b>
- </td>
- <td class="text-right">
- {{ doc.get_formatted("grand_total_export") }}
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <p>{{ doc.terms or "" }}</p></body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement