Finally had some time to work on this and below instructions for printing on three (3) part check paper with address and detail of allocation. Probably not most elegant way, but better than the non-existent alternative provided as standard. Suggestions are welcome.
To accomplish requires 3 steps:
1 - create custom field (we used read only type) in Payment Entry doctype. We called address_display, but can use anything you want as long as matches custom script and custom print format
2 - include in Payment Entry custom script following function which is called on load and on change:
function AddressDisplay(cur_frm)
{
frappe.call({
method: "erpnext.accounts.party.get_party_details",
args:{'party':cur_frm.doc.party,'party_type':cur_frm.doc.party_type},
callback: function(ret) {
if(ret)
{
cur_frm.set_value("address_display",ret.message.address_display);
}
}
});
3 - here is Jinja custom format Print Format, don’t know why copy paste worked this time in maintaining indents:
.print-format {
padding: 0px;
}
@media screen {
.print-format {
padding: 0in;
}
}
<span style="top:15.5cm; left:1.5cm;
border-bottom: solid 0px;border-top:solid 0px; width:14cm;text-align: LEFT; position: absolute;">
{%- if (doc.total_allocated_amount == paid_amount) -%}
{%- endif -%}
</span>
<span style="top:0.5cm; left:15.9cm;
position: absolute;">
{{ frappe.utils.formatdate(doc.reference_date,'yyyy-MMM-dd') or '' }}
</span>
<span style="top:1.8cm;left: 1.0cm;
position: absolute; min-width: 6cm;">
{{ doc.party_name }}
</span>
<span style="top:4.0cm;left:1.5cm;
position: absolute; min-width: 6cm;">
{{ doc.account_no or '' }}
</span>
<span style="top:3.8cm;left: 1.0cm;
position: absolute; min-width: 6cm;">
{{ doc.party_name }}
<br>
{{ doc.address_display }}
</span>
<span style="top:6.2cm;left:0.8cm;position: absolute; min-width: 6cm;">
{{ frappe.db.get_value("Supplier", doc.party_name, "pan") or '' }}
</span>
<span style="top:2.6cm; left:0.1cm;
position: absolute; display: block; width: 15.0cm;
line-height:0.5cm; word-wrap: break-word;">
{{ frappe.utils.money_in_words(doc.paid_amount) }}
</span>
<span style="top:1.8cm;left: 16.2cm;
position: absolute; min-width: 4cm;">
{{ "{:,.2f}".format(doc.paid_amount) }}
</span>
<span style="top:8.6cm; left:1.0cm;
position: absolute;">
PAID TO: {{ doc.party_name }}
</span>
<span style="top:8.6cm; left:7.0cm;
position: absolute;">
CHECK DATE: {{ frappe.utils.formatdate(doc.reference_date,'yyyy-MMM-dd') or '' }}
</span>
<span style="top:8.6cm; left:13.0cm;
position: absolute;">
CHECK AMOUNT: {{ "${:,.2f}".format(doc.paid_amount) }}
</span>
<span style="top:9.2cm;left: 1.0cm;
position: absolute; min-width: 6.5in;">
<table style="table-layout:fixed;"><tr>
<th style="width:2.0in;text-align:left;">No</th>
<th style="width:1.5in;text-align:right;">Total</th>
<th style="width:1.5in;text-align:right;">Outstanding</th>
<th style="width:1.5in;text-align:right;">Allocated</th></tr>
{%- for row in doc.references -%}
<tr>
<td style="text-align:left;">{{ row.bill_no }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.total_amount) }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.outstanding_amount) }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.allocated_amount) }}</td>
</tr>
{%- endfor -%}
{%- if (doc.difference_amount > 0) -%}
<tr><td style="text-align:left;" colspan=3>ADVANCE</td><td style="text-align:right;">{{ "${:,.2f}".format(row.difference_amount) }}</td></tr>
{%- endif -%}
{%- for row in doc.deductions -%}
<tr>
<td colspan=3 style="text-align:left;">{{ row.account[6:-8] }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.amount) }}</td>
</tr>
{%- endfor -%}
</table>
</span>
<span style="top:17.5cm; left:1.0cm;
position: absolute;">
PAID TO: {{ doc.party_name }}
</span>
<span style="top:17.5cm; left:7.0cm;
position: absolute;">
CHECK DATE: {{ frappe.utils.formatdate(doc.reference_date,'yyyy-MMM-dd') or '' }}
</span>
<span style="top:17.5cm; left:13.0cm;
position: absolute;">
CHECK AMOUNT: {{ "${:,.2f}".format(doc.paid_amount) }}
</span>
<span style="top:18.1cm;left: 1.0cm;
position: absolute; min-width: 6.5in;">
<table style="table-layout:fixed;"><tr>
<th style="width:2.0in;text-align:left;">No</th>
<th style="width:1.5in;text-align:right;">Total</th>
<th style="width:1.5in;text-align:right;">Outstanding</th>
<th style="width:1.5in;text-align:right;">Allocated</th></tr>
{%- for row in doc.references -%}
<tr>
<td style="text-align:left;">{{ row.bill_no }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.total_amount) }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.outstanding_amount) }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.allocated_amount) }}</td>
</tr>
{%- endfor -%}
{%- if (doc.difference_amount > 0) -%}
<tr><td style="text-align:left;" colspan=3>ADVANCE</td><td style="text-align:right;">{{ "${:,.2f}".format(row.difference_amount) }}</td></tr>
{%- endif -%}
{%- for row in doc.deductions -%}
<tr>
<td colspan=3 style="text-align:left;">{{ row.account[6:-8] }}</td>
<td style="text-align:right;">{{ "${:,.2f}".format(row.amount) }}</td>
</tr>
{%- endfor -%}
</table>
</span>