Skip to content

Commit

Permalink
fix: only show "Unreconcile" if reconciled
Browse files Browse the repository at this point in the history
(cherry picked from commit 91e5746)
  • Loading branch information
barredterra authored and mergify[bot] committed Sep 2, 2023
1 parent 543e4c8 commit 61752ac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions erpnext/accounts/doctype/bank_transaction/bank_transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 61752ac

Please sign in to comment.