Skip to content

Commit

Permalink
fix: only show "Unreconcile" if reconciled
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Sep 1, 2023
1 parent 0e51722 commit 91e5746
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 91e5746

Please sign in to comment.