Skip to content

Commit

Permalink
Merge pull request #36918 from frappe/mergify/bp/version-14-hotfix/pr…
Browse files Browse the repository at this point in the history
…-36908

fix: only show "Unreconcile" if reconciled (#36908)
  • Loading branch information
deepeshgarg007 authored Sep 2, 2023
2 parents 543e4c8 + 61752ac commit 78051e7
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 78051e7

Please sign in to comment.