fix: filter reference name by cost center in journal entry account (#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
This commit is contained in:
parent
0bbfca8142
commit
40240b7d96
@ -223,7 +223,10 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
|||||||
|
|
||||||
if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
|
if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
|
||||||
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
|
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
|
// account filter
|
||||||
frappe.model.validate_missing(jvd, "account");
|
frappe.model.validate_missing(jvd, "account");
|
||||||
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
|
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user