fix: only show "Unreconcile" if reconciled

(cherry picked from commit 91e574609f)
This commit is contained in:
barredterra
2023-06-15 18:09:56 +02:00
committed by Mergify
parent 543e4c87ea
commit 61752ac2b4

View File

@@ -13,10 +13,11 @@ frappe.ui.form.on("Bank Transaction", {
}); });
}, },
refresh(frm) { refresh(frm) {
frm.add_custom_button(__('Unreconcile Transaction'), () => { if (!frm.is_dirty() && frm.doc.payment_entries.length > 0) {
frm.call('remove_payment_entries') frm.add_custom_button(__("Unreconcile Transaction"), () => {
.then( () => frm.refresh() ); frm.call("remove_payment_entries").then(() => frm.refresh());
}); });
}
}, },
bank_account: function (frm) { bank_account: function (frm) {
set_bank_statement_filter(frm); set_bank_statement_filter(frm);