Skip to content

Commit

Permalink
Merge pull request #37956 from ruthra-kumar/type_error_on_payment_entry
Browse files Browse the repository at this point in the history
fix: type error on new payment entry
  • Loading branch information
ruthra-kumar authored Nov 7, 2023
2 parents cfe0479 + adff287 commit 0135293
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/payment_entry/payment_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ 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})) {
if((frm.doc.references) && (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'));
Expand Down

0 comments on commit 0135293

Please sign in to comment.