Skip to content

Commit

Permalink
refactor: replace in_list(array, member) with `array.includes(membe…
Browse files Browse the repository at this point in the history
…r)` (#1513)

(cherry picked from commit dbf4f1c)
  • Loading branch information
barredterra authored and mergify[bot] committed Mar 11, 2024
1 parent 7c619f0 commit e7277b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hrms/public/js/erpnext/journal_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ frappe.ui.form.on("Journal Entry", {
]
};

if (in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
if (["Sales Invoice", "Purchase Invoice"].includes(jvd.reference_type)) {
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
// Filter by cost center
if (jvd.cost_center) {
Expand All @@ -61,7 +61,7 @@ frappe.ui.form.on("Journal Entry", {
out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
}

if (in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
if (["Sales Order", "Purchase Order"].includes(jvd.reference_type)) {
// party_type and party mandatory
frappe.model.validate_missing(jvd, "party_type");
frappe.model.validate_missing(jvd, "party");
Expand Down

0 comments on commit e7277b9

Please sign in to comment.