summernote
CI / Server (push) Failing after 46s

This commit is contained in:
dirga committed 2025-08-28 16:06:15 +07:00
1 parent 565aa348f9
commit 705e6f20e9
8 files changed
+485

No files matched your search

@@ -0,0 +1,109 @@
{# Payment Request message template - calculates VAT as contained-in-gross (amount included PPN) #}
<div style="font-family: Arial, sans-serif; font-size: 13px; line-height: 1.6; color: #000;">
{# helper: format number as Indonesian style 1.234.567,89 #}
{% macro rupiah(x) -%}
{%- set s = "{:,.2f}".format(x or 0) -%}
{{- s.replace(',', 'X').replace('.', ',').replace('X', '.') -}}
{%- endmacro %}
{# --- base amount (payment request amount) --- #}
{% set amount = (doc.grand_total or doc.amount or 0) | float %}
{# If amount is gross (includes 11% PPN), compute netto and ppn accordingly #}
{% set netto = (amount / 1.11) if amount else 0 %}
{% set ppn = amount - netto %}
{# determine quantity from reference doc (Sales Order) if available #}
{% set qty = 0 %}
{% if ref_doc %}
{% if ref_doc.total_qty %}
{% set qty = ref_doc.total_qty | float %}
{% else %}
{% for it in ref_doc.items %}
{% set qty = qty + (it.qty or 0) %}
{% endfor %}
{% endif %}
{% endif %}
{% if qty == 0 %}
{% set qty = 1 %}
{% endif %}
<style>
/* Atur ukuran font default seluruh dokumen */
body {
font-size: 9pt; /* bisa 9pt atau 8pt kalau masih terlalu besar */
}
/* Atur ukuran font untuk tabel */
table {
font-size: 8pt;
}
/* Judul (Faktur / Invoice) biar tetap lebih besar */
.print-heading {
font-size: 14pt;
font-weight: bold;
}
/* Terbilang lebih kecil */
.amount-in-words {
font-size: 7pt;
font-style: italic;
}
</style>
<table border="1" cellspacing="0" cellpadding="6" width="100%" style="border-collapse: collapse;">
<thead style="background-color: #f2f2f2;">
<tr>
<th style="text-align:center; width:5%;">No</th>
<th style="width:45%;">Nama Barang</th>
<th style="text-align:center; width:10%;">Banyaknya</th>
<th style="text-align:right; width:20%;">Harga Satuan</th>
<th style="text-align:right; width:20%;">Jumlah Satuan</th>
</tr>
</thead>
<tbody>
{# We use a single row representing the payment request amount (user can edit nama barang manual) #}
<tr>
<td style="text-align:center;">1</td>
<td>{{ ref_doc.items[0].item_name if ref_doc and ref_doc.items and ref_doc.items|length>0 else "Nama Barang / Uraian" }}</td>
<td style="text-align:center;">{{ qty | round(2) }}</td>
{# Per user request: Harga Satuan dan Jumlah Satuan = NETTO (amount without PPN) per design.
If you want Harga Satuan to show GROSS instead, change netto -> amount/qty below. #}
<td style="text-align:right;">
Rp {{ rupiah(netto) }}
</td>
<td style="text-align:right;">
Rp {{ rupiah(netto) }}
</td>
</tr>
<tr>
<td colspan="4" style="text-align:right;">Diskon</td>
<td style="text-align:right;">Rp {{ rupiah(0) }}</td>
</tr>
<tr>
<td colspan="4" style="text-align:right;">PPN 11%</td>
<td style="text-align:right;">Rp {{ rupiah(ppn) }}</td>
</tr>
<tr>
<td colspan="4" style="text-align:right; font-weight:bold;">Total</td>
<td style="text-align:right; font-weight:bold;">Rp {{ rupiah(amount) }}</td>
</tr>
</tbody>
</table>
<p style="margin-top:10px;">
Terbilang :
<b>{{ frappe.utils.money_in_words(amount, (doc.currency or "IDR")) }}</b>
</p>
<p style="margin-top:30px; text-align:right;">
Jakarta, {{ frappe.utils.formatdate(doc.transaction_date or frappe.utils.nowdate()) }}<br>Hormat kami,
</p>
</div>