Get customer balance of specific cost center using method erpnext.accounts.utils.get_balance_on

I want to show the balance of customer in specific cost center but i am not able to retrieve it, it gives me the total balance in all cost centers, my custom javascript code is below,
Please help me If anyone have idea to do that. will be thankful…
frappe.ui.form.on(‘Sales Invoice’, {
refresh(frm) {
cur_frm.cscript.customer = function(doc) {
method: “erpnext.accounts.utils.get_balance_on”,
args: {company:, cost_center: doc.cost_center, account:‘DEBTORS - WF’, date: doc.posting_date, party_type: ‘Customer’, party: doc.customer},
callback: function(r) {
doc.outstanding_balance = format_currency(r.message, erpnext.get_currency(;
refresh_field(‘outstanding_balance’, ‘accounts’);
validate: function(frm) {
frm.set_value(‘remarks’, ‘’);
frm.doc.items.forEach(function(item) {
frm.doc.remarks += ${item.item_name} = ${item.qty} @ ${item.rate}\n;

You will have to write a custom whitelisted method and then pass the parameters like Company, Cost Center etc.