Merge pull request #36918 from frappe/mergify/bp/version-14-hotfix/pr-36908

fix: only show "Unreconcile" if reconciled (#36908)
This commit is contained in:
Deepesh Garg
2023-09-02 17:46:27 +05:30
committed by GitHub

View File

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