id: account.report_payment_receipt_document
<?xml version="1.0"?>
<t t-name="account.report_payment_receipt_document">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=lang)"/>
<div class="page" style="font-size: 12px;">
<div class="row justify-content-end" t-if="o.partner_type">
<h6 t-if="o.partner_type == 'customer'" class="border border-dark rounded p-2"><strong>Kuitansi Pembayaran</strong></h6>
<h6 t-if="o.partner_type == 'supplier'" class="border border-dark rounded p-2"><strong>Kuitansi Pembelian</strong></h6>
</div>
<!-- <h3><strong>Payment Receipt: <span t-field="o.name"/></strong></h3> -->
<div class="mb-4 mt-3">
<div class="row" style="margin-top: -13px;">
<div class="col-5" style="font-size: 11px;">
<div class="border border-dark rounded p-2" t-if="o.partner_type">
<t t-if="o.partner_type == 'customer'">
Received From <strong>Customer</strong> :
</t>
<t t-if="o.partner_type == 'supplier'">
Received From <strong>Vendor</strong> :
</t><span t-field="o.partner_id" t-options="{"widget": "contact", "fields": ["address", "name"],"no_marker": True}"/>
</div>
</div>
<div class="col-7" style="font-size: 11px;">
<div class="row">
<div class="col-4">
<div class="col-auto" t-if="o.date">
<span>Payment Date:</span>
<p t-field="o.date"/>
</div>
<div class="col-auto">
<span>Bank :</span>
<p t-field="o.partner_bank_id"/>
</div>
</div>
<div class="col-4">
<div class="col-auto">
<span>Form No :</span>
<p t-field="o.ref"/>
</div>
<div class="col-auto">
<span>Amount :</span>
<p t-field="o.amount" t-options="{'widget':'monetary', 'display_currency': o.currency_id}"/>
</div>
</div>
<div class="col-4">
<div class="col-auto">
<span>Currency :</span>
<p t-field="o.currency_id"/>
</div>
</div>
</div>
</div>
</div>
</div>
<table class="table table-sm border border-dark rounded p-2" style="margin-top: -15px;">
<thead>
<tr class="border-black">
<th><span>Invoice No</span></th>
<th><span>Invoice Date</span></th>
<th class="text-right"><span>Amount</span></th>
</tr>
</thead>
<tbody>
<t t-foreach="o.move_id._get_reconciled_invoices_partials()" t-as="rec">
<!-- MOVE -->
<t t-set="inv" t-value="rec[2].move_id"/>
<t t-if="inv.move_type != 'entry'">
<tr class="border-black">
<td><span t-field="inv.invoice_origin"/></td>
<td><span t-field="inv.invoice_date"/></td>
<td class="text-right"><span t-field="inv.amount_total"/></td>
</tr>
<!-- PAYMENTS/REVERSALS -->
<tr t-foreach="inv._get_reconciled_invoices_partials()" t-as="par" class="border-black">
<t t-set="amount" t-value="par[1]"/>
<t t-set="payment" t-value="par[2].move_id"/>
<td><span t-field="payment.name"/></td>
<td><span t-field="payment.date"/></td>
<td class="text-right">-<span t-esc="amount" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/></td>
</tr>
</t>
</t>
</tbody>
</table>
<div class="row" style="margin-top: -8px;">
<!-- KONTEN KIRI -->
<div class="col-7">
<div class="row">
<div class="col-12">
<div class="border border-dark" style="padding: 5px 5px; border-radius: 4px; font-size: 12px;">
<p id="amount_to_text">
<strong t-if="o.partner_id.lang == 'id_ID'">Terbilang :</strong>
<strong t-if="o.partner_id.lang == 'en_US'">Says :</strong>
<t t-esc="o.text_amount" t-esc-options="{"widget": "num2words","case":"capital"}"/>
</p>
</div>
</div>
</div><br/>
<div class="row" style="margin-top: -10px;">
<div class="col-6 text-center">
<p style="font-weight: bold;">Paid By</p><br/><br/><br/><br/><br/>
<hr witdh="100%" color="black"/>
<p style="margin-top: -10px" t-field="o.partner_id"/>
</div>
<div class="col-6 text-center">
<p style="font-weight: bold;">Received By</p><br/><br/><br/><br/><br/>
<hr witdh="100%" color="black"/>
<p style="margin-top: -10px" t-esc="user.name"/>
</div>
</div>
</div>
<!-- KONTEN KANAN -->
<div class="col-5 pull-right">
<table class="table table-sm border border-dark rounded p-2">
<tr t-if="inv.move_type != 'entry'" class="border-black">
<td>
<span>Total Owing</span>
</td>
<td>
<span>:</span>
</td>
<td class="text-right">
<span t-field="o.currency_id.symbol"/>
</td>
<td class="text-right">
<span t-esc="'{:,.2f}'.format(inv.amount_residual)"/>
</td>
</tr>
<tr class="border-black">
<td>
<strong><span>Total Payment</span></strong>
</td>
<td>
<strong>:</strong>
</td>
<td class="text-right">
<strong t-field="o.currency_id.symbol"/>
</td>
<td class="text-right">
<strong t-esc="'{:,.2f}'.format(o.amount_total)"/>
</td>
</tr>
<tr t-if="inv.move_type != 'entry'" class="border-black">
<td>
<span>Overpay</span>
</td>
<td>
<span>:</span>
</td>
<td class="text-right">
<span t-field="o.currency_id.symbol"/>
</td>
<td class="text-right">
<span t-esc="'{:,.2f}'.format(o.amount - amount)"/>
</td>
</tr>
</table>
</div>
</div>
</div>
</t>
</t>
Menampilkan Total Owing dan Overpay pada print
yang di harapkan:
kode sumber:
Penyelesaian:
Total owing:
inv.move_type != 'entry'
pelajari dari mana variable inv dan kenapa ini di lakukan logika ?<span t-esc="'{:,.2f}'.format(inv.amount_residual)"/>
tambahkan logika jikainv
tidak di temukan maka tampilkan - / 0 jika inv ditemukan tampilkan kode sesuai dengan program.Total Overpay:
amount
di lakukant-set
amount
maka tampilkan - / 0 jika terdapat maka tampilkan sesuai program