Merge pull request #53430 from sagarvora/auto-cancel-exempt

fix: exempt ledger entries and closing balance from auto-cancellation
This commit is contained in:
Sagar Vora
2026-03-13 18:06:21 +00:00
committed by GitHub
4 changed files with 20 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
// frappe.ui.form.on("Account Closing Balance", {
// refresh(frm) {
// },
// });
frappe.ui.form.on("Account Closing Balance", {
refresh(frm) {
frm.page.btn_secondary.hide();
},
});

View File

@@ -3,6 +3,7 @@
frappe.ui.form.on("Advance Payment Ledger Entry", {
refresh(frm) {
frm.page.btn_secondary.hide();
frm.set_currency_labels(["amount"], frm.doc.currency);
frm.set_currency_labels(["base_amount"], erpnext.get_currency(frm.doc.company));
},

View File

@@ -2,6 +2,7 @@
// For license information, please see license.txt
frappe.ui.form.on("Payment Ledger Entry", {
// refresh: function(frm) {
// }
refresh(frm) {
frm.page.btn_secondary.hide();
},
});

View File

@@ -418,11 +418,19 @@ naming_series_variables = {
for variable in naming_series_variables_list
}
# On cancel event Payment Entry will be exempted and all linked submittable doctype will get cancelled.
# to maintain data integrity we exempted payment entry. it will un-link when sales invoice get cancelled.
# if payment entry not in auto cancel exempted doctypes it will cancel payment entry.
auto_cancel_exempted_doctypes = [
# On cancel event Payment Entry will be exempted and all linked submittable doctype will get cancelled.
# to maintain data integrity we exempted payment entry. it will un-link when sales invoice get cancelled.
# if payment entry not in auto cancel exempted doctypes it will cancel payment entry.
"Payment Entry",
# Reverse ledger entries are created instead to ensure ledger immutability.
"GL Entry",
"Stock Ledger Entry",
"Payment Ledger Entry",
"Advance Payment Ledger Entry",
# May be linked to Period Closing Voucher, but cancelled with custom logic in PCV.
# This is better to avoid stale docs when cancelling PCV from backend.
"Account Closing Balance",
]
scheduler_events = {