Conversation
|
can you please explain what should I do in this task?
|
|
@viralkansodiya For this task, I'll move it into its own ticket. It involves adding some dependencies. |
|
@viralkansodiya I am getting a Content Not Found Error that's coming from one or both of the print formats. Can you take a look at this? |
|
@agritheory I hope you are testing this print preview PR in version 14 |
@agritheory can you send me some more details? or if we can connect on call, so I can fix it quickly. |
* remove print Get pdf * fetch all payment entry preview in one single preview * override a print button * print page breake issue resolve * print on specific url * fix: Url of print * PDF Button override * on draft stage only allow check run default print format * on draft stage only allow check run default print format * if check run in draft then print should show msg * remove unrelevent controll * ci: track overrides por Payment Entry (#248) * on change of doctype change list of print format * change the preview and print view on change of selcted options * render pdf base on selected print_sel * create new print format 'Check Run' * remove standard formats * added a background image in check format * set the size of check format background image * back ground image only allow in print not in pdf * Confirm print pop up * Secondary print format added * remove background image in pdf * reformat by pre-commit * Change syntex * closed the window after action on print window --------- Co-authored-by: Francisco Roldán <franciscoproldan@gmail.com>
a0128e9 to
b0fc0a8
Compare
|
@viralkansodiya I was able to solve the content not found issue. Please update the "Example Voucher" print format so that it is sensitive to overflow (secondary print format feature), this is the comma separated list of source documents. |
|
@agritheory example voucher is already there in my pull request |
|
@agritheory this should be close. I wasn't sure what to add for the no-print background image. Latest commits include:
Potentially outstanding:
|
|
Refactored the print format selection to a dynamic link |
|
Latest push fixes a couple things, but here are a few observations in testing this:
The latest change with the page break at the end of the print format seems to conform the preview and actual PDF page breaks, but I'm only testing when the Check Run Setting secondary print format field is blank. |
|
@agritheory - just reviewed this again - should be good to go. The new condition to render references as a list (if the Check Run Settings has a secondary print format set) gets rid of the overflow problem. I made one small tweak in latest commits to cover the case where if the number of references in the Payment Entry is > 6 (regardless of the Secondary Print Format value in CR Settings), then it renders as a comma-separated list, too. I used 6 because that's what the preview page real estate seemed to max out at before there were the overflow issues. |
So I'm reusing the background image field in Check Run Settings, which will allow importing any attached image there into a Print Format for display. For the PS: I've also added a commit that will fix the background image display in Example Voucher, but I'm not sure if that was intentionally set that way? |
Print Format Changes DiffDiff for check_run/check_run/print_format/check_run/check_run.json: --- /dev/fd/63 2025-06-11 17:48:26.177526948 +0000
+++ /dev/fd/62 2025-06-11 17:48:26.177526948 +0000
@@ -1 +1,80 @@
+<div id="header-html" class="hidden-pdf">
+ <div class="print-heading">
+ <h2>
+ <div>Check Run</div>
+ <small class="sub-heading">ACC-CR-2024-00001</small>
+ </h2>
+ </div>
+</div>
+<div class="container_">
+ <div class="box">
+ <p>Check Run End Date:</p>
+ <b>{{doc.end_date or ''}}</b>
+ </div>
+ <div class="box">
+ <p>Initial Check Number:</p>
+ <b>{{ doc.initial_check_number}}</b>
+ </div>
+ <div class="box">
+ <p>Company</p>
+ <b>{{ doc.company }}</b>
+ </div>
+</div>
+<div class="container_">
+ <div class="box">
+ <p>Posting Date:</p>
+ <b>{{doc.posting_date or ''}}</b>
+ </div>
+ <div class="box">
+ <p>Final Check Number:</p>
+ <b>{{ doc.final_check_number }}</b>
+ </div>
+ <div class="box">
+ <p>Paid From (Bank Account):</p>
+ <b>{{ doc.bank_account }}</b>
+ </div>
+</div>
+<div class="container_">
+ <div class="box">
+ <p>Beginning Bank Account Balance:</p>
+ <b>{{frappe.format(doc.beg_balance,{'fieldtype':"Currency"} ) or ''}}</b>
+ </div>
+ <div class="box">
+ <p>Amount in Check Run</p>
+ <b>{{frappe.format(doc.amount_check_run ,{'fieldtype':"Currency"} ) or ''}}</b>
+ </div>
+ <div class="box">
+ <p>Accounts Payable:</p>
+ <b>{{ doc.pay_to_account }}</b>
+ </div>
+</div>
+{% set pe_list = frappe.db.get_list("Payment Entry", {"check_run":doc.name}) %}
+<table width="100%" border=1>
+ <tbody>
+ <tr>
+ <th>Party</th>
+ <th>Document</th>
+ <th>Document Date</th>
+ <th>Outstanding Amount</th>
+ <th>Due Date</th>
+ <th>Reference</th>
+ </tr>
+
+ {% for row in pe_list %}
+ {% set doc_ = frappe.get_doc("Payment Entry", row.name) %}
+ {% for d in doc_.references %}
+ <tr>
+ <td>{{ doc_.party }}</td>
+ <td>{{ d.reference_name }}</td>
+ <td>{{ frappe.db.get_value(d.reference_doctype, d.reference_name, "posting_date") or ''}}</td>
+ <td>{{ doc_.paid_amount or '' }}</td>
+ <td>{{ frappe.db.get_value(d.reference_doctype, d.reference_name, "due_date") or '' }}</td>
+ <td>{{ doc_.name }}</td>
+ </tr>
+ {% endfor %}
+ {% endfor %}
+ </tbody>
+</table>
+
+ Diff for check_run/check_run/print_format/example_secondary_print_format/example_secondary_print_format.json: --- /dev/fd/63 2025-06-11 17:48:26.186527119 +0000
+++ /dev/fd/62 2025-06-11 17:48:26.186527119 +0000
@@ -1,36 +1,44 @@
-<table class="table table-responsive-sm">
- <tr>
- <td colspan="4">
- Cheque Number: {{ doc.reference_no or '' }}
- </td>
- </tr>
- <tr>
- <td colspan="2">{{doc.party_name}}</td>
- <td> {{ frappe.utils.formatdate(doc.reference_date) or '' }} </td>
- <td style="text-align:right;" colspan="2"> {{doc.get_formatted("base_paid_amount")}} </td>
- <tr>
- <th> Date </th>
- <th style="text-align:left;"> Reference </th>
- <th style="text-align:center;"> Amount </th>
- <th style="text-align:right;"> Payment </th>
- </tr>
- {% for reference in doc.references %}
- <tr>
- {% if reference.reference_doctype == 'Purchase Invoice' %}
- <td>{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_date")) or ""}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_no") or "" }}</td>
- {% elif reference.reference_doctype == 'Sales Invoice' %}
- <td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_date")) or ""}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_no") or "" }}</td>
- {% elif reference.reference_doctype == 'Expense Claim' %}
- <td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or " "}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }}</td>
- {% elif reference.reference_doctype == 'Journal Entry' %}
- <td style="text-align:left;"> {{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or " "}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }}</td>
- {% endif %}
- <td style="text-align:center;"> {{ frappe.utils.fmt_money(reference.get_formatted('total_amount'), 2, 'USD')}}</td>
- <td style="text-align:right;"> {{ reference.get_formatted('allocated_amount')}}</td>
- </tr>
- {% endfor %}
+{% set checkrun = frappe.get_doc("Check Run", doc.check_run) %}
+{% set checkrunsetting = frappe.db.get_list("Check Run Settings", {"bank_account": checkrun.bank_account, "pay_to_account": checkrun.pay_to_account , "company": checkrun.company}) %}
+{% set crs_doc = frappe.get_doc("Check Run Settings", checkrunsetting[0]) %}
+{% set printable_mop = frappe.db.get_list("Check Run Printable MOP", {"parent": crs_doc.name}, "mode_of_payment", pluck="mode_of_payment") %}
+
+{% if doc.mode_of_payment in printable_mop %}
+<table class="table table-responsive-sm">
+ <tr>
+ <td colspan="4">
+ Check Number: {{ doc.reference_no or '' }}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">{{doc.party_name}}</td>
+ <td> {{ frappe.utils.formatdate(doc.reference_date) or '' }} </td>
+ <td style="text-align:right;"> {{doc.get_formatted("base_paid_amount")}} </td>
+ </tr>
+ <tr>
+ <th> Date </th>
+ <th style="text-align:left;"> Reference </th>
+ <th style="text-align:center;"> Amount </th>
+ <th style="text-align:right;"> Payment </th>
+ </tr>
+ {% for reference in doc.references %}
+ <tr>
+ {% if reference.reference_doctype == 'Purchase Invoice' %}
+ <td>{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_date")) or ""}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_no") or "" }}</td>
+ {% elif reference.reference_doctype == 'Sales Invoice' %}
+ <td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_date")) or ""}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_no") or "" }}</td>
+ {% elif reference.reference_doctype == 'Expense Claim' %}
+ <td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or " "}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }}</td>
+ {% elif reference.reference_doctype == 'Journal Entry' %}
+ <td style="text-align:left;"> {{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or " "}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }}</td>
+ {% endif %}
+ <td style="text-align:center;"> {{ frappe.utils.fmt_money(reference.get_formatted('total_amount'), 2, 'USD')}}</td>
+ <td style="text-align:right;"> {{ frappe.utils.fmt_money(reference.get_formatted('allocated_amount'), 2, 'USD')}}</td>
+ </tr>
+ {% endfor %}
</table>
+{% endif %}Diff for check_run/check_run/print_format/example_voucher/example_voucher.json: --- /dev/fd/63 2025-06-11 17:48:26.195527290 +0000
+++ /dev/fd/62 2025-06-11 17:48:26.195527290 +0000
@@ -1,136 +1,156 @@
-<div style="position: relative; top:0.0cm">
- <div id="check_section_1" >
- {% if doc.docstatus == 0 %}
- <span class="stamp right_stamp is-draft">VOID DRAFT</span>
- <span class="stamp sig_stamp is-draft">VOID DRAFT</span>
- {% elif doc.docstatus == 2 or overwrite_void %}
- <span class="stamp right_stamp is-nope">VOID</span>
- <span class="stamp sig_stamp is-nope">VOID</span>
- <span class="stamp big_stamp is-nope">VOID</span>
- {% endif %}
- <div id="payer_check_window_block" class="test_lines">
- <span id= "payer_name_block">
- {{ doc.company }}
- </span>
- </div>
- <span id="check_date_block" style="top:2.0cm; left:17.0cm;
- position: absolute;">
- {{ doc.get_formatted('posting_date') }}
- </span>
- <span id="payee_name_block" style="top:3.2cm;left: 2.8cm;
- position: absolute; min-width: 6cm;">
- {{ doc.party_name }}
- </span>
- <span id="payee_address_window_block" class="test_lines" >
- <div id="address_block">
- {{ doc.party_name }} <br>
- {% set address = get_default_address(doc.party_type, doc.party) %}
- {% if address %}
- {{ frappe.get_doc('Address', address).get_display() }}
- {% endif %}
- </div>
- </span>
- <span id="payment_amount_number_block">
- {% set money_number = doc.get_formatted('paid_amount')[1:].strip() %}
- {% if money_number|length < 18 %}
- {% set money_number = ( money_number + '***************************')[:18] %}
- {% endif %}
- {{ money_number }}
- </span>
- <span id="payment_in_words_block" style="top:4.05cm; left:2.8cm;
- position: absolute; display: block; width: 16.5cm;
- line-height:0.5cm; word-wrap: break-word;">
- {% set money_in_words = frappe.utils.money_in_words(doc.paid_amount)[:-5] %}
- {% if money_in_words|length < 90 %}
- {% set money_in_words = (money_in_words + '************************************************************************')[:100] %}
- {% endif %}
- {{ money_in_words }}
- </span>
- <span id="memo_block" class="test_lines">
- {{ doc.check_memo or '' }} {% if test_lines %} MEMO {% endif %}
- </span>
- <span id="signature_block" style="top:6.3cm;left: 13.8cm;
- position: absolute; min-width: 6cm;">
- SIGNATURE
- </span>
- <span id="check_number_block" style="top:7.9cm;left:4.3cm;
- position: absolute; min-width: 1.5cm;">
- CHECK#
- </span>
- <span id="account_number_block" style="top:7.9cm;left:7.15cm;
- position: absolute; min-width: 6cm;">
- ACCOUNT NUMBER {{ doc.account_no or '' }}
- </span>
- <span id="routing_number_block" style="top:7.9cm;left:12cm;
- position: absolute; min-width: 6cm;">
- ROUTING_NUMBER
- </span>
- </div>
-</div>
-{% set number_of_invoice = frappe.db.get_value("Check Run Settings", {'bank_account':doc.bank_account,'company':doc.company}, ['number_of_invoices_per_voucher']) %}
-
-{% for i in range(0,2) %}
-{% if i == 0 %}
-<div id="check_section_2" class="test_lines" style="top:9cm;">
-{% endif %}
-{% if i == 1 and not doc.references|length >= number_of_invoice %}
-<div id="check_section_3" class="test_lines" style="top:17.8cm;">
- {% endif %}
-{% if i == 1 and doc.references|length >= number_of_invoice %}
-<div id="check_section_3" class="test_lines" style="top:14cm;">
- {% endif %}
- <div class="payment_reference_block" >
- <table class="table table-responsive-sm">
- <tr>
- <td colspan="2">{{doc.party_name}}</td>
- <td> {{ frappe.utils.formatdate(doc.reference_date) or '' }} </td>
- <td style="text-align:right;" colspan="2"> {{doc.get_formatted("base_paid_amount")}} </td>
- </tr>
- {% if doc.references|length >= number_of_invoice %}
- <tr>
- <td colspan ="4">
- {% for reference in doc.references %}
- {% if reference.reference_doctype == 'Purchase Invoice' %}
- {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_no") or ""}},
- {% elif reference.reference_doctype == 'Sales Invoice' %}
- {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_no") or "" }},
- {% elif reference.reference_doctype == 'Expense Claim' %}
- {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }},
- {% elif reference.reference_doctype == 'Journal Entry' %}
- {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }},
- {% endif %}
- {% endfor %}
- </td>
- </tr>
- {% else %}
- <tr>
- <th> Date </th>
- <th style="text-align:left;"> Reference </th>
- <th style="text-align:center;"> Amount </th>
- <th style="text-align:right;"> Payment </th>
- </tr>
-
- {% for reference in doc.references %}
- <tr>
- {% if reference.reference_doctype == 'Purchase Invoice' %}
- <td>{{i }}{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_date")) or ""}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_no") or "" }}</td>
- {% elif reference.reference_doctype == 'Sales Invoice' %}
- <td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_date")) or ""}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_no") or "" }}</td>
- {% elif reference.reference_doctype == 'Expense Claim' %}
- <td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or " "}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }}</td>
- {% elif reference.reference_doctype == 'Journal Entry' %}
- <td style="text-align:left;"> {{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or " "}}</td>
- <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or " " }}</td>
- {% endif %}
- <td style="text-align:center;"> {{ frappe.utils.fmt_money(reference.get_formatted('total_amount'), 2, 'USD')}}</td>
- <td style="text-align:right;"> {{ frappe.utils.fmt_money(reference.get_formatted('allocated_amount'), 2, doc.paid_from_account_currency) }}</td>
- </tr>
- {% endfor %}
- {% endif %}
- </table>
- </div>
-</div>
-{% endfor %}
+{% set checkrun = frappe.get_doc("Check Run", doc.check_run) %}
+{% set checkrunsetting = frappe.db.get_list("Check Run Settings", {"bank_account": checkrun.bank_account,
+"pay_to_account": checkrun.pay_to_account , "company": checkrun.company}) %}
+{% set crs_doc = frappe.get_doc("Check Run Settings", checkrunsetting[0]) %}
+{% set printable_mop = frappe.db.get_list("Check Run Printable MOP", {"parent": crs_doc.name}, "mode_of_payment",
+pluck="mode_of_payment") %}
+{% set pdf_page_size = frappe.db.get_value("Print Settings", "Print Settings", "pdf_page_size") %}
+
+{% if doc.mode_of_payment in printable_mop %}
+<style
+ style="min-height: {{11 if pdf_page_size == 'Letter' else 11.69}}in; min-width: {{8.5 if pdf_page_size == 'Letter' else 8.27}}in">
+ .print-format {
+ background-image: url({{crs_doc.background_image or ''}});
+ }
+</style>
+
+<div class="back_image">
+ <div style="position: relative; top:0.0cm">
+ <div id="check_section_1">
+ {% if doc.docstatus == 0 %}
+ <span class="stamp right_stamp is-draft">VOID DRAFT</span>
+ <span class="stamp sig_stamp is-draft">VOID DRAFT</span>
+ {% elif doc.docstatus == 2 or overwrite_void %}
+ <span class="stamp right_stamp is-nope">VOID</span>
+ <span class="stamp sig_stamp is-nope">VOID</span>
+ <span class="stamp big_stamp is-nope">VOID</span>
+ {% endif %}
+
+ <div id="payer_check_window_block" class="test_lines">
+ <span id="payer_name_block">
+ {{ doc.company }}
+ </span>
+ </div>
+ <span id="check_date_block" style="top:2.0cm; left:16.0cm;
+ position: absolute;">
+ {{ doc.get_formatted('posting_date') }}
+ </span>
+
+ <span id="payee_name_block" style="top:3.2cm;left: 2.8cm;
+ position: absolute; min-width: 6cm;">
+ {{ doc.party_name }}
+ </span>
+
+ <span id="payee_address_window_block" class="test_lines">
+ <div id="address_block">
+ {{ doc.party_name }} <br>
+ {% set address = get_default_address(doc.party_type, doc.party) %}
+ {% if address %}
+ {{ frappe.get_doc('Address', address).get_display() }}
+ {% endif %}
+ </div>
+ </span>
+
+ <span id="payment_amount_number_block">
+ {% set money_number = doc.get_formatted('paid_amount')[1:].strip() %}
+
+ {% if money_number|length < 18 %} {% set money_number=( money_number + '***************************'
+ )[:18] %} {% endif %} {{ money_number }} </span>
+
+ <span id="payment_in_words_block" style="top:4.05cm; left:2.8cm;
+ position: absolute; display: block; width: 16.5cm;
+ line-height:0.5cm; word-wrap: break-word;">
+ {% set money_in_words = frappe.utils.money_in_words(doc.paid_amount)[:-5] %}
+ {% if money_in_words|length < 90 %} {% set money_in_words=(money_in_words
+ + '************************************************************************' )[:100] %} {%
+ endif %} {{ money_in_words }} </span>
+
+ <span id="memo_block" class="test_lines">
+ {{ doc.check_memo or '' }} {% if test_lines %} MEMO {% endif %}
+ </span>
+
+ <span id="signature_block" style="top:6.3cm;left: 13.8cm;
+ position: absolute; min-width: 6cm;">
+ SIGNATURE
+ </span>
+
+ <span id="check_number_block" style="top:7.9cm;left:4.3cm;
+ position: absolute; min-width: 1.5cm;">
+ CHECK#
+ </span>
+
+ <span id="account_number_block" style="top:7.9cm;left:7.15cm;
+ position: absolute; min-width: 6cm;">
+ ACCOUNT NUMBER {{ doc.account_no or '' }}
+ </span>
+
+ <span id="routing_number_block" style="top:7.9cm;left:12cm;
+ position: absolute; min-width: 6cm;">
+ ROUTING_NUMBER
+ </span>
+ </div>
+ </div>
+
+ <div id="check_section_2" class="test_lines" style="top:9cm;">
+ <div class="payment_reference_block">
+ <table class="table table-responsive-sm">
+ <tr>
+ <td colspan="2">{{doc.party_name}}</td>
+ <td> {{ frappe.utils.formatdate(doc.reference_date) or '' }} </td>
+ <td style="text-align:right;" colspan="2"> {{doc.get_formatted("base_paid_amount")}} </td>
+ </tr>
+ {% if crs_doc.secondary_print_format or (not crs_doc.secondary_print_format and doc.references|length > 6) %}
+ <!-- Secondary Print Format specified in Check Run Settings, show comma-separated list of references -->
+ </table>
+ <br>
+ {% for reference in doc.references %}
+ <span>{{ reference.reference_name }}</span>
+ {{ ", " if not loop.last else "" }}
+ {% endfor %}
+ {% else %}
+ <!-- Secondary Print Format not specified in Check Run Settings, add table rows for each reference -->
+ <tr>
+ <th> Date </th>
+ <th style="text-align:left;"> Reference </th>
+ <th style="text-align:center;"> Amount </th>
+ <th style="text-align:right;"> Payment </th>
+ </tr>
+ {% for reference in doc.references %}
+ <tr>
+ {% if reference.reference_doctype == 'Purchase Invoice' %}
+ <td>{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "bill_date")) or ""}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "bill_no") or "" }}</td>
+ {% elif reference.reference_doctype == 'Sales Invoice' %}
+ <td style="text-align:left;">{{
+ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "po_date")) or ""}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "po_no") or "" }}</td>
+ {% elif reference.reference_doctype == 'Expense Claim' %}
+ <td style="text-align:left;">{{
+ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "posting_date")) or " "}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "name") or " " }}</td>
+ {% elif reference.reference_doctype == 'Journal Entry' %}
+ <td style="text-align:left;"> {{
+ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "posting_date")) or " "}}</td>
+ <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype,
+ reference.reference_name, "name") or " " }}</td>
+ {% endif %}
+ <td style="text-align:center;"> {{ frappe.utils.fmt_money(reference.get_formatted('total_amount'),
+ 2, 'USD')}}</td>
+ <td style="text-align:right;"> {{
+ frappe.utils.fmt_money(reference.get_formatted('allocated_amount'), 2, 'USD')}}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% endif %}
+ </div>
+ </div>
+</div>
+<div class="page-break"></div>
+{% endif %} |



To do:
Screenshot / Playwright test for primary, secondary and summary print view(move to separate issue)increment_print_countworkflow