Skip to content

Commit 925bb23

Browse files
authored
feat: backport issue_355 (#361)
1 parent b6c8d22 commit 925bb23

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

check_run/check_run/doctype/check_run/check_run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,10 @@ def get_entries(doc: CheckRun | str) -> dict:
792792
transaction.mode_of_payment = (
793793
frappe.get_value("Employee", transaction.party, "mode_of_payment") or settings.journal_entry
794794
)
795-
# Process Unpaid Transaction
796-
# start
795+
796+
if transaction.due_date and settings.show_due_date == "Show Days Past Due":
797+
transaction.due_date = (getdate(nowdate()) - transaction.due_date).days
798+
797799
outstanding_transaction = []
798800
if not isinstance(doc, CheckRun):
799801
if db_doc:

check_run/check_run/doctype/check_run_settings/check_run_settings.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717
"include_journal_entries",
1818
"include_expense_claims",
1919
"pre_check_overdue_items",
20+
"automatically_release_on_hold_invoices",
2021
"allow_cancellation",
2122
"cascade_cancellation",
2223
"validate_unique_check_number",
23-
"set_payment_entry_posting_date",
24+
"split_by_address",
2425
"column_break_9",
26+
"set_payment_entry_posting_date",
27+
"show_due_date",
2528
"number_of_invoices_per_voucher",
26-
"split_by_address",
27-
"automatically_release_on_hold_invoices",
29+
"secondary_print_format",
2830
"file_preview_threshold",
2931
"allow_stand_alone_debit_notes",
3032
"default_modes_of_payment_section_section",
@@ -307,10 +309,17 @@
307309
"fieldtype": "Select",
308310
"label": "CSV Quoting",
309311
"options": "Minimal\nAll\nNon-numeric\nNone"
312+
},
313+
{
314+
"default": "Show Due Date",
315+
"fieldname": "show_due_date",
316+
"fieldtype": "Select",
317+
"label": "Show Due Date",
318+
"options": "Show Due Date\nShow Days Past Due"
310319
}
311320
],
312321
"links": [],
313-
"modified": "2025-06-06 10:55:22.167358",
322+
"modified": "2025-06-22 14:56:43.637709",
314323
"modified_by": "Administrator",
315324
"module": "Check Run",
316325
"name": "Check Run Settings",

check_run/public/js/check_run/CheckRun.vue

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@
5353
>
5454
</th>
5555
<th class="col col-sm-1">
56-
<span @click="update_sort('due_date')" class="check-run-sort-indicator" id="check-run-due-date-sort"
56+
<span
57+
v-if="frm.settings.show_due_date == 'Show Days Past Due'"
58+
@click="update_sort('due_date')"
59+
class="check-run-sort-indicator"
60+
id="check-run-due-date-sort"
61+
>Days Past Due &#11021;</span
62+
>
63+
<span v-else @click="update_sort('due_date')" class="check-run-sort-indicator" id="check-run-due-date-sort"
5764
>Due Date &#11021;</span
5865
>
5966
</th>
@@ -62,19 +69,24 @@
6269
class="col col-sm-1"
6370
style="text-align: left">
6471
<div class="d-flex align-items-center justify-between gap-2">
65-
<span>Pay</span>
72+
<input
73+
type="checkbox"
74+
autocomplete="off"
75+
class="input-with-feedback reconciliation"
76+
data-fieldtype="Check"
77+
v-model="selectAll" /><span>Select All</span>
6678
<span class="filter-icon" style="cursor: pointer" @click="show_paid_filter = !show_paid_filter">
6779
<svg class="icon icon-sm">
6880
<use href="#icon-filter"></use>
6981
</svg>
7082
</span>
7183
</div>
72-
7384
<div v-if="show_paid_filter" class="mt-2">
7485
<select class="form-control form-select form-select-sm" v-model="filters.paid_filter">
7586
<option value="All">All</option>
7687
<option value="Paid">Paid</option>
7788
<option value="Unpaid">Unpaid</option>
89+
<option value="On Hold">On Hold</option>
7890
</select>
7991
</div>
8092
</th>
@@ -143,8 +155,11 @@
143155
<span v-else>{{ transactions[item.name].mode_of_payment }}</span>
144156
</td>
145157
<td>{{ format_currency(item.amount, frm.pay_to_account_currency, 2) }}</td>
146-
<td>{{ datetime.str_to_user(item.due_date) }}</td>
147-
<td v-if="['Draft', 'Pending Approval', 'Approved'].includes(frm.doc.status)" style="text-align: left">
158+
<td>{{ item.due_date }}</td>
159+
<td v-if="item.on_hold && frm.settings.automatically_release_on_hold_invoices == 0">
160+
<span style="font-weight: bold">On Hold</span>
161+
</td>
162+
<td v-else-if="['Draft', 'Pending Approval', 'Approved'].includes(frm.doc.status)" style="text-align: left">
148163
<input
149164
type="checkbox"
150165
class="input-with-feedback checkrun-check-box"
@@ -197,6 +212,7 @@ let orderedTransactions = computed(() => {
197212
if (filters.paid_filter && filters.paid_filter !== 'All') {
198213
if (filters.paid_filter === 'Paid' && !item.pay) return false
199214
if (filters.paid_filter === 'Unpaid' && item.pay) return false
215+
if (filters.paid_filter === 'On Hold' && !item.on_hold) return false
200216
}
201217
202218
return true

0 commit comments

Comments
 (0)