Skip to content

Commit

Permalink
fix: filter reference name by cost center in journal entry account (f…
Browse files Browse the repository at this point in the history
…rappe#17948)

* fix: filter reference name by cost center in journal entry account if reference_type is Sales Invoice or Purchase Invoice

* Update journal_entry.js
  • Loading branch information
rushparikh authored and nabinhait committed Jul 22, 2019
1 parent 0bbfca8 commit 40240b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/accounts/doctype/journal_entry/journal_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({

if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);

// Filter by cost center
if(jvd.cost_center) {
out.filters.push([jvd.reference_type, "cost_center", "in", ["", jvd.cost_center]]);
}
// account filter
frappe.model.validate_missing(jvd, "account");
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
Expand Down

0 comments on commit 40240b7

Please sign in to comment.