Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: button in Payment Entry to filter associated Journals #37200

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ frappe.ui.form.on('Payment Entry', {
frm.events.set_dynamic_labels(frm);
frm.events.show_general_ledger(frm);
erpnext.accounts.ledger_preview.show_accounting_ledger_preview(frm);
if(frm.doc.references.find((elem) => {return elem.exchange_gain_loss != 0})) {
frm.add_custom_button(__("View Exchange Gain/Loss Journals"), function() {
frappe.set_route("List", "Journal Entry", {"voucher_type": "Exchange Gain Or Loss", "reference_name": frm.doc.name});
}, __('Actions'));

}
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm);
},

Expand Down
6 changes: 3 additions & 3 deletions erpnext/public/js/utils/unreconcile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ erpnext.accounts.unreconcile_payments = {
},
callback: function(r) {
if (r.message) {
frm.add_custom_button(__("Un-Reconcile"), function() {
frm.add_custom_button(__("UnReconcile"), function() {
erpnext.accounts.unreconcile_payments.build_unreconcile_dialog(frm);
}, __('Actions'));
}
Expand Down Expand Up @@ -87,11 +87,11 @@ erpnext.accounts.unreconcile_payments = {
unreconcile_dialog_fields[0].get_data = function(){ return r.message};

let d = new frappe.ui.Dialog({
title: 'Un-Reconcile Allocations',
title: 'UnReconcile Allocations',
fields: unreconcile_dialog_fields,
size: 'large',
cannot_add_rows: true,
primary_action_label: 'Un-Reconcile',
primary_action_label: 'UnReconcile',
primary_action(values) {

let selected_allocations = values.allocations.filter(x=>x.__checked);
Expand Down
Loading